Checking a system, I found a server with 12 4TB drives in Raid5, with LVM on top. Single VG, single PV, and a few LGs that wouldn't need more than 6TB of space (currently only 4TB). Read speed is no issue so I'd like to reduce the raid to only 5 disks + 1 spare. It's not expected to grow much in the next few years.
Have anyone had experience reducing arrays that sit under LVM?
Yes, I will backup first, but I'd like to know if there is a safe and secure way to do it.
The steps I assume are:
- resize (reduce) the fs of the LVs
- reduce the LVs
- move the extents (pvmove) to the beginning of the VG
- fail-remove one disk from RAID5
- pvresize --setphysicalvolumesize=new_smaller_size
- reduce (mdadm --grow /dev/md0 --raid-devices=n-1..) the array (let's hope it cuts only the tail)
- .... repeat for next disk.
I'd like to hear your opinions.
PS: Yes, I know that backing up, rebuilding and loading the backup might be faster and easier, but I want to learn... have some experience if I ever face a situation where backing up is unfeasible.