Hacker News new | ask | show | jobs
by magicalhippo 2213 days ago
Thank you for the explanation, I was wondering how that worked. How does it work if you then later add a fifth 4TB drive?

Anyway, I guess in this sense you could do something similar with ZFS, create a bunch of 1TB partitions and then make vdevs (slice) across a set of partitions on each drive.

Not sure if it's a good idea or not though. I do know you supposedly lose some performance when handing ZFS a partition rather than the whole drive, but maybe there's something else I can't think of right now.

1 comments

> 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.