星期五, 5月 24, 2013
運動 喝紫蘇籽油 補充左旋麩醯胺酸 以及 益生菌
星期四, 5月 23, 2013
hp-ux system backup (WITHOUT Mirror/UX License)
1. Insert Backup Disk into server slot 2.
2. Check if server can detect new disk.
server # ioscan -fnC disk
Class I H/W Path Driver S/W State H/W Type Description
======================================================================
disk 0 0/0/1/1.15.0 sdisk CLAIMED DEVICE HP 18.2GMAN3184MC
/dev/dsk/c1t15d0 /dev/rdsk/c1t15d0
disk 0 0/0/1/3.15.0 sdisk CLAIMED DEVICE HP 18.2GMAN3184MC
/dev/dsk/c3t15d0 /dev/rdsk/c3t15d0
3. c1t15d0 is system disk, c3t15d0 is backup disk.
4. Start to duplicate disk...
#dd if=/dev/rdsk/c1t15d0 of=/dev/rdsk/c3t15d0 bs=1024k
5. When finished, back to prompt,
6. Unplug Backup Disk from server slot 2, and then insert this backup disk into backup-server slot1.
7. Do not connect LAN.
8. Power on backup-server
9. Make sure primaty boot order is 0/0/1/1.15.0
10. Boot from Backup Disk.
11. When boot into hp-ux finished, login by root
12. Stop platform first.
#p7stop -s
13. Make sure this backup-server is date/time correct, if not correct, please correct it first.
14. You can correct time/date by connect backup-server onto lan, and using NTP server. But please change ip first.
15. HP-UX How to Change IP
# ioscan -fnC lan
Class I H/W Path Driver S/W State H/W Type Description
==========================================================================
lan 0 0/0/0/1/0 btlan CLAIMED INTERFACE HP PCI 10/100Base-TX Core
/dev/diag/lan0 /dev/ether0 /dev/lan0
15.1. 若看不到卡,請使用 ioscan 判斷是否有網路卡但需要驅動程式或未正確驅動 (UNCLAIMED)。
# ioscan -fn
15.2. 檢視有綁定 IP 位址的卡片資訊。
server # netstat -in
Name Mtu Network Address Ipkts Opkts
lan0 1500 140.133.26.0 140.133.26.13 719753 724185
lo0 4136 127.0.0.0 127.0.0.1 24396 24396
15.3. 針對每一個介面執行 ifconfig,確認正確的 IP、網路遮罩和廣播位址。例如:
server # ifconfig lan0
lan0: flags=843<UP,BROADCAST,RUNNING,MULTICAST>
inet 140.133.26.13 netmask ffffff00 broadcast 140.133.26.255
15.4. 設定IP(永久性的)
要永久性的設定IP,請透過sam(System Admin Manager)來設定,
使用sam設定IP,之後即使重開機,網路設定仍會被記住。
sam->network and communication -> interface card
如果知道自己在做什麼,也可以考慮直接編輯網路的設定檔,例如:
# vi /etc/rc.config.d/netconf
# /sbin/init.d/net start
15.5. 設定IP(非永久性的加IP,重開機後設定即消失),給他一個temporary IP (140.133.26.20)
# ifconfig lan0 140.133.26.20 netmask 255.255.255.0 up
15.6. Ping CHT-I NTP server 140.133.31.126
16. HP-UX NTP設定, make sure backup-server is date/time the same with lan.
16.1. 編輯設定檔 /etc/ntp.conf ,加入CHT-I ntp server為ntp server (其實已經設好了,不須更動,除非要改ntp server).
server 140.133.31.126 # NTP server
16.2. 重新啟動 NTP 服務
# /sbin/init.d/xntpd restart
16.3.過一段時間後,再檢查是否與ntp server 對時
# /usr/sbin/ntpq -p
成功的話,會出現對時的ntp server ip,及對時後調整時間的訊息。
如出現 No association ID's returned 則表示沒有成功。
16.4. 下列我實際的查詢結果(有啟用xntpd)
# ps -ef |grep ntp
root 1807 1 0 Aug 20 ? 20:11 /usr/sbin/xntpd
server # ntpq -p
remote refid st t when poll reach delay offset disp
=========================================================
*NTP 192.168.33.4 5 u 43 64 377 8.87 0.533 1.62
17. 確定NTP已經sync成功後,接著就可以準備切換備機。
18. 切換備機程序:
19. In server
19.1. stop platform
19.2. unplug lan
20. In backup-server
20.1. make sure IP is the same with server 140.133.26.13 , if not, please change ip the same with server.
#ifconfig lan0 140.133.26.13 netmask 255.255.255.0 up
20.2. connect lan.
20.3. start platform
...
...
...
21. 恭喜,備機已經上線。
hp-ux system backup procedure (with Mirror/UX License)
HP-UX HDD Backup SOP
2013/2/8 更新 by Henry
2013/2/21 更新,加入4.1, 4.2
1. Shutdown
2. 拔出一顆硬碟,作為備份硬碟, 代號HDD0。
3. 開機,確保還在主機上的硬碟可正確開機,代號HDD1。
PS.若要確保備份硬碟代號HDD0也可以正常開機運作,待HDD1開機確認後,關機,拔出HDD1,插入HDD0,開機確認系統可正常運作。
4. 執行
#vgexport /dev/vg00
讓lvm重新搜尋現有的PV與更新/etc/lvmtab 設定。
否則無法成功執行下面指令(lvreduce or vgreduce...)
確認vgexport 成功。
If that fails then you should do a vgscan.
1) mv /etc/lvmtab /etc/lvmtab.sav
2) vgscan -a
4.1 Reducing mirror from root vg -- vg00
for i in 1 2 3 4 5 6 7 8 9 10;do lvreduce -m 0 /dev/vg00/lvol$i;done
vgreduce -f vg00
or
vgreduce /dev/vg00 /dev/dsk/c2t1d0
還未插入新硬碟(代號HDD2)時,只抓到一顆硬碟(HDD0)。
server # ioscan -fnC disk
Class I H/W Path Driver S/W State H/W Type Description
=========================================================================
disk 0 0/0/2/0.0.0.0 sdisk CLAIMED DEVICE TEAC DV-28E-N
/dev/dsk/c0t0d0 /dev/rdsk/c0t0d0
disk 1 0/1/1/0.0.0 sdisk CLAIMED DEVICE HP 146 GST3146855LC
/dev/dsk/c2t0d0 /dev/rdsk/c2t0d0
^^^^^^^^^^^
代號HDD0
5. online插入新硬碟(HDD2)。
6. 執行#ioscan -fnC disk 確認新硬碟(HDD2)有被抓到。
EXAMPLE:
插入新硬碟後,會抓到第二顆HDD (HDD2)。
server # ioscan -fnC disk
Class I H/W Path Driver S/W State H/W Type Description
=========================================================================
disk 0 0/0/2/0.0.0.0 sdisk CLAIMED DEVICE TEAC DV-28E-N
/dev/dsk/c0t0d0 /dev/rdsk/c0t0d0
disk 1 0/1/1/0.0.0 sdisk CLAIMED DEVICE HP 146 GST3146855LC
/dev/dsk/c2t0d0 /dev/rdsk/c2t0d0
disk 2 0/1/1/0.1.0 sdisk CLAIMED DEVICE COMPAQ BF14688577
/dev/dsk/c2t2d0 /dev/rdsk/c2t2d0
^^^^^^^^^^^
HDD2
7. Adding mirroring to the root vg - vg00
7.1. pvcreate -B /dev/rdisk/c2t2d0
* Create the PV on the second disk so that LVM can manage it
* -B makes it a bootable volume
7.2. mkboot /dev/rdsk/c2t2d0
* Installs the boot files on the second disk
7.3. mkboot -a "hpux -lq (;0)/stand/vmunix" /dev/rdsk/c2t2d0
* Creates an autoboot file on the disk, with information on how to boot
7.4. vgextend /dev/vg00 /dev/dsk/c2t2d0
* extends the volume group to include this second disk.
7.5. vgdisplay -v vg00
* To verify that the second disk is now part of the volume group
7.6. lvlnboot -v
* To verify that the system thinks this disk can boot
7.7. lvextend -m 1 /dev/vg00/lvol1 /dev/dsk/c2t2d0
* This extends the logical volume to the mirrored disk, effectively creating the mirrored copy.
* This command needs to be run for each logical volume in the volume group
注意:每一個lvol*都要做。
EXAMPLE:
server # lvextend -m 1 /dev/vg00/lvol$i /dev/dsk/c2t1d0;done
The newly allocated mirrors are now being synchronized. This operation will
take some time. Please wait ....
Logical volume "/dev/vg00/lvol1" has been successfully extended.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf
The newly allocated mirrors are now being synchronized. This operation will
take some time. Please wait ....
Logical volume "/dev/vg00/lvol2" has been successfully extended.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf
7.8 偷懶方式如下:跑回圈一次lvextend全部
for i in 1 2 3 4 5 6 7 8 9 10;do lvextend -m 1 /dev/vg00/lvol$i /dev/dsk/c2t1d0;done
8. done~~
星期三, 5月 22, 2013
hp-ux console 好用指令
1. Backspace不能用:
a. Using "Shift + Backspace", it is working.
b. 定義 erase = ^? , Backspace就可以用了:
#stty erase ^?
2. 行數太大:
a. 定義行數為24行
#stty rows 24
ps. 可用下列指令來看目前定義的stty
# stty -a
speed 9600 baud; line = 0;
rows = 0; columns = 0
min = 1; time = 0;
intr = ^C; quit = ^\; erase = ^H; kill = ^U
eof = ^D; eol = ^@; eol2 <undef>; swtch <undef>
stop = ^S; start = ^Q; susp <undef>; dsusp <undef>
werase <undef>; lnext <undef>
-parenb -parodd cs8 -cstopb hupcl cread -clocal -loblk -crts
-ignbrk brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl -iuclc
ixon ixany ixoff -imaxbel -rtsxoff -ctsxon -ienqak
isig icanon -iexten -xcase echo echoe echok -echonl -noflsh
-echoctl -echoprt -echoke -flusho -pendin
opost -olcuc onlcr -ocrnl -onocr -onlret -ofill -ofdel -tostop
Linux server backup SOP (using mdadm)
0 8 1 0 active sync /dev/sda1
1 0 0 1 removed
Filesystem Size Used Avail Use% Mounted on
/dev/md0 26G 12G 14G 47% /
udev 7.9G 204K 7.9G 1% /dev
/dev/md2 11G 46M 10G 1% /home
/dev/md3 13G 97M 12G 1% /CDRagent
0 8 1 0 active sync /dev/sda1
1 8 17 1 active sync /dev/sdb1
Disk /dev/sdb: 146.8 GB, 146815737856 bytes
255 heads, 63 sectors/track, 17849 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 * 1 3264 26218048+ fd Linux raid autodetect
/dev/sdb2 3265 3526 2104515 fd Linux raid autodetect
/dev/sdb4 4833 17848 104551020 f W95 Ext'd (LBA)
/dev/sdb5 4833 6399 12586896 fd Linux raid autodetect
星期五, 5月 17, 2013
遇見中醫
為什麼會寫這篇文章呢,因為四年多來,小弟我不斷的變胖,足足胖了7公斤,身體越來越多小問題,穿褲子腰被束住也不舒服,所以兩個禮拜前我決定要減肥,跟著Fitness Blender 的 8 Week Programs for Fat Loss and Toning 做Fitness健身減肥體操,剛好遇到他們做活動,就便宜的買了他們的eBook來跟著做。沒想到每次短短30~60分鐘,都留得滿身是汗,真的有累到,沒多久,我的右腳肌腱覺得怪怪的,走路會有點痛,查了一下,應該是肌腱發炎,痛第二天的時候,我決定要看醫生,想了想,還是想到遇見中醫給姜醫師看,於是周三下午掛了號,給 醫生看時,姜醫師說一是拉筋拉不夠,二是一樣筋扭曲了,所以在強力的跳動時會受傷,醫生手按了幾下我的小腿,動一下小腿,撥幾下肉(筋),之後說,這個針灸比較快,於是就給姜醫生針了。剛看完到當天晚上,肌腱都還是有點隱隱作痛,但是當天晚上,我還是繼續我的健身減肥課程,這時候就覺得沒那麼明顯在痛了,我當天開始也特別注重自己的拉筋,到了隔天,幾乎已經不太有感覺會痛了,真的很棒,姜醫師真的有一套,俗話說,一技在身受用無窮,遇見中醫這個奇特的醫院名稱,姜醫師也是名符其實。
星期一, 5月 13, 2013
肥胖 熬夜 跟我身體狀況的奇妙關聯
1. 運動活動量大大的減少,以前每天都會打球或是有童軍團戶外活動,活動量非常的大。
2. 大學前我的體重也在60kg以下,上大學後,在宿舍裡每天都是三點後才睡。
3. 開始常態吃消夜
慢慢地,我的胃開始出現了問題,到了大四,已經是幾乎每天都在隱隱作痛。
由於最近做了自律神經檢測緣故,我發現自己的交感副交感活性非常不平衡,醫生提醒我運動與熬夜跟自身自律神經活性的關聯,我決定要開始運動,以及減肥,目前我的體重是67kg, 真是恐怖,短短10年,我就胖了9公斤,尤其是後面的5公斤,都是工作之後加上去的~~希望能夠瘦到60公斤以下,達到5字頭XD。接著是熬夜的部分,老實說,這是最難的,只能盡量做到...
目前的運動狀況:
5/2 蘆洲市區快走一圈 4 km (Avg. Pace 10:18min/km)
5/3 蘆洲市區快走一圈 5.41 km (Avg. Pace 10:42min/km)
5/4 河堤慢跑 4.56 km (Avg. Pace 7:52min/km)
5/4 市區快走 4.50 km (Avg. Pace 9:16min/km)
5/5 微風運河慢跑 4.48 km (Avg. Pace 7:31min/km)
5/6 微風運河慢跑 6.66 km (Avg. Pace 8:03min/km)
2013/5/17 Update
目前跟著Fitness Blender這個網站的8 Week Programs for Fat Loss and Toning eBook在做,加上前一周自己的慢跑,做五天後,我發現自己的腰圍應該有瘦了大約0.5~1CM, 因為穿褲子可以察覺的到。