How to Replace a Disk in the ZFS Root Pool ?

Today we will see how to Replace a disk in the ZFS Root Pool.

Lets have a look at them commands step by step.

 

1. Take the disk in pool offline which we want to replace.

# zpool offline rpool c1t0d0s0

 

2. Now unconfigure the disk from system.

# cfgadm -c unconfigure c1:sk/c1t0d0

3. Now ask the onsite hardware engineer to replace the drive on the server.

 

4. Configure/Scan the new disk on the server.

# cfgadm -c configure c1:sk/c1t0d0

 

5. Now replace the disk in pool.

# zpool replace rpool c1t0d0s0

 

6. Solved: Error: I/O Error

# zpool replace rpool c1t0d0s0
cannot open '/dev/dsk/c1t0d0s0': I/O error

[here comes problem: cannot open '/dev/dsk/c1t0d0s0': I/O error
you need to label disk – instructions below]

 

7. Solved: Error: device too small

ngeaix001--> zpool replace rpool c1t0d0s0
cannot replace c1t0d0s0 with c1t0d0s0: device is too small [and another problem –copy slices:

ngeaix001--> prtvtoc /dev/dsk/c1t1d0s2 | fmthard -s - /dev/rdsk/c1t0d0s2
fmthard: New volume table of contents now in place. ]
# zpool online rpool c1t0d0s0
# zpool status rpool

SPARC# installboot -F zfs /usr/platform/`uname -i`/lib/fs/zfs/bootblk /dev/rdsk/c1t0d0s0
x86# installgrub /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c1t9d0s0

 

8. Steps to label the disk

ngeaix001--> format
Searching for disks...done

c1t0d0: configured with capacity of 136.71GB

AVAILABLE DISK SELECTIONS:
0. c1t0d0
/pci@0/pci@0/pci@2/scsi@0/sd@0,0
1. c1t1d0
/pci@0/pci@0/pci@2/scsi@0/sd@1,0
2. c4t60002AC0000000000000002D0000C71Fd0 <3PARdata-VV-3212 cyl 21555 alt 2 hd 8 sec 304>
/scsi_vhci/ssd@g60002ac0000000000000002d0000c71f
3. c4t60002AC0000000000000002E0000C71Fd0 <3PARdata-VV-3212 cyl 65533 alt 2 hd 8 sec 500>
/scsi_vhci/ssd@g60002ac0000000000000002e0000c71f
4. c4t60002AC0000000000000002F0000C71Fd0 <3PARdata-VV-3212 cyl 65533 alt 2 hd 8 sec 1084>
/scsi_vhci/ssd@g60002ac0000000000000002f0000c71f
5. c4t60002AC000000000000000300000C71Fd0 <3PARdata-VV-3212 cyl 25867 alt 2 hd 8 sec 304>
/scsi_vhci/ssd@g60002ac000000000000000300000c71f
Specify disk (enter its number): 0
selecting c1t0d0
[disk formatted]
Disk not labeled. Label it now? y

FORMAT MENU:
disk - select a disk
type - select (define) a disk type
partition - select (define) a partition table
current - describe the current disk
format - format and analyze the disk
repair - repair a defective sector
label - write label to the disk
analyze - surface analysis
defect - defect list management
backup - search for backup labels
verify - read and display labels
save - save new disk/partition definitions
inquiry - show vendor, product and revision
volname - set 8-character volume name
! - execute , then return
quit
format> q

Leave a Reply

Your email address will not be published.