solaris 10 disksuite usage

jolly10發表於2008-11-21

根據官方文件做了一下disksuite,記錄一下!

參考文件:

[@more@]

1、在VMware的Summary View介面選擇Edit virtual machine settings,add一個新hard disk,選擇IDE方式,確定新增後在Devices中會看到多出一塊Hard Disk 2(IDE 0:1)。


進入系統後,執行devfsadm命令,系統檢測新增加的裝置,這種方法不需要reboot,很好.

2.由於metadb不能安裝在已使用過的分割槽上,所以就要在第一塊磁碟上化出部分空間做為放metadb的分割槽,一般是從swap分割槽中分出部分空間來.步驟大致如下:
2.1. 修改/etc/vfstab檔案啟動時不mountswap分割槽
2.2. 啟動到單使用者模式(init 1)
2.3. swap -l檢視現在已mount的swap分割槽,用命令swap -d /dev/dsk/c0d0s1來關閉swap分割槽
2.4. 用format命令來重新化分swap分割槽,我是將1.1G的swap改為900M,其作的空間建立另一個分割槽c0d0s3
2.5. 改回/etc/vfstab後重新啟動
2.6.可用prtvtoc /dev/dsk/c0d0s3來驗證一下新的分割槽

3.對第二塊磁碟進行分割槽,大小同disk1

4.製作metadb
# metadb -a -f -c 3 c0d0s3 c0d1s3

# metadb
flags first blk block count
a u 16 8192 /dev/dsk/c0d0s3
a u 8208 8192 /dev/dsk/c0d0s3
a u 16400 8192 /dev/dsk/c0d0s3
a u 16 8192 /dev/dsk/c0d1s3
a u 8208 8192 /dev/dsk/c0d1s3
a u 16400 8192 /dev/dsk/c0d1s3


5.做/export/home的映象
# umount /export/home

# metainit -f d1 1 1 c0d0s7
d1: Concat/Stripe is setup

# metainit d2 1 1 c0d1s7
d2: Concat/Stripe is setup

# metainit d0 -m d1
d0: Mirror is setup

# metattach d0 d2
d0: submirror d2 is attached

可以檢視同步的狀態
# metastat | grep %
Resync in progress: 27 % done
# metastat | grep %
Resync in progress: 32 % done

將m0 mount起來
# mount /dev/md/dsk/d0 /export/home
# df -k
Filesystem kbytes used avail capacity Mounted on
/dev/dsk/c0d0s0 4413669 3339951 1029582 77% /
/devices 0 0 0 0% /devices
ctfs 0 0 0 0% /system/contract
proc 0 0 0 0% /proc
mnttab 0 0 0 0% /etc/mnttab
swap 903076 880 902196 1% /etc/svc/volatile
objfs 0 0 0 0% /system/object
/usr/lib/libc/libc_hwcap1.so.1
4413669 3339951 1029582 77% /lib/libc.so.1
fd 0 0 0 0% /dev/fd
swap 902244 48 902196 1% /tmp
swap 902224 28 902196 1% /var/run
/dev/md/dsk/d0 5324014 4908011 362763 94% /export/home

6.做swap的映象,由於此分割槽不能umount,所以跟上面有點不同.

# metainit -f d31 1 1 c0d0s1
d31: Concat/Stripe is setup

# metainit d32 1 1 c0d1s1
d32: Concat/Stripe is setup

# metainit d3 -m d31
d3: Mirror is setup

# metattach d3 d32
d3: submirror d32 is attached

修改/etc/vfstab後重啟
# cat /etc/vfstab
#device device mount FS fsck mount mount
#to mount to fsck point type pass at boot options
#
fd - /dev/fd fd - no -
/proc - /proc proc - no -
/dev/md/dsk/d3 - - swap - no -
/dev/dsk/c0d0s0 /dev/rdsk/c0d0s0 / ufs 1 no -
/dev/md/dsk/d0 /dev/md/rdsk/d0 /export/home ufs 2 yes -
/devices - /devices devfs - no -
ctfs - /system/contract ctfs - no -
objfs - /system/object objfs - no -
swap - /tmp tmpfs - yes -


7.做/的映象
準備這個分割槽時的id tag必須是"root"
Its I.D. tag must be "root"


# metainit -f d41 1 1 c0d0s0
d41: Concat/Stripe is setup

# metainit d42 1 1 c0d1s0
d42: Concat/Stripe is setup

# metainit d4 -m d41
d4: Mirror is setup

# metaroot d4

--the metaroot command edits the /etc/vfstab and /etc/system files so that the system may be booted with the root file system (/) on a metadevice

# lockfs -fa

# reboot

# metattach d4 d42
d4: submirror d42 is attached

# ls -l /dev/dsk/c0d0s0
lrwxrwxrwx 1 root root 50 Jun 12 15:13 /dev/dsk/c0d0s0 -> ../../devices/pci@0,0/pci-ide@7,1/ide@0/cmdk@0,0:a
# ls -l /dev/dsk/c0d1s0
lrwxrwxrwx 1 root root 50 Nov 20 16:37 /dev/dsk/c0d1s0 -> ../../devices/pci@0,0/pci-ide@7,1/ide@0/cmdk@1,0:a

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/271283/viewspace-1013666/,如需轉載,請註明出處,否則將追究法律責任。

相關文章