• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

Solaris ZFS : How to replace a failed disk in rpool (x86)

by admin

The post describes steps to replace a failed disk in rpool for x86 based systems. Assuming c0t0d0 and c0t1d0 are mirrored in the ZFS rpool, and c0t1d0 need to be replaced.

1. As shown in the output below, c0t1d0 need to be replaced as it is having a lot of errors.

# iostat -En
...
c0t1d0           Soft Errors: 0 Hard Errors: 35 Transport Errors: 137630
Vendor: SEAGATE  Product: ST914602SSUN146G Revision: 0400 Serial No: 071791R032
Size: 146.81GB <146810535936 bytes>
...

The spool status command will also show the disk as faulted with “too many errors” status.

# zpool status -v
...
  c0t1d0s0  FAULTED      3 6.71K     0  too many errors
...

2. Before we replace the failed disk, we have to remove it from the rpool. Use the “zfs detach” command to remove the disk from ZFS control.

# zpool detach rpool c0t1d0s0

3. Perform physical replacement as follows:

# cfgadm -al
...
c1::dsk/c0t1d0                 disk         connected    configured   unknown
# cfgadm -c unconfigure c0::dsk/c0t1d0
CAUTION for any hardware requirement: Physically replace the drive

4. Check if there are some remaining device.

# ls -l /dev/dsk/c0t1d0s0

If yes clean the device tree with “devfsadm” command.

# devfsadm -Cv

5. Insert the new disk physically. The Solaris disk configuration should be automatically done. If required you can run the “devfsadm” command. Verify the new disk with format or cfgadm commands.

# devfsadm
# cfgadm -al
# echo | format

6. Label new disk with fdisk and format -e (choose “SMI label” under “label” entry)

# fdisk /dev/rdsk/c0t1d0s2
No fdisk table exists. The default partition for the disk is:
   a 100% "SOLARIS System"  partition
Type "y" to accept the default partition, otherwise type "n" to edit the partition table.
Then choose "y"

fdisk option can also be use with :

# fdisk /dev/rdsk/c0t1d0p0

This change can be done using fdisk under “format -e” as well.

# format -e c0t1d0
format> fdisk
...

Then change the label if needed.

# format -e c0t1d0
format> label
[0] SMI Label
[1] EFI Label
Specify Label type[0]:

6. Create partitioning by copying the partition table from the existing disk to the new disk.

# prtvtoc -s /dev/rdsk/c0t0d0s2 | fmthard -s - /dev/rdsk/c0t1d0s2
Note: Use the above command when the source disk and the target have equal size. If the target disk is larger please use format instead.

7. Re-attach the sub-mirror

# zpool attach rpool c0t0d0s0 c0t1d0s0

8. Let ZFS resilver the newly attached mirror.

# zpool status -v

9. Install the boot loader in the replaced disk

# installgrub /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c0t1d0s0

Filed Under: Solaris, ZFS

Some more articles you might also be interested in …

  1. Solaris Zones : How To Change The Number Of CPUs Using Dynamic Resource Pools
  2. How to Configure Integrated Load Balancer (ILB) in Solaris 11
  3. GUDS – A Script for Gathering Solaris Performance Data
  4. Examples of adding static routes in Solaris
  5. Solaris ZFS : How to Create and Manage Mirrored Storage Pools
  6. How to share ZFS as NFS in Solaris 11
  7. How To Increase rpool Size On Solaris 11 (Requires a Reboot)
  8. Troubleshooting solaris 10 boot issues related to SMF and milestones
  9. How to Kill Zombie (Defunct) Process in Solaris
  10. How to configure Solaris 10 Link Based IPMP

You May Also Like

Primary Sidebar

Recent Posts

  • grpck command – Remove corrupt or duplicate entries in the /etc/group and /etc/gshadow files.
  • xxd command – Expressed in hexadecimal form
  • sesearch: command not found
  • macof: command not found

© 2022 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright