On 8/12/21 2:35 PM, Mauricio Tavares wrote:
While I agree with the "add the pvs to the vgs, pvmove
data,
remove old pvs" approach, I would like to ask more about why you do
not use the entire disk for a raid, instead partition both drives in
many volumes and then create raid1 volumes using the respective
partitions in the two drives. Does that limit the damage due to HD
failure somehow better than a single partition?
There are a few reasons.
Suppose you make a RAID-1 of two 1TB disks, then one of them fails, you try
to replace it with a newer one, but you discover that the number of
available sectors is different by a small amount: the new one is smaller,
let's say 1.0003TB instead of 1.0005TB of the previous two drives.
You now have to do dangerous resizing at RAID level (while in degraded mode),
I would definitely avoid it. Or, I should try to pvmove everything
out of the degraded RAID-1 to recreate it again a bit smaller. Annoying.
Similar issue if I have md14 and md18 of different size: I would like
to pvmove from md14 to md18 but one extent will not fit and must be parked
in another place. Standardized md?? solve this.
Another reason is that if I have a lot of 2TB disks, each divided in
4x470GB partitions and joined in couples to have many RAID-1, I may decide
one day I also want to use some space in a 4 disk RAID-5 mode. In this case
I just have to free (pvmove) two RAID-1 couples, remove them from the vg
and turn them into 4 disk RAID-5. Using different parts of the same disk
as RAID-1 and RAID-5 would be impossible by using md on entire disks
(the same loss of flexibility often comes from "hardware RAID").
Going back to "different size of different disks", I sometimes explicitly
decide to use slightly different sizes when disks are provided by a cloud
provider (in a datacenter) that gives you no way to map what you see
in the administration panel (disk1, disk2, disk3) with what you get
in the machine (vda, vdb, vdc). To make disks recognizable I have the habit
to size them slightly different (1900GB, 1910GB, 1920GB), so I'm able to
identify them in /proc/partitions even if letter order is messed up.
Regards.
--
Roberto Ragusa mail at robertoragusa.it