如何備份 Solaris 系統ㄌㄟ?(二)

這一篇要說的是部分資料或者說目錄好了的備份方式,相對來說會比上一篇簡單點,也就是採用 tar 命令來完成,這裡用兩個範例來說明:

首先第一個例子是把整個 /CMSshare 目錄備份到 TAPE:

root@cms0 # cd /CMSshare (切換到要備份的目錄)
root@cms0 # mt rew (備份前先把 TAPE 倒帶一下吧)
root@cms0 # /usr/local/bin/tar cvf /dev/rmt/0n ./* (這裡其中 0n 指備份完不倒帶,若只有0是備份完就倒帶)

root@cms0 # mt rew (檢查前先把 TAPE 倒帶一下吧)
root@cms0 # /usr/local/bin/tar tvf /dev/rmt/0n (檢查一下剛剛備份的資料)

這裡是把備份到 TAPE 的資料還原回 /CMSshare 目錄:

root@cms0 # cd /CMSshare (切換到要還原的目錄)
root@cms0 # mt rew (還原前一樣先把 TAPE 倒帶一下吧)
root@cms0 # /usr/local/bin/tar xfp /dev/rmt/0

接下來第二個例子是把整個 c3t3d0 上的 /CMSshare 目錄 (c3t3d0s6,因為是外接的 3310 Storage) 備份到 c1t2d0 :

Step1:
先檢查一下目前的 Disk format 狀態吧:
root@cms0 # format

Step2: 把新的 72G HDD 放進 c1t2d0, 然後用 devfsadm 重新掃一下這顆 HDD 吧:
root@cms0 # devfsadm


Step3: 再檢查一次目前的 Disk format 狀態:
root@cms0 # format


>>> 新的 HDD 應該會出現在 AVAILABLE DISK SELECTIONS:
2. c1t2d0 (SUN72G cyl 14087 alt 2 hd 24 sec 424)
/pci@1c,600000/scsi@2/sd@2,0

Specify disk (enter its number): ^D ( Ctrl+d 離開吧)
root@cms0 #


Step4: detect c1t2d0 的新 HDD 後我們先把 c1t2d0s2 做 newfs 的動作:
root@cms0 # newfs /dev/rdsk/c1t2d0s2


Step5: 把 c1t2d0s2 mount 到 /mnt 去吧,然後檢查一下是不是有看到 lost+found:
root@cms0 # mount /dev/dsk/c1t2d0s2 /mnt
root@cms0 # ls -alrt /mnt

total 22
drwxr-xr-x 33 root root 2048 Oct 3 16:07 ..
drwx------ 2 root root 8192 Oct 23 18:19 lost+found
drwxr-xr-x 3 root root 512 Oct 23 18:19 .

Step6: 檢查一下目前 /CMSshare 和 /mnt 的 Disk partition:
root@cms0 # df -k

Filesystem kbytes used avail capacity Mounted on
/dev/dsk/c3t3d0s6 104025041 82993939 19990852 81% /CMSshare
/dev/dsk/c1t2d0s2 70592505 9 69886571 1% /mnt

Step7: 開始 Dump /CMSshare 的資料到 c1t2d0s2:
root@cms0 # cd /CMSshare

root@cms0 # /usr/local/bin/tar cvf - ./*|(cd /mnt; /usr/local/bin/tar xfp -)


Step8: Dump 完 /CMSshare 的資料後把 c1t2d0s2 從 /mnt umount 掉吧:
root@cms0 # umount /mnt


Step9: 現在可以把新 HDD 拔出 c1t2d0 囉。

這樣就算備份完成囉....簡單吧。
(詳全文...)

如何備份 Solaris 系統ㄌㄟ?(一)

昨天寫到 Linux 上的備份還原機制,就看到 Vicky 的留言,所以今天就把 Solaris 上的備份方式也貼上來好了。這裡我們的示範環境為 SunFire v240 的機器上面 OS Solaris 8 (其中 c1t0d0 和 c1t1d0 SDS mirror,然後 c1t2d0 用來備份測試,不過關於 SDS 的部分以後再說吧,雖然那也是一種備份整顆 HDD 資料的方式):

首先,比較簡單的方式就是用 dd 命令來直接備份整顆 c1t0d0 的資料( OS ) c1t2d0

Step1: 先檢查一下目前的 Disk format 狀態吧:
root@cms0 # format

Step2: 把新的 72G HDD 放進 c1t2d0, 然後用 devfsadm 重新掃一下這顆 HDD 吧:
root@cms0 # devfsadm

Step3: 再檢查一次目前的 Disk format 狀態:
root@cms0 # format

>>> 新的 HDD 應該會出現在 AVAILABLE DISK SELECTIONS:
2. c1t2d0 (SUN72G cyl 14087 alt 2 hd 24 sec 424)
/pci@1c,600000/scsi@2/sd@2,0

Specify disk (enter its number): ^D ( Ctrl+d 離開吧)
root@cms0 #

Step4: detect c1t2d0 的新 HDD 後我們開始把目前 c1t0d0 partition table 備一份到 c1t2d0 的新 HDD 囉:
root@cms0 # prtvtoc /dev/rdsk/c1t0d0s2 | fmthard -s - /dev/rdsk/c1t2d0s2
fmthard: New volume table of contents now in place.

Step5: 接著就可以開始 dump c1t0d0 上含 OS 的資料到 c1t2d0 了:
root@cms0 # dd if=/dev/rdsk/c1t0d0s2 of=/dev/rdsk/c1t2d0s2 bs=2048k

Step6: Dump 完資料後就可以把新 HDD 拔出 c1t2d0 囉。

第二種方式,使用 ufsdump 命令來做,不過這種方式因為是以一個一個 mount point 來做,所以相對比較麻煩,而且對於跨 mount point 的 link,在做完要使用新 HDD 時,需要記得先手動把這些目錄建回來喔!!

Step1: 跟使用 dd 一樣,先檢查一下目前的 Disk format 狀態吧:
root@cms0 # format

Step2: 把新的 72G HDD 放進 c1t2d0, 然後用 devfsadm 重新掃一下這顆 HDD 吧:
root@cms0 # devfsadm

Step3: 再檢查一次目前的 Disk format 狀態:
root@cms0 # format

>>> 新的 HDD 應該會出現在 AVAILABLE DISK SELECTIONS:
2. c1t2d0 (SUN72G cyl 14087 alt 2 hd 24 sec 424)
/pci@1c,600000/scsi@2/sd@2,0

Specify disk (enter its number): ^D ( Ctrl+d 離開吧)
root@cms0 #

Step4: detect c1t2d0 的新 HDD 後我們開始把目前 c1t0d0 partition table 備一份到 c1t2d0 的新 HDD 囉:
root@cms0 # prtvtoc /dev/rdsk/c1t0d0s2 | fmthard -s - /dev/rdsk/c1t2d0s2
fmthard: New volume table of contents now in place.

Step5: 先 newfs 一下 /dev/rdsk/c1t2d0s0 給 / partition 用:
root@cms0 # newfs /dev/rdsk/c1t2d0s0


Step6: 把 c1t2d0s0 mount 到 /mnt 去吧,然後檢查一下是不是有看到 lost+found:

root@cms0 # mount /dev/dsk/c1t2d0s0 /mnt

root@cms0 # ls -alrt /mnt
total 22
drwxr-xr-x 33 root root 2048 Oct 3 16:07 ..
drwx------ 2 root root 8192 Oct 23 18:19 lost+found
drwxr-xr-x 3 root root 512 Oct 23 18:19 .

Step7: 檢查一下目前的 Disk partition for / and /mnt:

root@cms0 # df -k

Filesystem kbytes used avail capacity Mounted on
/dev/dsk/c1t0d0s0 10177036 1047539 9027727 11% /
/dev/dsk/c1t2d0s0 11219980 9 11107772 1% /mnt

Step8: 開始 Dump / 的資料到 c1t2d0s0:

root@cms0 # cd /

root@cms0 # ufsdump 0uf - . | (cd /mnt; ufsrestore xf -);date

( 敲入“y” 兩次來確認)

set owner/mode for '.'? [yn] y
Directories already exist, set modes anyway? [yn] y

root@cms0 # iostat -cnzx 10 (用來檢查目前的 I/O status,這裡的 10 是每 10 秒的意思啦)


Step9: 再檢查一次目前的 Disk partition for /ot and /mnt:

root@cms0 # df -k

Filesystem kbytes used avail capacity Mounted on
/dev/dsk/c1t0d0s0 10177036 1047539 9027727 11% /
/dev/dsk/c1t2d0s0 10177036 1047569 9027697 11% /mnt

Step10: Install boot for / partition
:(這一步千萬別忘了唷)
root@cms0 # installboot /usr/platform/`uname -i`/lib/fs/ufs/bootblk /dev/rdsk/c1t1d0s0


Step11: Dump 完 / 的資料後把 c1t2d0s0 從 /mnt umount 掉吧:

root@cms0 # umount /mnt


Step12: 再來 newfs 一下 /dev/rdsk/c1t2d0s4 給 /var partition 用:
root@cms0 # newfs /dev/rdsk/c1t2d0s4


Step13: 把 c1t2d0s4 mount 到 /mnt 去吧,然後檢查一下是不是有看到 lost+found:
root@cms0 # mount /dev/dsk/c1t2d0s4 /mnt

root@cms0 # ls -alrt /mnt

total 22
drwxr-xr-x 33 root root 2048 Oct 3 16:07 ..
drwx------ 2 root root 8192 Oct 23 18:19 lost+found
drwxr-xr-x 3 root root 512 Oct 23 18:19 .

Step14: 檢查一下目前的 Disk partition for /var and /mnt:
root@cms0 # df -k

Filesystem kbytes used avail capacity Mounted on
/dev/dsk/c1t0d0s4 10080200 2563351 7416047 26% /var
/dev/dsk/c1t2d0s4 11219980 9 11107772 1% /mnt

Step15: 開始 Dump /var 的資料到 c1t2d0s4:

root@cms0 # cd /var

root@cms0 # ufsdump 0uf - . | (cd /mnt; ufsrestore xf -);date

( 敲入“y” 兩次來確認)
set owner/mode for '.'? [yn] y
Directories already exist, set modes anyway? [yn] y
root@cms0 # iostat -cnzx 10 (用來檢查目前的 I/O status,這裡的 10 是每 10 秒的意思啦)

Step16: 再檢查一次目前的 Disk partition for /var and /mnt:

root@cms0 # df -k

Filesystem kbytes used avail capacity Mounted on
/dev/dsk/c1t0d0s4 10080200 2563383 7416015 26% /var
/dev/dsk/c1t1d0s4 11219980 2563374 8544407 25% /mnt

Step17: Dump 完 /
var 的資料後把 c1t2d0s4 從 /mnt umount 掉吧:
root@cms0 # umount /mnt


Step18: 再來 newfs 一下 /dev/rdsk/c1t2d0s5 給 /oracle partition 用:
root@cms0 # newfs /dev/rdsk/c1t2d0s5


Step19: 把 c1t2d0s5 mount 到 /mnt 去吧,然後檢查一下是不是有看到 lost+found:
root@cms0 # mount /dev/dsk/c1t2d0s5 /mnt

root@cms0 # ls -alrt /mnt

total 22
drwxr-xr-x 33 root root 2048 Oct 3 16:07 ..
drwx------ 2 root root 8192 Oct 23 18:19 lost+found
drwxr-xr-x 3 root root 512 Oct 23 18:19 .

Step20: 檢查一下目前的 Disk partition for /oracle and /mnt:
root@cms0 # df -k

Filesystem kbytes used avail capacity Mounted on
/dev/dsk/c1t0d0s5 20545897 1964723 18375716 10% /oracle
/dev/dsk/c1t2d0s5 20545897 9 20340430 1% /mnt

Step21: 開始 Dump /oracle 的資料到 c1t2d0s5 >>

root@cms0 # cd /oracle

root@cms0 # ufsdump 0uf - . | (cd /mnt; ufsrestore xf -);date

( 敲入“y” 兩次來確認)

set owner/mode for '.'? [yn] y
Directories already exist, set modes anyway? [yn] y
root@cms0 # iostat -cnzx 10 (用來檢查目前的 I/O status,這裡的 10 是每 10 秒的意思啦)


Step22: 再檢查一次目前的 Disk partition for
/oracle and /mnt:
root@cms0 # df -k

Filesystem kbytes used avail capacity Mounted on
/dev/dsk/c1t0d0s5 20545897 1964723 18375716 10% /oracle
/dev/dsk/c1t1d0s5 20545897 1964769 18375670 10% /mnt

Step23: Dump 完
/oracle 的資料後把 c1t2d0s5 從 /mnt umount 掉吧:
root@cms0 # umount /mnt


Step24: 再來 newfs 一下 /dev/rdsk/c1t2d0s6 給 /opt partition 用:
root@cms0 # newfs /dev/rdsk/c1t2d0s6


Step25: 把 c1t2d0s6 mount 到 /mnt 去吧,然後檢查一下是不是有看到 lost+found:
root@cms0 # mount /dev/dsk/c1t2d0s6 /mnt

root@cms0 # ls -alrt /mnt

total 22
drwxr-xr-x 33 root root 2048 Oct 3 16:07 ..
drwx------ 2 root root 8192 Oct 23 18:19 lost+found
drwxr-xr-x 3 root root 512 Oct 23 18:19 .

Step26: 檢查一下目前的 Disk partition for /opt and /mnt:
root@cms0 # df -k

Filesystem kbytes used avail capacity Mounted on
/dev/dsk/c1t0d0s6 20545897 1246351 19094088 7% /opt
/dev/dsk/c1t2d0s6 20545897 9 20340430 1% /mnt

Step27: 開始 Dump /opt 的資料到 c1t2d0s6 >>

root@cms0 # cd /opt

root@cms0 # ufsdump 0uf - . | (cd /mnt; ufsrestore xf -);date

( 敲入“y” 兩次來確認)

set owner/mode for '.'? [yn] y
Directories already exist, set modes anyway? [yn] y
root@cms0 # iostat -cnzx 10 (用來檢查目前的 I/O status,這裡的 10 是每 10 秒的意思啦)


Step28: 再檢查一次目前的 Disk partition for /opt and /mnt:

root@cms0 # df -k

Filesystem kbytes used avail capacity Mounted on
/dev/dsk/c1t0d0s6 20545897 1246351 19094088 7% /opt
/dev/dsk/c1t2d0s6 20545897 1246423 19094016 7% /mnt

Step29: Dump
完 /opt 的資料後把 c1t2d0s6 從 /mnt umount 掉吧:
root@cms0 # umount /mnt


Step30: Dump 完所有 mount point 的資料並 unmount 掉 /dev/dsk/c1t2d0 之後就可以把新 HDD 拔出 c1t2d0 囉。

以上這兩種方法可以看成是針對整顆 HDD 的資料來做備份或轉移的喔。
剩下的就留到下一篇再寫吧...以上,報告完畢。

(詳全文...)

如何備份 Linux 系統ㄌㄟ?

今天蔡爸跟 Jerome 分別問了同一個問題:我的 Linux server 要怎麼做 Full backup 啊?這裡就用同樣的環境來示範吧....在HP DL-380 G4 上,安裝 RHEL AS/ES 3 的版本來做範例,其中 RHES3 擔任 RPC server 的角色,RHAS3 則是今天的苦主,要被備份的機器啦...我在這台 DL-380 上是做 HW Raid mirror (/dev/cciss/c0d0 and /dev/cciss/c0d1)喔:

基本上這裡先列出主要幾種可以做方式:
首先,建議先備份一下做好的MBR,在 Linux 下使用下面的命令:
RHAS3# dd if=/dev/cciss/c0d0 of=/root/linux.bin bs=512 count=1

第一種方式:使用 cpio 來備份與還原:
RHAS3# find / -print cpio -covB > /dev/st0 (備份到磁帶機去) RHAS3# cpio -iduv < /dev/st0 (當然就是由磁帶機還原囉)

第二種方式:用 dd 來備份一顆完全一模一樣的硬碟:
RHAS3# dd if=/dev/cciss/c0d0 of=/dev/cciss/c0d2 (這裡假設新插進去要備份的 Target HDD 是 c0d2)

第三種方式是我最常用的:使用 tar 來備份與還原 (請參考最下面的詳細範例)
RHAS3# tar --exclude /proc --exclude /mnt --exclude /tmp -zcvpf RHAS3-bak.tgz /
(把根目錄以下排除 /proc /mnt/ tmp 以外的資料備份到 RHAS3-bak.tgz 去,這個動作會順便把 tar 完的資料作壓縮喔,如果你不要壓縮,那就把 -zcvpf 中的 z 這個 option 拿掉吧)
RHAS3# tar -zxvf host.tgz (當然就是由 RHAS3-bak.tgz 還原囉)

這裡我再細部介紹一下如果把檔案用 tar 備份到遠端的 Backup server 去要怎麼做:
首先在遠端的 Backup server 上把 NFS service 打開,並 share 出一個目錄,嗯,就叫 /Netbackup 好了,直接去 vi /exports 然後加入下面這一行:
RHES3# cat /etc/exports
/tmp/Netbackup 202.39.112.0/24(rw,sync) 202.39.120.0/24(rw,sync)
然後 Reload 一下 share 的目錄吧...
RHES3# exportfs -arv

接著我們到 Client server 端,也就是要備份的機器上啦,先建一個目錄就叫 /backup 好了,然後把 NFS server share 出來的 /Netbackup 給 mount 過來吧...
RHAS3# mount -t nfs RHES3:/Netbackup /backup

然後就是備份囉...
RHAS3# tar --exclude /proc --exclude /mnt --exclude /tmp --exclude /lost+found --exclude /backup -zcvpf /backup/RHAS3-20080424.tgz /
以我這台 RedHat EL AS3 全裝所有 package 大概 6G的容量,tar 一次大概要花 15 分鐘,tar 完的檔案,大概 1.8G 左右。

如果要從 Backup server restore 回來的話,一樣先把 /Netbackup mount 到 /backup 然後:
RHAS3# tar -zxf /backup/RHAS3-20080424.tgz

另外,如果你的 Linux OS 慘到連開機都開不了,那就用 CD 來 restore 吧:
1. Boot from RHEL E(A)S3(4) CD1, type:
>> boot : linux rescue selinux=0
2. sh-2.05b# df -f (先檢查一下目前的 partition 狀態吧)
3. sh-2.05b# cat /mnt/sysimage/etc/fstab (查看一下原來的 /etc/fstab,因為是在 rescue 模式,所以原有的 partition 都會被 mount 到 /mnt/sysimage/ 底下去了)
4. sh-2.05b# chroot /mnt/sysimage (要把現在的 / 目錄改變為從 /mnt/sysimage/ 目錄中開始, 可使用 chroot 命令,這時如果再用 df -h 或 df -k 應該就會看到跟原來一樣的 partition 狀態)
5. sh-2.05b# mkdir -p /backup (如果需要的話,就先建立一個待會兒要用的 mount point 吧)
6. sh-2.05b# mount -t nfs RHES3:/Netbackup /backup
7. sh-2.05b# tar -zxvf /backup/RHAS3-20080424.tgz (基本上以我的容量大概是15分鐘內就可以 restore 好了)
8. sh-2.05b# grub-install /dev/cciss/c0d0 (把 GRUB 的 stage1 bootloader 重新寫入 /dev/cciss/c0d0 的 MBR)
9. sh-2.05b# exit (離開 chroot)
10. sh-2.05b# exit (離開 rescue 模式,系統會被重起)
11. 然後你的掛點的 server 就又可以活跳跳的重新工作啦。

報告完畢,謝謝收看~
(詳全文...)

為何 Ethereal 抓到的封包都顯示 "TCP CHECKSUM INCORRECT"

今天收到一封 mail 說 site 的人寄來一個 Ethereal 檔,但裡面由 vbsu2 bge0 到 vscsmp1 bge0 的封包有一堆的 "TCP CHECKSUM INCORRECT",問說是不是我們網路或者機器出了什麼問題了...

我查了一下,這個問題有兩種可能,第一種當然是 機器的 checksum 真的出狀況,不過我檢查了一下兩台機器的網路設定都正常,"netstat -i" 看到的也沒有問題:
vbsu2# netstat -i
Name Mtu Net/Dest Address Ipkts Ierrs Opkts Oerrs Collis Queue
lo0 8232 loopback localhost 185648811 0 185648811 0 0 0
bge0 1500 vbsu2 vbsu2 3852441355 0 2300074072 0 0 0
bge1 1500 vbsu2 vbsu2 1308849274 0 654286221 0 0 0
bge2 1500 vbsu2_bge2 vbsu2_bge2 90997818 0 70916223 0 1 0
bge3 1500 vbsu2_bge3 vbsu2_bge3 66905686 0 68586413 0 1 0
vscsmp1# netstat -i
Name Mtu Net/Dest Address Ipkts Ierrs Opkts Oerrs Collis Queue
lo0 8232 loopback localhost 3009726492 0 3009726492 0 0 0
bge0 1500 vscsmp1 vscsmp1 2974853663 0 1088339819 0 0 0
bge3 1500 vscsmp1_qfe3 vscsmp1_qfe3 407128947 0 3519356 0 0 0
qfe0 1500 vscsmp1 vscsmp1 1227705888 0 831020139 0 0 0
qfe2 1500 172.16.0.128 172.16.0.129 3305973879 0 3289022674 0 0 0
bge2 1500 172.16.1.0 172.16.1.1 3279046154 7 3280696443 0 0 0
qfe1 1500 vscsmp1_qfe1 vscsmp1_qfe1 456708510 0 11583742 0 0 0
再來是檢查 Switch 上面這兩台機器所界接的 port 狀況:
VSW01# sh int Gi2/0/15
GigabitEthernet2/0/15 is up, line protocol is up (connected)
Hardware is Gigabit Ethernet, address is 0014.1c2e.a60f (bia 0014.1c2e.a60f)
MTU 1500 bytes, BW 100000 Kbit, DLY 100 usec,
reliability 255/255, txload 1/255, rxload 1/255
Encapsulation ARPA, loopback not set
Keepalive set (10 sec)
Full-duplex, 100Mb/s, media type is 10/100/1000BaseTX
input flow-control is off, output flow-control is unsupported
ARP type: ARPA, ARP Timeout 04:00:00
Last input never, output 00:00:29, output hang never
Last clearing of "show interface" counters never
Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0
Queueing strategy: fifo
Output queue: 0/40 (size/max)
5 minute input rate 435000 bits/sec, 66 packets/sec
5 minute output rate 442000 bits/sec, 120 packets/sec
2299440955 packets input, 3364519803 bytes, 0 no buffer
Received 130985710 broadcasts (0 multicast)
0 runts, 0 giants, 0 throttles
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored
0 watchdog, 0 multicast, 0 pause input
0 input packets with dribble condition detected
1888829558 packets output, 1756426108 bytes, 0 underruns
0 output errors, 0 collisions, 4 interface resets
0 babbles, 0 late collision, 0 deferred
0 lost carrier, 0 no carrier, 0 PAUSE output
0 output buffer failures, 0 output buffers swapped out
VSW01# sh int Gi2/0/1
GigabitEthernet2/0/1 is up, line protocol is up (connected)
Hardware is Gigabit Ethernet, address is 0014.1c2e.a601 (bia 0014.1c2e.a601)
MTU 1500 bytes, BW 100000 Kbit, DLY 100 usec,
reliability 255/255, txload 3/255, rxload 6/255
Encapsulation ARPA, loopback not set
Keepalive set (10 sec)
Full-duplex, 100Mb/s, media type is 10/100/1000BaseTX
input flow-control is off, output flow-control is unsupported
ARP type: ARPA, ARP Timeout 04:00:00
Last input never, output 00:00:19, output hang never
Last clearing of "show interface" counters never
Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0
Queueing strategy: fifo
Output queue: 0/40 (size/max)
5 minute input rate 2603000 bits/sec, 703 packets/sec
5 minute output rate 1218000 bits/sec, 626 packets/sec
1082693515 packets input, 2233319119 bytes, 0 no buffer
Received 554691 broadcasts (0 multicast)
0 runts, 0 giants, 0 throttles
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored
0 watchdog, 0 multicast, 0 pause input
0 input packets with dribble condition detected
1859379099 packets output, 1999426888 bytes, 0 underruns
0 output errors, 0 collisions, 4 interface resets
0 babbles, 0 late collision, 0 deferred
0 lost carrier, 0 no carrier, 0 PAUSE output
0 output buffer failures, 0 output buffers swapped out
VSW01#
從 Switch 上看來並沒有什麼問題,沒有任何的 packet error 出現。所以暫時排除機器本身 checksum error 的可能性。

那麼接下來有可能的就是這兩台 SunFire v240 所用的網卡上的 checksum offload 造成的了,順便再查了一下,我們機器上所用的 ce, bge 網卡都有 support TCP checksum offload,而且 default 居然還是 enable 的。

所以這裡有兩種方式可以不再看到這個 "TCP CHECKSUM INCORRECT" 出現,第一種就是直接到機器上把 /etc/system 加上下面這一行:
set ip:dohwcksum = 0
然後重起機器就可以了。

第二種方式比較鴕鳥一點,就是直接到 Ethereal 裡面去把 Checksum 的檢查選項關掉:
打開 Ethereal,
點選 Edit
> Preference
然後點開 Protocol
選擇 IP,然後把右邊視窗的 "Validate the IP checksum if possible" 選項關掉。
然後就天下太平了。
參考網站:The Ethereal Wiki page

這邊直接把 TCP checksum offloading 的用意直接貼上,大家參考看看:

Many Gigabit network adapters have the "Checksum offload" feature enabled by default. When this is enabled, the adapter performs the time-consuming process of calculating the checksum which appears in both the IP header and in the TCP header of a packet.

For some network drivers, if the checksum calculations are offloaded then the checksum value(s) are set to zero. Ethereal captures each outgoing packet before it goes to the adapter, thus the checksum for the packet was not calculated.
(詳全文...)

[Firefox Add-ons] 清除網頁內容裡隱藏的討厭文字

相信大家常常會遇到網路上的論壇為了防止隨意轉貼文章而在內容裡加入一些隱藏文字,這些隱藏的文字就是把文字顏色設定成跟背景色一樣。這樣在複製文章內容的時候也會連隱藏文字一起複製。這些隱藏文字會讓整篇文章變的很難閱讀。當然有人會說可以自己一點一點慢慢地刪除隱藏文字,但相信大家都不會選擇這種土法煉鋼的方法吧。

這裡介紹一個我最常使用的附加元件 -- CleanHide ,這就是一個可以將文章裡的隱藏文字刪除的擴充元件。安裝完 CleanHide 之後會在工具選單多一個「消除隱藏文字」的項目,只要點選它就會自動刪除文章裡的隱藏文字了。

CleanHide :

附加元件版本:1.0.6
官方網站:http://waxb.blog.com.cn/archives/2006/1786426.shtml
下載點:https://addons.mozilla.org/en-US/firefox/addon/3648
(詳全文...)

[LINUX] 如何像 Windows 上的 "route add -p" command 來建立 persistent static routes?

今天同事問了我個問題,在 LINUX 上要如何像 Windows 上的 "route add -p" command 來建立 persistent static routes?這個部分簡單說有兩種方式可以達成:

首先,今天的測試 Server 一樣為 HP DL-380 G4 上,安裝 RHEL ES/AS 3 的版本來做示範,目前的環境為:

RHAS3 # ifconfig -a
eth0 Link encap:Ethernet HWaddr 00:0E:7F:F2:2B:B1
inet addr:202.39.120.51 Bcast:202.39.120.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:6707518 errors:0 dropped:0 overruns:0 frame:0
TX packets:172226 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:844853502 (805.7 Mb) TX bytes:12185954 (11.6 Mb)
Interrupt:25

eth1 Link encap:Ethernet HWaddr 00:0E:7F:F2:2B:B0
inet addr:172.17.65.3 Bcast:172.17.65.255 Mask:255.255.255.0
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
Interrupt:26

eth1:0 Link encap:Ethernet HWaddr 00:0E:7F:F2:2B:B0
inet addr:192.168.10.1 Bcast:192.168.10.255 Mask:255.255.255.0
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
Interrupt:26

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:772080 errors:0 dropped:0 overruns:0 frame:0
TX packets:772080 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:60976074 (58.1 Mb) TX bytes:60976074 (58.1 Mb)
RHAS3 # netstat -nr
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
202.39.120.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
192.168.10.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
172.17.65.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth1
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
0.0.0.0 202.39.120.1 0.0.0.0 UG 0 0 0 eth0

第一種方式:用 route add -net 把要加的 routing 加在 /etc/rc.d/rc.local 裡面,Server 開機帶起所有的網卡之後,便會去把 /etc/rc.d/rc.local 所列的 routing 都加進去...
舉例來說,我想加上一個 172.17.64.0 的網段 route 經 eth1 出去,我可以在 /etc/rc.d/rc.local 加入下面這一行:
route add -net 172.17.64.0 netmask 255.255.255.0 gw 172.17.64.1 eth1
這樣 Server 開起來之後就 ok 了。
不過這種方式有個缺點,那就是網路如果 Restart 過的話,所有開機加進去的 Static routes 都會不見了,因此在這裡建議用下面的方式:

第二種方式:建立 /etc/sysconfig/network-scripts/route-ethx (這個 x 代表你想加 Static route 的 device,在這裡我用 eth1 來做示範...)
在 /etc/sysconfig/network-scripts/route-eth1 裡面加入下面這一行:
172.17.64.0/24 via 172.17.65.1 dev eth1
就是去指定一個 172.17.64.0 C-Class 的 Subnet 經由 eth1 網卡, Gateway 為 172.17.65.1 。
然後用 "service network restart" 把網路重起後,再用 netstat -nr 應該就會看到如下面的 Routing table:

RHAS3 # service network restart
Shutting down interface eth0: [ OK ]
Shutting down interface eth1: [ OK ]
Shutting down loopback interface: [ OK ]
Setting network parameters: [ OK ]
Bringing up loopback interface: [ OK ]
Bringing up interface eth0: [ OK ]
Bringing up interface eth1: [ OK ]
RHAS3 # netstat -nr
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
202.39.120.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
172.17.64.0 172.17.65.1 255.255.255.0 UG 0 0 0 eth1
192.168.10.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
172.17.65.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth1
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
0.0.0.0 202.39.120.1 0.0.0.0 UG 0 0 0 eth0

Reference URL :
How do I create persistent static routes in Red Hat Enterprise Linux 4?

好了,報告完畢。
(詳全文...)

用 KeePass Password Safe 來管理眾多且難記的密碼吧

最近為了密碼發生了件糗事,以前總是嫌麻煩,就簡單的用個文字檔記錄,再用個加密軟件 (WinCrypto v2.0) 去加密一下,誰知,就在急著要做網路轉帳時,將我的密碼檔解密時,才發現檔案壞了...OH...My GOD....真是有夠OOXX的...

只好去找了一下,發現 KeePass Password Safe 這一套密碼管理軟體來真的蠻好用的,介面簡單好用又漂亮,可自建一堆路徑,及自選圖案來分類,另外除一般安裝版本,還有綠色版本可供下載喔... (沒辦法,我現在手頭上大概過半數的軟體都改用綠色版的了,目前我用的是 KeePass v1.11 綠色版)

當我們第一次使用 KeePass,建立資料庫的時候,就必需輸入進入資料庫所需要的密碼,除了這個「第一層」的密碼之外,KeePass 還有一個特殊的雙重保護功能,那就是「鑰匙檔案」。當建立了這個鑰匙檔案,以後要打開資料庫除了得輸入密碼之外,還得要有鑰匙檔案才行,如果我們把鑰匙檔案帶走或放置在另外的地方,那麼別人就算知道資料庫密碼也沒辦法進入。

除了一般的密碼管理之外,KeePass 也提供了「執行自動輸入」以及「密碼產生器」的功能。這麼優質的密碼管理軟體完全是免費的,而且還有繁體中文的介面。

你可以到原創公司: Dominik Reichl 的下載頁面去下載 (頁面最下面有語系下載),當然你也可以到 KeePass Password Safe 下載網頁:http://keepass.info/download.html 去下載。 (語系下載網頁:http://keepass.info/translations.html )
(詳全文...)

Google 網站管理員工具--Sitemap

今天抽出時間把上次沒弄完的 Sitemap 繼續下去,這一篇就從驗證通過後要上傳 Sitemap 開始吧...
首先一樣到 Google 網站管理員工具 的 Sitemaps 底下點選 新增 Sitemap
在這個頁面中選 新增一般網頁 Sitemap,然後在下面的 Sitemaps URL的部分,直接填入這樣:http://yourblogname.blogspot.com/rss.xml
然後按下
新增一般網頁 Sitemap 的按鈕,就會看到像下面這樣的成功訊息。


通常要過一段時間之後 Googlebot 才會再來存取一次,我是了一下,大概是2個小時之後,就有來 Update 新的資料了,果然比起沒有上傳 Sitemap 差很多啊。
最後應該會看到像下面這樣的情況:

控制主頁應該要看到像下面這樣有驗證,有 Sitemap就 ok 囉:

網站 1 個中的第 11

管理 Sitemap 已驗證?
tosian.blogspot.com 1 已驗證

這樣就可以提高部落格(Blog)在 Google 搜尋引擎的曝光率囉,好了,報告完畢,收工。
(詳全文...)

[IBM] ClearQuest new defect create error

今天把裝好的 Rational Clear Quest 建好新的 User 跟 Group 之後,順便把查理已經開好的 DEMODB version2 的 flow 也修改一下,將目前的變更 Save work 之後,當然是 Test Work 囉...沒想到在進到 TestDB 要開新的 Defect 來測試時,出現了下面的錯誤訊息:

Failed condition: m_pPerl!=0
Lcation: CleaseQuest Core:adperlhooks.cpp:237

當場傻眼,這可是個很乾淨的 DB,什麼都沒有ㄋㄟ...
只好去跟 Google 大神求救一下,發現在 IBM 網站上果然有這個問題的解法:
http://www-1.ibm.com/support/docview.wss?uid=swg21246579

依據 IBM 網站所說的去檢查 控制台>系統>進階>環境變數> PERL5LIB 這個環境變數的路徑果然被改掉了,本來應該是 C:\Program Files\Rational\Common\lib\perl5\5.8.6; 現在卻變成了C:\oracle\10.2.0\perl\5.8.3\lib\MSWin32-x86;C:\oracle\10.2.0\perl\5.8.3\lib;C:\oracle\10.2.0\perl\5.8.3\lib\MSWin32-x86;C:\oracle\10.2.0\perl\site\5.8.3;C:\oracle\10.2.0\perl\site\5.8.3\lib;C:\oracle\10.2.0\sysman\admin\scripts; 這是因為在 ClearQuest 之後才裝 Oracle 10, 環境變數被 Oracle 改掉了...


只好乖乖的把 PERL5LIB 給多加上 C:\Program Files\Rational\Common\lib\perl5\5.8.6; 這一段,然後給他重開機,再重新測試,New Defect 果然就跑出來了。
(詳全文...)