Hacker News new | ask | show | jobs
by cvubrugier 2212 days ago
> How does it work if you then later add a fifth 4TB drive?

If you later add a fifth 4 TB drive, two partitions (1 TB each) are created on it. The remaining 2 TB will be unused: a slice with a single element cannot be replicated.

The first slice is expanded from "4 x 1 TB, RAID5" to "5 x 1 TB, RAID5", so the logical capacity of that slice is now 4 TB.

The second slice is migrated from "2 x 1 TB, RAID1" to "3 x 1 TB, RAID5". MD is able to change the RAID level (aka the "personality") of a RAID array, which is pretty cool.

Then the LVM layer is made aware of the increased capacity of the MD layer with `pvresize`.

The solution of using "LVM over MD" suffers from its complexity because you have to manage two distinct layers. For instance, you have to run LVM / mdadm commands in the right sequence to replace a failed drive.