The vxdiskadm option #5 "Replace a failed or removed disk" to replace a failed encapsulated rootdisk fails, complaining that the public region is too small to replace the disk.
故障原因:
vxvm对系统盘做的mirror,一块硬盘故障,按照vxdiskadm 步骤操作更换硬盘后报错:
参考
Problem
The vxdiskadm option #5 "Replace a failed or removed disk" to replace a failed encapsulated rootdisk fails, complaining that the public region is too small to replace the disk.
Error Message
"vxvm:vxdg: ERROR: associating disk-media rootdisk with c0t0d0s2: Disk public region is too small"
Solution
Sometimes the above vxdiskadm command will fail. If it does, try to ensure that the disk is replaced with a disk with the same geometry. Use the output from the format command to verify if this is the case:
AVAILABLE DISK SELECTIONS:
0. c0t0d0
/sbus@3,0/SUNW,fas@3,8800000/sd@0,0
1. c2t1d0
/sbus@3,0/SUNW,fas@0,8800000/sd@1,0
If needed, the "public" and "private" lines from an output from vxdisk list c#t#d# of each device can be compared to confirm that the size is the same, although the disk will have to be initialized before this will work. (vxdisk list c#t#d# shows the same private/public configuration). Now that the disks have been established to be the same, an attempt can be made to manually mirror the volumes rather than use vxdiskadm:
pl swapvol-02 swapvol ENABLED ACTIVE 2097144 CONCAT - RW
sd disk01-03 swapvol-02 disk01 15581349 2097144 0 c2t1d0 ENA
The following is an example output of "vxdisk list" command:
DEVICE TYPE DISK GROUP STATUS
c0t0d0s2 sliced - - online
c2t1d0s2 sliced disk01 rootdg online
- - rootdisk rootdg removed was:c0t0d0s2
Run the following commands to completely remove the existence of the rootdisk in order to tidy up the configuration. This will involve disassociating plexes and removing the plexes with their associated subdisks:
Disassociate the plexes. This must be done with all plexes with a "STATE" of "DISABLED REMOVED". They must be doneONE AT A TIME. A plex can be located by looking for a "pl" in the far left column of information in the "vxprint -ht" output.
分离plex:
vxplex dis rootdisk4vol-01
vxplex dis rootvol-01
vxplex dis swapvol-01
After running the above commands, the vxprint will look like this:
vxprint -htg rootdg
DG NAME NCONFIG NLOG MINORS GROUP-ID
DM NAME DEVICE TYPE PRIVLEN PUBLEN STATE
V NAME USETYPE KSTATE STATE LENGTH READPOL PREFPLEX
PL NAME VOLUME KSTATE STATE LENGTH LAYOUT NCOL/WID MODE
SD NAME PLEX DISK DISKOFFS LENGTH [COL/]OFF DEVICE MODE
SV NAME PLEX VOLNAME NVOLLAYR LENGTH [COL/]OFF AM/NM MODE
pl rootdisk4vol-02 rootdisk4vol ENABLED ACTIVE 7182 CONCAT - RW
sd disk01-01 rootdisk4vol-02 disk01 0 7182 0 c2t1d0 ENA
v rootvol root ENABLED ACTIVE 15574167 ROUND -
pl rootvol-02 rootvol ENABLED ACTIVE 15574167 CONCAT - RW
sd disk01-02 rootvol-02 disk01 7182 15574167 0 c2t1d0 ENA
v swapvol swap ENABLED ACTIVE 2097144 ROUND -
pl swapvol-02 swapvol ENABLED ACTIVE 2097144 CONCAT - RW
sd disk01-03 swapvol-02 disk01 15581349 2097144 0 c2t1d0 ENA
更换磁盘,重做mirror:
Once the vxprint shows that everything associated with the rootdisk has been removed, use vxdiskadm option 1 to initialize the new disk into rootdg (if not already done). DO NOT accept the default name. Instead, name it "rootdisk" (using the same diskname as previously). After the disk has been initialized, use vxdiskadm option 6 to mirror the volumes on a disk. This should automatically start the recovery process.