17th Jul2012

Resize/Shrink Software RAID1 FileSystem/Volume/Partition and setup a LVM on the free disk space created

by Gyro
This is a guide on how to shrink a Software RAID1 filesysten, volume, and partition on a dedicated/remote server. I added the sources that helped me complete this task at the bottom of this post. It took about 2 days to get this sorted out, mainly because I am a Jack of all traits, and a master of none. :crazy:

This guide on how to resize a software raid1 should work on most Linux Distributions. I used a dedicated server located in Strassburg running Ubuntu Server 12.04, and I connected to it via ssh from Asia. :wooty:

Here my setup prior to doing this:

Two 2 TB hard disks (sda/sdb) with 3 partitions each
sda1/sdb1 -- md0 -- /boot
sda2/sdb2 -- md1 -- swap
sda3/sdb3 -- md2 -- /
md2 uses pretty much all the space.

Here the setup after completing the steps below:
Two 2 TB hard disks (sda/sdb) with 4 partitions each
sda1/sdb1 -- md0 -- /boot
sda2/sdb2 -- md1 -- swap
sda3/sdb3 -- md2 -- / (~320GB)
sda4/sdb4 -- md3 -- LVM "nova-volumes" (~1650GB)

(more…)

16213