Reinstall Linux with LVM partitions
Hello,
When Linux is installed with LVM partitions, if I want to reinstall Linux and need the information of a partition in the new installation, should the partitioning type in the new installation also be LVM? Thank you. |
You are doing a reinstall. Do you want to preserve one or more current file systems, or do a full reinstall?
A full reinstall gives you the option to reconfigure the storage to your liking and there is no reason to preserve the existing structure. If you want to preserve a current file system, you need to preserve AT LEAST the current structure as it contains or defines the current file system that you want to preserve. Actually my better advice would be to back up any file system you want to retain, and verify the backup. Then do that again on different media. This way, with two verified backups, you are assured that you can restore even if a backup device goes south on you. Then do a full install overwriting the old structure with whatever you have planned: then restore the backup so you have access to that data. Having those backups also protects you against the case that something goes bad during the install and ALL of your storage gets wiped! I have seen devices that have worked perfectly for years suddenly decide that maintenance day was the day to finally fail, and a backup protects you against that kind of thing. Get the backups first, then you can decide how to proceed from there at your leisure with less pressure. |
Indeed, one of the key advantages of LVM is that you don’t (!!) have to be concerned with the physical (drive and/or partition) arrangement, because “Linux file systems” never see it. They only see a “logical volume,” which lives in an endlessly-expandable “storage pool.” (Which can be re-configured “on the fly.” For instance, if that “failing drive” is generous enough to give you a little warning …)
When setting up your new environment, it can be “physically” configured any way you like. |
No, you can mix normal and LVM devices any way you want. Also, LVM volume is not a partition but more akin to loop device, but that's beside the point.
|
yes, LVM is not a partition type, but a way to manage partitions. You can install your OS with or without it.
|
as it name says. logical volume manager it's just helps to manage volumes
as Gemini AI says: Quote:
|
Hello,
Thanks for all the replies. Consider the following partitioning: Code:
# lsblk |
Just continue to use LVM. Eventually, you will be very glad you did.
|
Quote:
Quote:
|
Quote:
LVM is actually a physical storage, not virtual. It is a means of managing flexible storage without the limiting features of physical drives or partition sizes and adds the ability for storage in a single file system to span multiple physical drives seamlessly. I have been using LVM for many years, and I love the ability to add space and grow the file system seamlessly while the machine is in use. I use a raid array with LVM and have gradually grown from a measly 1 TB size to more than 10 TB on that raid array and never needed to be concerned about shutting down to do so. I have had drives fail and be replaced without problems with the raid, and I have had the file system grow as needed with more data storage, also without shutdown nor partitioning hassles. |
If you have, and will only ever have, a single physical drive that will never change then LVM works but provides little value. As soon as you are adding drives or moving storage (resizing partitions or file systems) then LVM is golden.
There is no reason to use it with ZFS or BTRFS, but if you are using EXT4 on RAID (physical or using MDADM) it can save you no end of complications. |
Quote:
Quote:
Quote:
|
Quote:
It is useful and powerful, and had you ever encountered a situation where it made the difference between a 12 hour outage maintenance and completing the change without outage on a Monday morning you would know that. That said, it is unclear if the situation justifies it for the OP. We have options now that make LVM less a requirement than an option. Also, his does not sound like a production environment and a short outage to make storage changes might be perfectly suitable for his operation. We cannot change that or determine that, we can only give information and allow the OP to make that judgement. More important here is that the OP wants to preserve some of the data. The best way, with or without LVM, is to back that data up. This also simplifies everything else the OP has planned. |
Quote:
|
Quote:
Quote:
|
Quote:
You know what they say about assumptions.... |
I kindly disagree that "LVM is not for your home PC." You actually never know when you might need more space. The LVM subsystem provides an elegant(!) way to address that problem – as well as a way to rid yourself of a drive which ("*click* *click* !! *click* *click* !!") might be beginning to fail. And, it basically doesn't cost you anything – even if you never actually have need to use it. I always select this option when installing everything, and never think twice about doing so.
|
Quote:
LVM has a definite use, and is also very easy to use. It is flexible and robust so home use is just as simple as any other location. In fact, with the currently available drive sizes (both SSD and HDD) a user is forced to 1) over provision file system partitions in anticipation of growth, 2) shutdown and manipulate partition sizes when a critical partition fills up, or 3) use LVM or similar to provide the ability to manage file system sizes on the fly without interrupting operations. This applies to those with systems at home as well as large enterprise servers. You may voice what ever choices you prefer, but I have used LVM on a raid array for many years (at home) and have never encountered a problem that forced loss of data or time. Even with loss of 2 different HDDs in about 7 years span. Please feel free to suggest an alternate means of managing file systems and drives which provides the same ease, flexibility, and reliability as LVM. Note that I do not disagree about the potential risk of data loss that multiplies as the number of devices involved increase when used in JBOD arrangement. (this is also the problem with using raid 0). However, using a actual raid array (raid 5 or 6 is what I prefer) beneath the LVM mitigates that risk almost 100% |
Quote:
I don't care all about that, I just don't need that. Usually if a partition is full I buy another disk (obviously newer, faster, bigger and can say earthquake too), move my old partition completely to the new device, and over. I don't need to do anything else with it. Additionally I don't want to use the old and slow device any more, therefore extending its partitions does not solve anything. Having spare space on my disks to be able to manage file system sizes is ok for me. Also there is no need to use raid. OS can be reinstalled in an hour, everything important is backed up into another storage, so I can recover anything any time. There was only one issue in my life with spinning disks, one of them went into deadlock and stopped to work. Anyway, I don't use old disks. |
Quote:
|
Quote:
For others there are better options. If you need maximum performance I find a large RAID 5 array using MDADM and LVM with EXT4 file systems tests fastest for database operations. For my personal laptop use I prefer BTRFS without RAID or LVM, performance is not as important and BTRFS is more than good enough. It all depends upon your needs, operation, and available resources. There is no single "right" answer. If you identify a single WRONG answer you would have to justify that decision and explain what makes it "wrong". I am not seeing that here. |
For my personal use ext4 works well for me. Easy to maintain. No need for LVM in any 'my' home systems (desktops/laptops/server/RPIs). Disk space is cheap, so no need to extend/resize etc. Good backups of data is all that is necessary. As said above, there is no 'right' answer for 'everyone'. Each has own set of criteria.
|
All times are GMT -5. The time now is 07:15 AM. |