vxvm rootdisk 封装和解除封装

环境:ultra1 2块硬盘
已经配置rootdg内包含一个slice c0t0d0s5
系统盘上的slice 5 6 7 各有100m空间 其余空间都给了/ 和swap
试验内容为将根盘封装,然后景象 。试验景象盘能够引导系统,最后解除景象和封装 。
Rootdisk encapsulate
1.add new disk slice at rootdg
root@sunlab # vxdctl add disk c0t1d0s5 type=simple
vxvm:vxdctl: WARNING: Device c0t1d0s5: Not currently in the configuration
root@sunlab # vxdisk -f init c0t1d0s5 type=simple
root@sunlab # vxdg adddisk c0t1d0s5
root@sunlab # vxdctl enable
vxdisk list

DEVICE TYPE DISK GROUP STATUS
c0t0d0s2 sliced - - error
c0t0d0s5 simple c0t0d0s5 rootdg online
c0t1d0s2 sliced - - error
c0t1d0s5 simple c0t1d0s5 rootdg online
2.remove rootdisk slice at rootdg
root@sunlab # vxdctl rm disk c0t0d0s5
root@sunlab # vxdg -g rootdg rmdisk c0t0d0s5
root@sunlab # vxdisk rm c0t0d0s5
root@sunlab # vxdisk list
DEVICE TYPE DISK GROUP STATUS
c0t0d0s2 sliced - - error
c0t1d0s2 sliced - - error
c0t1d0s5 simple c0t1d0s5 rootdg online
root@sunlab # vxdiskadm
Menu: VolumeManager/Disk
1 Add or initialize one or more disks
2 Encapsulate one or more disks
3 Remove a disk
4 Remove a disk for replacement
5 Replace a failed or removed disk
6 Mirror volumes on a disk
7 Move volumes from a disk
8 Enable access to (import) a disk group
9 Remove access to (deport) a disk group
10 Enable (online) a disk device
11 Disable (offline) a disk device
12 Mark a disk as a spare for a disk group
13 Turn off the spare flag on a disk
14 Unrelocate subdisks back to a disk
15 Exclude a disk from hot-relocation use
16 Make a disk available for hot-relocation use
17 Prevent multipathing/Suppress devices from VxVM"s vIEw
18 Allow multipathing/Unsuppress devices from VxVM"s view
19 List currently suppressed/non-multipathed devices
20 Change the disk naming scheme
Hit RETURN to continue.
21 Get the newly connected/zoned disks in VxVM view
list List disk information
? Display help about menu

?? Display help about the menuing system

q Exit from menus
Select an operation to perform: 2
Encapsulate one or more disks

root@sunlab # vxdisk list
DEVICE TYPE DISK GROUP STATUS
c0t0d0s2 sliced rootdisk rootdg online
c0t1d0s2 sliced - - error
c0t1d0s5 simple c0t1d0s5 rootdg online
3.remove disk slice from rootdg
root@sunlab # vxdctl rm disk c0t1d0s5
root@sunlab # vxdg -g rootdg rmdisk c0t1d0s5
root@sunlab # vxdisk rm c0t1d0s5
root@sunlab # vxdisk list
DEVICE TYPE DISK GROUP STATUS
c0t0d0s2 sliced rootdisk rootdg online
c0t1d0s2 sliced - - error
4.mirror rootdisk
root@sunlab #vxdisksetup –i c0t1d0s2
root@sunlab #vxdg –g rootdg adddisk c0t1d0
root@sunlab # vxdiskadm --select option 6
root@sunlab #vxtask list --wait for the process finish
root@sunlab # vxdisk list
DEVICE TYPE DISK GROUP STATUS
c0t0d0s2 sliced rootdisk rootdg online
c0t1d0s2 sliced c0t1d0 rootdg online
root@sunlab # more /etc/vfstab
#device device mount FS fsck mount mount
#to mount to fsck point type pass at boot options
#
#/dev/dsk/c1d0s2 /dev/rdsk/c1d0s2 /usr ufs 1 yes -
fd - /dev/fd fd - no -
/proc - /proc proc - no -
/dev/vx/dsk/swapvol - - swap - no -
/dev/vx/dsk/rootvol /dev/vx/rdsk/rootvol / ufs 1 no -
swap - /tmp tmpfs - yes -
#NOTE: volume rootvol (/) encapsulated partition c0t0d0s0
#NOTE: volume swapvol (swap) encapsulated partition c0t0d0s1
root@sunlab # eeprom -- use-nvramrc devalias

use-nvramrc?=true
nvramrc=devalias vx-c0t1d0 /sbus@1f,0/espdma@e,8400000/esp@e,8800000/sd@1,0:a
devalias vx-rootdisk /sbus@1f,0/espdma@e,8400000/esp@e,8800000/sd@0,0:a

root@sunlab # prtconf -pv |grep boot --verify the boot disk
boot-retained-page:
bootargs: 00
bootpath: "/sbus@1f,0/espdma@e,8400000/esp@e,8800000/sd@0,0:a"
boot-command: "boot"

推荐阅读