首先,比較簡單的方式就是用 dd 命令來直接備份整顆 c1t0d0 的資料(含 OS )到 c1t2d0:
Step1: 先檢查一下目前的 Disk format 狀態吧:
root@cms0 # format
Step2: 把新的
root@cms0 # devfsadm
root@cms0 # format
>>> 新的 HDD 應該會出現在 AVAILABLE DISK SELECTIONS:
2. c1t2d0
/pci@
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: 把新的
root@cms0 # devfsadm
root@cms0 # format
>>> 新的 HDD 應該會出現在 AVAILABLE DISK SELECTIONS:
2. c1t2d0
/pci@
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.
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
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 秒的意思啦)
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
root@cms0 # installboot /usr/platform/`uname -i`/lib/fs/ufs/bootblk /dev/rdsk/c1t1d0s0
root@cms0 # umount /mnt
root@cms0 # newfs /dev/rdsk/c1t2d0s4
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 .
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
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 秒的意思啦)
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
root@cms0 # umount /mnt
root@cms0 # newfs /dev/rdsk/c1t2d0s5
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 .
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
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 秒的意思啦)
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
root@cms0 # umount /mnt
root@cms0 # newfs /dev/rdsk/c1t2d0s6
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 .
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
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 秒的意思啦)
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
root@cms0 # umount /mnt
剩下的就留到下一篇再寫吧...以上,報告完畢。
張貼留言