Re: Questions about Backup and Restore Strategy for LVM2 on LUKS2 and for LUKS1 on boot partition
Milan Broz <[email protected]>
| Newsgroups | dev.linux.lists.cryptsetup |
|---|---|
| Message-ID | <[email protected]> |
On 11/4/22 08:39, Arno Wagner wrote: > Just one comment on LVM: > > LVM makes partitiopn set-up easy for distribution installers, > but it makes things much more complicated. LVM is one of these > tools that are incredibly powerful, but you should only use them > if you have a really good reason to, because it also makes > fixing problems incredibly complex. Unfortunately, there are > a lot of lazy people out there that will gladly accept a simpler > job now for a much, much harder job in case of problems in > the future. This is going on all over the software world, > unfortunately, because the process of engineering software > is not mature at all yet. > > So, to be clear, LVM will make it basically impossible to > recover your LUKS partition if anything goes wrong, because > if it is used, you need to not only understand the technical > details of LUKS (relatively sinmple) but also the technical > details of LVM (pretty complex) to fix anything. > > And that is why I recommend not mixing LUKS and LVM and generally > not using LVM unless there is a very good reason to use it. > More convenience in writing an installer is not even a regular > good reason. Classical partitions work just fine. While I do not like some LVM concepts, it works very well in simple scenarios and recovery is sometimes even easier than on regular partitions (there are metadata backups, revert/restore is possible almost always if data are still on-disk - not discarded by TRIM command or so). Many distributions use LUKS/LVM combination by default. For example, if you need to add space to a partition, resizing can be really complicated if there is no free space directly next to it. (Here I would say it is the parted tool that is overengineered and dangerous.) With LVM you can simple add another segment anywhere on disk to logical volume with much simpler and safer way (it will even resize fs, if you tell it to do). I think we should focus how to help with these simple scenarios (as documentation is often obsolete) than to just keep suggesting that LVM is useless and recovery is complicated (it really is not if it is just simple linear mapped volume). Milan