Matt Connolly's Blog

my brain dumps here…

Replacing a mirror boot drive in ZFS

My OpenIndiana backup server is a simple ZFS setup, being a mirror between two drives.

Here’s the steps I did to replace my failed Western Digital Green with a Seagate Barracuda Green:

#cfgadm -c unconfigure sata1/1
#zpool detach rpool c8t1d0s0
#cfgadm -c configure sata1/1
#format

Here I chose fdisk and formatted the disk with 100% Solaris partition.
Then I chose partition, and created slice 0 to start at cylinder 1 and use the rest of the disk.

# zpool attach rpool c8t0d0s0 c8t1d0s0
invalid vdev specification
use '-f' to override the following errors:
/dev/dsk/c8t1d0s0 overlaps with /dev/dsk/c8t1d0s2
# zpool attach -f rpool c8t0d0s0 c8t1d0s0
Make sure to wait until resilver is done before rebooting.
# installgrub -m /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c8t1d0s0

It does seem odd to me that the recommended way to set up the slices has slice 0 starting at cylinder 1 and overlapping with slice 8 which is the whole disk – resulting in the overlap error above and forcing the user to use the `zpool attach -f` option. Anyway. It’s done, and 20 hours later, it was fully resilvered.

Advertisements

2 responses to “Replacing a mirror boot drive in ZFS

  1. argulp 30 March, 2011 at 23:58

    and Fdisk partition ?
    In my point of view, you need to add a fdisk partition on the new drive, and you can copy vtoc (with fmthard & prtvtoc) before attach the new drive, you have try to boot on the second drive without the first one ?
    it’s works ?

  2. argulp 31 March, 2011 at 00:00

    ok sorry
    Here I chose fdisk and formatted the disk with 100% Solaris partition.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: