Due to a hard drive starting to report errors, I needed to remove my data from it and replace it. It was part of a 2-drive BTRFS RAID1 file system of 2 - 2TB drives. For those unfamiliar, RAID1 is "mirroring" which means both drives have duplicate copies of all the data. This protects your data from a single drive failure as both drives have a full copy of all your data. My server has two sets of drives in RAID1 arrays, the old set od 2x2TB and a newer set of 2x6TB leaving a total data capacity of 8TB, all protected with RAID1.
Since the drive it was paired with is also showing signs of age, I plan on removing it soon as well. The replacement for both of these drives will be a single, larger drive. At 10TB, this new drive is considerably larger than both the old drives combined, so I will be moving away from the RAID1 setup for the time being and utilizing a backup strategy instead of RAID1. This will reduce heat, power consumption, and the likelihood of a failure (more devices = an increased chance of failure).
Using BTRFS, there are two ways to remove a drive from a RAID1 array - you can "fail" the drive, replace it, and re-build the array or you can remove the RAID completely, converting the array into a "JBOD" array (Just a Bunch Of Disks) and then move the data off of the failing drive. The first option requires mounting the RAID array in "degraded" mode - basically, you pretend the drive has actually died and replace it with a similar size drive. This didn't fit my larger plan of upgrading the drive capacity so I went for the second option.
Since I am using BTRFS, this entire operation can occur with the data still accessible and while still using the system. This is not possible if you're using MDADM RAID and EXT4. I often talk about the virtues of BTRFS and this is a big one. My hardware setup has a four drive limitation in the case but benefits from them being externally removable. My motherboard also supports "hot swapping" which means I can replace a drive while powered on. If all goes well, all of the steps below will occur without powering the system down and maybe not even rebooting. Since it's a 14.04 Ubuntu server, I may end up having to reboot once if it doesn't "see" the new drive. I will also be removing the second drive of this array because it's old and will not be needed once the new drive is in place.
The steps involved:
Phase 1 - Getting the bad drive out of the system.
1) Make a backup of the data.
2) Convert the data, metadata, and system data from RAID1 to JBOD.
3) Move all the data off of the failing drive to the remaining drive.
4) Physically remove the bad drive.
Phase 2 - Getting the new drive into the system and removing the last old drive.
5) Install the new drive.
6) Format and test the new drive.
7) Move all the data off of the old drive to the new drive.
8) Remove the last old drive.
I will document theses Phases and their Steps in following posts...
Since the drive it was paired with is also showing signs of age, I plan on removing it soon as well. The replacement for both of these drives will be a single, larger drive. At 10TB, this new drive is considerably larger than both the old drives combined, so I will be moving away from the RAID1 setup for the time being and utilizing a backup strategy instead of RAID1. This will reduce heat, power consumption, and the likelihood of a failure (more devices = an increased chance of failure).
Using BTRFS, there are two ways to remove a drive from a RAID1 array - you can "fail" the drive, replace it, and re-build the array or you can remove the RAID completely, converting the array into a "JBOD" array (Just a Bunch Of Disks) and then move the data off of the failing drive. The first option requires mounting the RAID array in "degraded" mode - basically, you pretend the drive has actually died and replace it with a similar size drive. This didn't fit my larger plan of upgrading the drive capacity so I went for the second option.
Since I am using BTRFS, this entire operation can occur with the data still accessible and while still using the system. This is not possible if you're using MDADM RAID and EXT4. I often talk about the virtues of BTRFS and this is a big one. My hardware setup has a four drive limitation in the case but benefits from them being externally removable. My motherboard also supports "hot swapping" which means I can replace a drive while powered on. If all goes well, all of the steps below will occur without powering the system down and maybe not even rebooting. Since it's a 14.04 Ubuntu server, I may end up having to reboot once if it doesn't "see" the new drive. I will also be removing the second drive of this array because it's old and will not be needed once the new drive is in place.
The steps involved:
Phase 1 - Getting the bad drive out of the system.
1) Make a backup of the data.
2) Convert the data, metadata, and system data from RAID1 to JBOD.
3) Move all the data off of the failing drive to the remaining drive.
4) Physically remove the bad drive.
Phase 2 - Getting the new drive into the system and removing the last old drive.
5) Install the new drive.
6) Format and test the new drive.
7) Move all the data off of the old drive to the new drive.
8) Remove the last old drive.
I will document theses Phases and their Steps in following posts...
Comment