You are on page 1of 3

Replacing/Relabeling the Root Pool Disk

Unfortunately one of disk associated to rootpool went crazy and fun started for a day there!!! Let's fix it. BTW now a days I am testing a small part of rpool recovery after system crash... This experience is from rpool recovery and testing project. One can see belwo shown error if something wrong with the root pool disk # zpool status -x pool: rpool state: DEGRADED status: One or more devices could not be opened. Sufficient replicas exist for the pool to continue functioning in a degraded state. action: Attach the missing device and online it using 'zpool online'. see: http://www.sun.com/msg/ZFS-8000-2Q scrub: none requested config: NAME STATE READ WRITE CKSUM rpool DEGRADED 0 0 0 mirror DEGRADED 0 0 0 c0t0d0s0 UNAVAIL 0 0 0 cannot open c0t2d0s0 ONLINE 0 0 0 errors: No known data errors Have bad disk replaced with good one or brand new disk. # zpool offline rpool c0t0d0s0 # cfgadm -c unconfigure c1::dsk/c0t0d0 Physically replace the primary disk. In my case it is c0t0d0s0. Now I am labeling/relabeling the disk. Label rpool disk always with SMI label format and not EFI. # format -e Searching for disks...done

AVAILABLE DISK SELECTIONS: 0. c0t0d0 /pci@1f,0/ide@d/dad@0,0 1. c0t2d0 /pci@1f,0/ide@d/dad@2,0 Specify disk (enter its number): 0 selecting c0t0d0 [disk formatted, no defect list found]

FORMAT MENU:

if required.defect list management backup .select (define) a disk type partition . then return quit format> l [0] SMI Label [1] EFI Label Specify Label type[0]: 0 Ready to label disk. # cfgadm -c configure c1::dsk/c0t0d0 # zpool online rpool c0t0d0 Before de-attach you can replace it however I dont see much need of this step in my case it failed so I am directly De-attach the bad disk from the pool # zpool detach rpool c0t0d0s0 See the status # zpool status -v pool: rpool state: ONLINE scrub: none requested config: NAME STATE READ WRITE CKSUM rpool ONLINE 0 0 0 c0t2d0s0 ONLINE 0 0 0 errors: No known data errors Now we have newly added disk to the system and we need to add/attach this to the pool. continue? yes format> Reconfigure the disk and bring it online.read and display labels save . .set 8-character volume name ! .select (define) a partition table current . # zpool attach rpool c0t2d0s0 c0t0d0s0 Please be sure to invoke installboot(1M) to make 'c0t0d0s0' bootable.format and analyze the disk repair .write label to the disk analyze .execute .translate a disk address label .surface analysis defect .repair a defective sector show .describe the current disk format .save new disk/partition definitions volname .disk .search for backup labels verify .select a disk type .

install the boot blocks. scrub: resilver in progress for 0h2m.solarisinternals. action: Wait for the resilver to complete.Check the resilvering status of the newly attached disk.39% done.com/ Posted by Nilesh Joshi at 10/28/2009 06:09:00 PM . 25. REF: http://www. # installboot -F zfs /usr/platform/`uname -i`/lib/fs/zfs/bootblk /dev/rdsk/c0t0d0s0 Confirm that you can boot from the replacement disk.62G resilvered errors: No known data errors After the disk resilvering is complete. The pool will continue to function. 0h6m to go config: NAME STATE READ WRITE CKSUM rpool ONLINE 0 0 0 mirror ONLINE 0 0 0 c0t2d0s0 ONLINE 0 0 0 c0t0d0s0 ONLINE 0 0 0 1. # zpool status rpool pool: rpool state: ONLINE status: One or more devices is currently being resilvered. possibly in a degraded state.