[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: LVM creation methods



On Fri, Jul 20, 2012 at 05:35:03PM +0500, Muhammad Yousuf Khan wrote:
> i was reading a document where a person has configured physical volume
> and didn't use fdisk
>   he just directly created the partition by "pvcreate /dev/sda"
> 
> and there are some documents which shows the utilization of fdisk and
> converting sda1 to "8e" type  which is LVM.
> 
> so the question is what is the difference b/w creating it directly on
> disk by pvcreate command and by using fdisk.

With one, you're using the whole disk, with the other, you're using a
portion of the disk. If you want to use the disk with non-LVM-aware
operating systems, then you'll need to partition the disk and give them
a partition. Bear in mind that "non-LVM-aware" probably includes your
BIOS, too, so a whole-disk PV is unbootable.

That said, if you only want to use that disk for LVM, then there is no
issue with using the whole disk. In fact, for Advanced Format disks and
SSDs, it may be preferable as you're more likely to get the alignment
right on them.

> 
> actually i have just created the partition via direct command
> "pvcreate /dev/sda"  it is fully functionally and i can use it as a
> partition but when i fdisk -l /dev/sda  it shows that the disk is
> empty. so i am worried that is it the proper way to do it or else i
> may not end up with consequences.

fdisk only reads (as far as I'm aware) PC-style partition tables. If it
says the disk is empty, what it's saying is that there's no partition
table there. If you had a GPT on there, you'd likely get the same
message (actually, newer versions DO detect GPT and print a complaint).

Use the right tools for the job. If you have a partition table, read it
with fdisk. If you have a PV on there, use LVM tools.

Attachment: signature.asc
Description: Digital signature


Reply to: