2

I have one LV that spans across 2 phisical volumes, 2TiB each, for a total size of ~4Tib.

Is LVM going to first fill one disk and then start with the second one? In other words, supposing to take one of the 2 disks and attach it to another machine, would I be able to still read some data?

Ignazio
  • 123
  • 1
  • 5

2 Answers2

3

The way how LVM allocates space is controlled by allocation policy within the volume group. Under the right conditions it would be theoretically possible that all your data would physically be stored only on one disk.

Practically this does not work. LVM will refuse to activate any volume group for which physical volumes are not "sufficiently available". This means, for example, that you could start a volume group with only one out of two mirrors, n-1 out of n RAID-5 elements, etc., but in your case (linear/striped) volume you don't have any redundancy, so you would not be able to activate it.

Another problem is the filesystem. Filesystems do typically not allocate space from the beginning. After a period of allocation/deallocation, the allocated space gets fragmented and scattered all around, so it is extremely unlikely that all your data would end up on one disk.

And even if, against all odds, your data actually was on one disk, the filesystem would still be cut off, missing internal structures and therefore corrupted/inconsistent.

jurez
  • 615
  • this makes 1 LVM LV similar to a Raid0 when comes to data recovery, but without the boot in performances of raid0. Based on your answer I will try to do not create LV that span across multiple disks. – Ignazio Feb 21 '21 at 21:50
  • @IgnazioCalò LVM supports two types, "linear" essentially means one space after another, while "striped" means interleaved blocks, as in RAID-0. See here for more information: https://sysadmincasts.com/episodes/27-lvm-linear-vs-striped-logical-volumes – jurez Feb 21 '21 at 21:53
0

I believe logical volumes can be assigned to multiple RAID controllers. For example, in a primary and secondary controller configuration you can make one large logical partition go across 2 individual controller interfaces. I also believe you could scatter or fragment Logical Volumes across an even greater network of hardware or software controller cards. This may then incur a loss in read and write performance. If topologically designed properly, however, you may see some great performance enhancements.

This is a good question.