Is it necessary to partition a drive in use w/ LVM?
Linux - EnterpriseThis forum is for all items relating to using Linux in the Enterprise.
Notices
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.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Is it necessary to partition a drive in use w/ LVM?
If an entire drive is going to be under the control of LVM is it really necessary to partition it first with, for example, fdisk? Are there any future ramifications to not doing that?
Not necessary, you could start with a blank this and the use pvcreate, vgcreate, lvcreate and so on to define the LVM scheme, the RHEL installer can help you do this without any problems, but if you have already created partitions using fdisk you could use one or more of those partitions to setup the LVM, again, using the tools of LVM2 tools package.
Yeah ... I get all the LVM stuff; we use it religiously here. This really is more of an after-the-fact kind of question. One of the admins on my team did this recently when adding a few drives to an existing system. Our standard practice has always been to partition the whole drive first with fdisk, then do the pvcreate, etc. I'm just trying to figure out if there are any ramifications to skipping the fdisk task and what the best practice is. I will review the LVM doc to see if there is any best practice info in there regarding this ...
OK ... here's a section from the doc (section 4.2.1.1) ... doesn't help much:
Quote:
If you are using a whole disk device for your physical volume, the disk must have no partition table. For DOS disk partitions, the partition id should be set to 0x8e using the fdisk or cfdisk command or an equivalent.
Maybe I'm being dense here :-) but those statements seem to contradict one another.
Is not contradictory actually, what it says is that you could use the hole disk without any partition table (requirement) or if you already have DOS partitions created, then you should use fdisk or cfdisk to change the partition type to 0x8e (LVM).
IMHO, I would rather use fdisk, cfdisk or whatever to create partitions and then arrange the LVM structure from there since (to me) I will have more control over the partitions from the beginning. This would be good if I need for instance a /boot partition which can't be in the LVM scheme.
LVM has a very specific use in a system, however, maybe not every partition or disk needs that specific use, what doesn't need to be on the LVM (becuase you won't gain anything with it) doesn't have to be part of it, so it will be better to set through fdisk or the like a basic disk structure and from there create the LVM with the disk space that need to be part of it. That's what I mean with control.
But of course, that's just my opinion, others could think different
Regards
Last edited by Acron_0248; 01-09-2008 at 10:27 AM.
I create 3 partitions when dealing with LVM. 1 for /boot, another for swap, the rest for the LVM PV where all the other partitions will get sliced up within LVM. You can also put swap in LVM, so a minimal is 2 partitions. I'd hate to think /boot is in an LVM PV and it gets corrupt, making the whole system really unusable.
Yeah ... I understand that for a boot drive; ours is setup similarly. This particular circumstance is for an additional pair of drives that were added to grow a data file system. They are dedicated exclusively for this.
Yeah ... I understand that for a boot drive; ours is setup similarly. This particular circumstance is for an additional pair of drives that were added to grow a data file system. They are dedicated exclusively for this.
Then I would see the need to fdisk them first to format them for Linux native OS, etc. I mean, you just don't slap in a drive with absolutely nothing on it and try to add it to an LVM PV or existing filesystem..
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.