Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
trying to get a proper understanding of LVM and RAID and how to migrate from a conventional partitioning scheme to one with RAID-1 and LVM, I have a very specific question, that is not explicitly answered in any of the documents I found "Alta Vista'ing" and "Yahoo'ing" the web.
Is my understanding correct for the following points:
As in a logical volume group logical volumes can be added and removed ad lib, there is no use in creating an extended partition to contain multiple logical partitions, first (which is necessary in a non-LVM system, as there can be only four primary partitions on an x86 or x86_64 PC).
As partitions can be added to RAID and/or put under LVM control also after they have been created, the existence of extended partitions doesn't hurt.
Only the logical partitions contained in the extended partition will be used/seen by LVM, the extended partition is simply useless.
Therefore it is no problem for a logical volume to span primary and logical partitions.
I'd be grateful, if you could confirm or correct me here!
- Correct. My typical installs using LVM are sda1 == /boot, sda2 == LinuxLVM. And then swap, /, and any other filesystems I want (/tmp, /var/, /var/log, /var/ftp, ...) will be LogicalVolumes. As long as they are not in use you may safely deactivate a LV and safely remove it.
- Correct. To be clear, any data on a partition being added to RAID or LVM will be lost
- Correct. Extended partition is nothing more than a container for logical partitions used to overcome the "only 4 primary partition" limitation
And a typical sw-RAID and LVM setup would have a RAID on the partitions and then you'd pvcreate the /dev/md? device and use LVM on it.
What does deleting earlier-made logical partitions do to LVM's device number?
Here's the scenario:
I started with a computer that had two of its primary partitions already in use (one by Windows and one by the Dell diagnostics utility). Another primary partition I used for GRUB2. This only left the extended partitions in which to create an LVM group, so I did and then made several LUKS encrypted volumes in the LVM.
My problems started after I deleted an NTFS extended partition that existed before I installed Linux. This seemed to change the device number for the LVM group (in both the GRUB2 h0,X format and the Linux sdaX format). I was able to edit grub.cfg to find the correct partition, but it never again prompted me for a decryption password and never mounted the drive. Booting up from a live CD and installing the lvm2 and cryptsetup packages didn't help because the partition of the LVM group stopped showing up as a block device altogether and so I couldn't do use the various lvm tools on it.
I ended up deleting everything and starting over. But for next time...
How can I add and delete other extended partitions without renumbering the extended partition that contains an LVM group on it?
If partitions do get renumbered, is there a way I can force those numbers to change back?
What should I have done to restore my access to a perfectly good LVM group rather than deleting it?