Replacing an EACS drive for an EADS

// February 12th, 2009 // Technology

So the shop somehow managed to deliver my custom PC with 2x EADS drives and 1x EACS drive. Normally, to rectify this kind of mishap would require backing up the data on the drive and restoring the data to the replacement disk.

Not so with ZFS. Because my three drives are in a raidz storage pool, ZFS automatically partitions and manages my data. This allows up to one device in the pool to fail (single parity).

Replacing the drive was a case of:

1. Pulling out the old disk.
2. Cabling up the new disk in the, now-empty slot.
3. Booting the OS as normal.
4. Resilvering the raidz zpool with a single command: zpool replace <name of device to replace>
5. Go get coffee, rebuilding the array will take some time. Once it’s done, check status with: zpool status

After the break I give some examples of what you may see:

In a mirrored pool, you get roughly 2x the read speed (since data is coming from both disks) but roughly half the write speed (since data has to be written to both disks). The nice thing is that if one disk in the mirror dies, the other drive is still functioning.

This is roughly similar to the raidz pool, except that a raidz pool splits 2TB of data across 3TB of disks (if you’re using 3x EADS drives like me). This is a bit more cost effective.

Here is a mirrored zpool that is “degraded”. Time to go buy a replacement disk for c1t0d0 (Controller – 1, Target – 0, Disk – 0).

# zpool status -v tank
pool: tank
state: DEGRADED
status: One or more devices could not be opened. Sufficient replicas exist
for the pool to continue functioning in a degraded state.
action: Attach the missing device and online it using ’zpool online’.
see: http://www.sun.com/msg/ZFS-8000-2Q
scrub: none requested
config:
NAME STATE READ WRITE CKSUM
tank DEGRADED 0 0 0

mirror DEGRADED 0 0 0

c1t0d0 FAULTED 0 0 0 cannot open
c1t1d0 ONLINE 0 0 0


errors: No known data errors

Nex step —> Replace the disk with a similar disk (don’t put a smaller disk to replace it please!). To begin running the resilvering process, you only need a single command:

# zpool replace c1t0d0

Here is an example of the resilvering process, which is rebuilding a replacement disk from the information in the other disks in the array

# zpool status tank
pool: tank
state: ONLINE
status: One or more devices is currently being resilvered. The pool will
continue to function, possibly in a degraded state.
action: Wait for the resilver to complete.
scrub: resilver in progress for 0h2m, 24.57% done, 0h30m to go
config:
NAME STATE READ WRITE CKSUM
tank DEGRADED 0 0 0

mirror DEGRADED 0 0 0

replacing DEGRADED 0 0 0

c1t0d0 ONLINE 0 0 0
c1t1d0 ONLINE 0 0 0

Once the resilvering is done, you should get something like this:

# zpool status tank
pool: tank
state: ONLINE
scrub: resilver completed after 0h32m with 0 errors on Thu Jan 11 09:50:11 2009
config:
NAME STATE READ WRITE CKSUM
tank ONLINE 0 0 0

mirror ONLINE 0 0 0

c1t0d0 ONLINE 0 0 0
c1t1d0 ONLINE 0 0 0


No related posts.

Leave a Reply