LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Enterprise (https://www.linuxquestions.org/questions/linux-enterprise-47/)
-   -   Is it necessary to partition a drive in use w/ LVM? (https://www.linuxquestions.org/questions/linux-enterprise-47/is-it-necessary-to-partition-a-drive-in-use-w-lvm-612328/)

stgrob 01-09-2008 08:04 AM

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?

For reference, this is a RHEL 4 AS x64 server.

Thanks!

Acron_0248 01-09-2008 08:32 AM

Hi,


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.

I recommend you to read carefully the LVM administrator's guide at ret hat docs.




Regards

stgrob 01-09-2008 09:00 AM

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 ...

stgrob 01-09-2008 09:27 AM

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.

Acron_0248 01-09-2008 10:25 AM

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

trickykid 01-09-2008 11:33 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.

stgrob 01-09-2008 12:28 PM

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.

trickykid 01-09-2008 05:35 PM

Quote:

Originally Posted by stgrob (Post 3016897)
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.. ;)


All times are GMT -5. The time now is 05:46 AM.