You might need to replace a disk in the root pool for the following reasons:
The root pool is too small and you want to replace it with a larger disk
The root pool disk is failing. In a non-redundant pool, if the disk is failing so that the system won't boot, you'll need to boot from an alternate media, such as a CD or the network, before you replace the root pool disk.
If you use the zpool replace command to replace a disk in a root pool disk, you will need to apply the boot blocks manually.
In a mirrored root pool configuration, you might be able to attempt a disk replacement without having to boot from alternate media. You can replace a failed disk by using the zpool replace command or if you have an additional disk, you can use the zpool attach command. See the steps below for an example of attaching an additional disk and detaching a root pool disk.
Systems with SATA disks require that you offline and unconfigure a disk before attempting the zpool replace operation to replace a failed disk. For example:
# zpool offline rpool c1t0d0s0 # cfgadm -c unconfigure c1::dsk/c1t0d0 <Physically remove failed disk c1t0d0> <Physically insert replacement disk c1t0d0> # cfgadm -c configure c1::dsk/c1t0d0 <Confirm that the new disk has an SMI label and a slice 0> # zpool replace rpool c1t0d0s0 # zpool online rpool c1t0d0s0 # zpool status rpool <Let disk resilver before installing the boot blocks> # bootadm install-bootloader
On some hardware, you do not have to online or reconfigure the replacement disk after it is inserted.
SPARC: Confirm that the replacement (new) disk has an SMI (VTOC) label and a slice 0. For information about relabeling a disk that is intended for the root pool, see How to Label a Disk in Managing Devices in Oracle Solaris 11.2 .
x86: Confirm that the disk has an fdisk partition, an SMI disk label, and a slice 0. If you need to repartition the disk and create a slice 0, see the sections on labels and partitions in Configuring Disks in Managing Devices in Oracle Solaris 11.2 .
# zpool attach rpool c2t0d0s0 c2t1d0s0 Make sure to wait until resilver is done before rebooting.
The correct disk labeling and the boot blocks are applied automatically.
# zpool status rpool pool: rpool state: ONLINE scan: resilvered 11.7G in 0h5m with 0 errors on Fri Jul 20 13:45:37 2012 config: NAME STATE READ WRITE CKSUM rpool ONLINE 0 0 0 mirror-0 ONLINE 0 0 0 c2t0d0s0 ONLINE 0 0 0 c2t1d0s0 ONLINE 0 0 0 errors: No known data errors
For example, on a SPARC based system:
ok boot /pci@1f,700000/scsi@2/disk@1,0
Identify the boot device pathnames of the current and new disk so that you can test booting from the replacement disk and also manually boot from the existing disk, if necessary, if the replacement disk fails. In the example below, the current root pool disk (c2t0d0s0) is:
In the example below, the replacement boot disk is (c2t1d0s0):
# zpool detach rpool c2t0d0s0
Determine the existing rpool pool size:
# zpool list rpool NAME SIZE ALLOC FREE CAP DEDUP HEALTH ALTROOT rpool 29.8G 152K 29.7G 0% 1.00x ONLINE -
# zpool set autoexpand=on rpool
Review the expanded rpool pool size:
# zpool list rpool NAME SIZE ALLOC FREE CAP DEDUP HEALTH ALTROOT rpool 279G 146K 279G 0% 1.00x ONLINE -
SPARC: Set up the system to boot automatically from the new disk, either by using the eeprom command or the setenv command from the boot PROM.
x86: Reconfigure the system BIOS.