welcome: please sign in
Page Locked

FritzHotSwapDrive

Replacing a drive in fritz's main array is somewhat complicated since we're using software raid on top of partitioned disks.

To simplify things, attempt to acquire identical disks, or at least ones with the same block counts. We had good luck with Xbyte when the first drive failed in production. This is true for both RAIDs.

Inserting the disks is straightforward: if using a new bay, just pry out the drive blank and insert the drive. If the drive is not in a hotswap sled, there are four screws and the rest is obvious from the design of the sled.

1. md2 (AFS)

This is easy since we're using md on top of the entire disk: mdadm --fail /dev/md2 $FAILED-DRIVE, remove the drive, insert the replacement, and mdadm /dev/md2 --add $NEW-DRIVE to insert the new drive.

Alternatively, leave the failed drive in, add the new drive to the array, and then fail the dying drive.

2. md0 and md1 (/ and swap)

This array is complicated, because we weren't so familiar with software raid and lvm at install time, and partitioned the disk, running an array on each partition.

In the examples, we will use $CURRENT for the non-failed drive in the array, $FAILED for the failed drive, and $NEW for the new drive. Substitute with the appropriate /dev/sdX.

2.1. Partitioning

If you managed to find a drive with the same block count, your life is easy. Determine the /dev/sdX names of each disk.

To dump information on the total block count of the drive for verification, run sfdisk -s $DISK on the living drive and the new drive.

If the block counts agree, there's one step: sfdisk -d $CURRENT | sfdisk --force $NEW. sfdisk may complain about paritions not ending on cylinder boundaries, but the warning is harmless. You may want to use sfdisk -n to do a dry run. If you enter the wrong device node you will destroy the target disk. Proceed with caution!

2.2. Adding to RAID

Use mdadm /dev/$array --add $newN to add partitions $new3 to md1 (rootfs), $new2 to md0 (swap). $new1 is intended to be a mirror of sda1, but we did not install md onto the device and need to fix that.


CategorySystemAdministration

FritzHotSwapDrive (last edited 2012-12-15 07:38:46 by ClintonEbadi)