• 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. The ultimate Solaris Volume Manager (SVM) interview questions
  2. What are Oracle Solaris 11 Installation Methods
  3. Complete Hardware Reference : SPARC T3-1 / T3-2 / T3-4
  4. How to Use the ‘truss’ Command for Program and Error Analysis in Solaris
  5. Understanding Special Permissions (setuid, setgid, sticky bit) in Solaris
  6. Solaris : How to scan new storage LUNs (scsi/iscsi/fc/sas)
  7. How to Configure TCP Keepalive option in Solaris
  8. How to Kill Zombie (Defunct) Process in Solaris
  9. Beginners guide to Oracle Solaris Live Upgrade
  10. Solaris : How to enable ssh login for root user after a fresh install

You May Also Like

Primary Sidebar

Recent Posts

  • qm Command Examples in Linux
  • qm wait Command Examples in Linux
  • qm start Command Examples in Linux
  • qm snapshot Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright