FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

 
 
LinkBack Thread Tools
 
Old 07-20-2012, 12:35 PM
Muhammad Yousuf Khan
 
Default LVM creation methods

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.

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.


Thanks,


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: http://lists.debian.org/CAGWVfMme=R7mXBqpCuJp7xTN-3UxzPURD5FNh6cVouxN1NX2GQ@mail.gmail.com
 
Old 07-20-2012, 12:45 PM
Meike Stone
 
Default LVM creation methods

2012/7/20 Muhammad Yousuf Khan <sirtcp@gmail.com>:
> 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.


from the manual page of pvcreate:

"pvcreate initializes PhysicalVolume for later use by the Logical
Volume Manager (LVM). Each PhysicalVolume can be a disk partition,
whole disk, meta device, or loopback file. For DOS disk partitions,
the partition id should be set to 0x8e using fdisk(8), cfdisk(8), or a
equivalent. For whole disk devices only the partition table must be
erased, which will effectively destroy all data on that disk."

So if you use a whole disk, it must be erased and have no partitions ...
Nothing is wrong

Meike


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: http://lists.debian.org/CAFNHiA_Ou=BNsPntvkPxZFns-BfZ2VVEi0MhtKp47VtK1XdSYQ@mail.gmail.com
 
Old 07-20-2012, 12:53 PM
Darac Marjal
 
Default 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.
 
Old 07-20-2012, 02:17 PM
Muhammad Yousuf Khan
 
Default LVM creation methods

thanks it is very clear,

yes, i am using the second disk just for storage purpose. so i am not
worried about the booting since it is already been handled via
/dev/sdb
so no issues for me.

Thanks both Meike and Darac

On Fri, Jul 20, 2012 at 5:53 PM, Darac Marjal <mailinglist@darac.org.uk> wrote:
> 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.
>
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.10 (GNU/Linux)
>
> iQIcBAEBCgAGBQJQCVTMAAoJEKB7YbRsd8TGWPsP/2/mEFndeci7aOlwSEgnrv/e
> mL1f5431IuH8g78BVP/DYDrRfDt5OJqqmPdMIuteZKdfA9QcmciOgyfrlpqnh0l1
> fgQbbJDgItHoHOpYiCowAXvn2qFZM/s+1NHW4qBxLSn2A2jQTOfC58dg47ML5FC5
> UsrtiN3h7Mo5DKnHG61m9VZUTt0KtplQbDp9mT2oOhJf8pk2mY mI9b7+tYh/NBSY
> erg0X5lxeBp7D7hHmfr25fbYP5++2r7jZ7oPKx9j42+X9vT4zZ +XH/2wVA1QaEBY
> XeswtEQ9wayzyzwuTAk85kijAy2xY0QYCMdVEH5G420D8gOx+p UCiZ7G4RUPby05
> /6fPXMunkkADlHSszhJNRJ+0vaTSwUUXKU41+lVY1ipMAXhNjAi b7IitDV9EBVwY
> corv0kheqG+p765InbCSR3l/IGl5ExyPNd93twp2k2F+xDqDl8ybY02A9ruyMHxD
> BrtCuGTMkY6pPzFijddbzC6vFhZKnfUlSXzaChUg8MrDGImWYb vZGX9n4ldQA3za
> o4EyJ1siqOwpwqZ8FPVMr3SHSz0Rc+YnTv96lyP2jgBfHoKz/uj9pMBzd+zqut7g
> C6pfYACDutg/NtPPDm09ZyRedjf8mV/LMPifw5/ZGbEmYlHD+8Adh1/dt0gcFVmC
> hBGBAsR1hnSHAmJTkLkS
> =esrX
> -----END PGP SIGNATURE-----
>


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: http://lists.debian.org/CAGWVfM=837eaExrp5NpxMDGs0o-jzLAc4JfsZF91Yn66MnGA5A@mail.gmail.com
 

Thread Tools




All times are GMT. The time now is 12:01 PM.

VBulletin, Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org