Sunday, April 28, 2024
5
rated 0 times [  5] [ 0]  / answers: 1 / hits: 4084  / 2 Years ago, fri, october 28, 2022, 4:41:43

I have been playing around with LVM on a virtual machine. Until now I have found only advantages on it and I'm thinking about using it on my real machine the next time I do a fresh install.



I have never used it on a "real life" scenario, so are there any shortcomings that I must be aware of, like performance penalties or harder management (e.g.: backup and recovery)?


More From » partitioning

 Answers
0

There is quite a bit of literature out there:



https://serverfault.com/questions/256896/advantages-and-disadvantages-of-logical-volume-manager-lvm-and-lvm-vs-encrypt



https://unix.stackexchange.com/questions/7122/does-lvm-impact-performance



The upshot is this:
In almost all scenarios LVM will offer you more flexibility and easy of maintenance. Even in the case of recovery the oft-cited problem of oh-my-god-when-one-disk-goes-all-is-lost problem is mostly easier to deal with than many RAID setups. Provided you leave some slack in your disk space you can swap a broken disk for a new one with the system running. Quite nice.



The second worry cited: performance hits due to an additional virtual layer is also not a problem for most scenarios: The throughput is as good as good-old direct partitions.



However, all of these are rather vague statements given the unclear specifics of your setup. So to find out you need to provide a lot more information on usage scenarios etc. And even then, your best bet is some benchmarking (e.g. bonnie++). Btw, doing those with your virtual machine will not be helpful. It is however a good way to practice the setup which initially seems a little cumbersome.






Edit: How to deal with backups:
If you are used to backing up your system hard disks using dd, you can continue this with logical volumes (LV). Keep in mind that LVs are also block devices to which dd can be applied. The underlaying organization for a block device is hidden from the recipient of a dd (one reason you can dump a partition into a file: dd if=/dev/hda1 of=/tmp/part_a1



However, using dd on a running system is dicey due to the potential changes in your disk while you are doing the backup (one protection would be to mount read-only). With LVM, however, none of that is necessary since you now have access to the fantastic new feature: snapshots!



Previously, you would have backed up the 'partition' directly and that is still valid:



dd if=/dev/mapper/VolGroup00-LogVol00 of=...


Now you can make a snapshot of a running system (provided there is some space, you might have to add disks and extend volume groups. All very easy ...)



lvcreate -s -L 64M -n mysnapshot /dev/VolGroup00/LogVol00


You can dd this to image it safe in the knowledge that it won't change.



So in summary, with a bit more work (in needing to understand the tools) you have more flexibility to get done what you are trying to achieve under many scenarios (including the backup issue)


[#32128] Friday, October 28, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
oileweaty

Total Points: 337
Total Questions: 108
Total Answers: 105

Location: Western Sahara
Member since Mon, May 3, 2021
3 Years ago
;