Harddrive Replacement is here
About two weeks ago the harddrive of my home server failed. I wrote a post about this. Yesterday Western Digital delivered the replacement. So it was time to put it into the server. As I wrote I have replaced the failed drive already. So this will extend the RAID by one adding about 3TiB.
To start the replacement I add the drive to the fourth bay and start the server. As the SATA controller of the server is set to AHCI the drive is detected as an additional drive and so will be managed by the Linux kernel.
After booting into Linux I repeat the same first steps of the last article where I have to copy the partition table and the UEFI partition of the first drive. Next I add the second partition to the RAID 1 as a spare and the third as a swap partition.
On to business. I now need to add the partition for the RAID-5 drive.
This alone makes the drive available as a spare drive but I want to extend the RAID. So I need to grow it. This will issue a reshape of the array and take about 20 hours. So I return next day to proceed.
After those 20 hours I extend the physical LVM volume. But first I want to know the size of the resized RAID-5 volume.
This displays the meta data of the device. You can also see the history of the RAID here. The first is number 3 which I did put in 2 weeks ago. The last is the new one today. Number 0 was from the drive I have sent to WD. Now, in the future I will have about 8.2TiB for the LVM volumes. So I extend the pyhsical volume to that size.
I have decided to just extend the /home partition. It is 2TiB at the moment and will be about 4.5TiB after the resize.
The -l parameter tells lvresize to extend to 100% of the physical VolumeGroup. See man lvresize
for more. Now the device has the 4.5 TiB available but the partition is just at about 2 TiB. The filesystem also has to be extended. I use resize2fs for that. Normaly I need to unmount the partition but it also works online (with a risk). So I stop all services and issue the command
This takes some seconds as it formats the added space. After that the full space is available.
With that I am done. The drive is added and running fine ever since.
FIN.