1

my some-years-old linux server has four raid-1 volumes:

/dev/md1 on /boot type ext4
/dev/md2 on / type ext4
/dev/md3 on /home type ext4
/dev/md4 on /data type ext4

The four volumes are stored in this order on the disks.

Over the years there were some distribution updates and with them the kernel and initrd in /boot became bigger and bigger. Nowadays the /boot volume is too small for two kernel versions (new, old). Is there a way to grow /dev/md1 a bit, e.g. 100M and shrink /dev/md2 to free the needed space?

Thank you.

1 Answer 1

0

Inelegantly, as follows

  1. Take a backup. Yes, really. Borrow a disk if you must but take a backup before you start
  2. Fail the partitions on one disk, splitting the RAID
  3. Flatten and repartition the "failed" disk. Consider whether this is a good time to start using LVM on top of RAID instead of fixed partitions
  4. Create new RAID1 partitions on the previously failed disk with a single member and one missing member, and build file systems on the top as appropriate
  5. Copy all the data across from the remaining RAID member to the new partitions disk
  6. Destroy the old RAID1, repartition the disk as appropriate and add the members to the new RAID1
  7. Update and reinstall the bootloader

If you get it perfectly correct you'll end up with a new RAID1 containing all your data. If you get it wrong you could end up losing everything. But you took a backup, right?

You can test the process before you touch your real data by using a couple of loop devices. I've got several examples of this approach over on Unix & Linux

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .