Discussion:
[linux-lvm] lvm with gpt partitioning?
Josh Duncan
2002-10-14 20:07:51 UTC
Permalink
Hi all,

I hope this isn't a redundant question, I've tried looking through the mailing
lists with no luck:

I'm having a problem setting up physical volumes on an ia64 machine running a
2.4.18+lvm1.0.5 kernel.

the disk is labelled using an "EFI GPT" disk label/partitioning arrangement. I
currently have two partitions defined, the first is 2gb and the second is 16gb.
I can do a pvcreate on the second, but not on the first. I've attached output
from parted, fdisk, and pvcreate below...

any ideas?
--Josh

------
fdisk:
------
[***@one sbin]# fdisk -l /dev/sdb

Disk /dev/sdb: 255 heads, 63 sectors, 4427 cylinders
Units = cylinders of 16065 * 512 bytes

Device Boot Start End Blocks Id System
/dev/sdb1 1 4428 35566479+ ee EFI GPT

-------
parted:
-------
[***@one sbin]# parted /dev/sdb print
Disk geometry for /dev/sdb: 0.000-34732.890 megabytes
Disk label type: GPT
Minor Start End Filesystem Name Flags
1 0.017 2047.000 lba
2 2047.000 18733.000 lba

---------
pvcreate:
---------
[***@one sbin]# pvcreate /dev/sdb1
pvcreate -- invalid partition type 0xee for "/dev/sdb1" (must be 0x8e)
Heinz J . Mauelshagen
2002-10-15 07:18:30 UTC
Permalink
Josh,

if a device holds a partition, LVM assumes PC style.

Can you remove the partition (dd if=/dev/zero of=/dev/sdb bs=1k count=1)
and use the whole device (pvcreate /dev/sdb) or go with PC style partitioning?

Regards,
Heinz -- The LVM Guy --
Post by Josh Duncan
Hi all,
I hope this isn't a redundant question, I've tried looking through the mailing
I'm having a problem setting up physical volumes on an ia64 machine running a
2.4.18+lvm1.0.5 kernel.
the disk is labelled using an "EFI GPT" disk label/partitioning arrangement. I
currently have two partitions defined, the first is 2gb and the second is 16gb.
I can do a pvcreate on the second, but not on the first. I've attached output
from parted, fdisk, and pvcreate below...
any ideas?
--Josh
------
------
Disk /dev/sdb: 255 heads, 63 sectors, 4427 cylinders
Units = cylinders of 16065 * 512 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 4428 35566479+ ee EFI GPT
-------
-------
Disk geometry for /dev/sdb: 0.000-34732.890 megabytes
Disk label type: GPT
Minor Start End Filesystem Name Flags
1 0.017 2047.000 lba
2 2047.000 18733.000 lba
---------
---------
pvcreate -- invalid partition type 0xee for "/dev/sdb1" (must be 0x8e)
_______________________________________________
linux-lvm mailing list
http://lists.sistina.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/
*** Software bugs are stupid.
Nevertheless it needs not so stupid people to solve them ***

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Heinz Mauelshagen Sistina Software Inc.
Senior Consultant/Developer Am Sonnenhang 11
56242 Marienrachdorf
Germany
***@Sistina.com +49 2626 141200
FAX 924446
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Josh Duncan
2002-10-15 15:43:26 UTC
Permalink
Hi Heinz,

I don't think I can remove the partition, because the EFI firmware needs the
first partition of the disk to be vfat to boot from that disk. That's not a
concern for this issue right now, but it will be when I want to have my / be an
LVM volume mirrored across sda/sdb.

--Josh
Post by Heinz J . Mauelshagen
Josh,
if a device holds a partition, LVM assumes PC style.
Can you remove the partition (dd if=/dev/zero of=/dev/sdb bs=1k count=1)
and use the whole device (pvcreate /dev/sdb) or go with PC style partitioning?
Regards,
Heinz -- The LVM Guy --
Post by Josh Duncan
Hi all,
I hope this isn't a redundant question, I've tried looking through the mailing
I'm having a problem setting up physical volumes on an ia64 machine running a
2.4.18+lvm1.0.5 kernel.
the disk is labelled using an "EFI GPT" disk label/partitioning arrangement. I
currently have two partitions defined, the first is 2gb and the second is 16gb.
I can do a pvcreate on the second, but not on the first. I've attached output
from parted, fdisk, and pvcreate below...
any ideas?
--Josh
------
------
Disk /dev/sdb: 255 heads, 63 sectors, 4427 cylinders
Units = cylinders of 16065 * 512 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 4428 35566479+ ee EFI GPT
-------
-------
Disk geometry for /dev/sdb: 0.000-34732.890 megabytes
Disk label type: GPT
Minor Start End Filesystem Name Flags
1 0.017 2047.000 lba
2 2047.000 18733.000 lba
---------
---------
pvcreate -- invalid partition type 0xee for "/dev/sdb1" (must be 0x8e)
_______________________________________________
linux-lvm mailing list
http://lists.sistina.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/
*** Software bugs are stupid.
Nevertheless it needs not so stupid people to solve them ***
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Heinz Mauelshagen Sistina Software Inc.
Senior Consultant/Developer Am Sonnenhang 11
56242 Marienrachdorf
Germany
FAX 924446
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
_______________________________________________
linux-lvm mailing list
http://lists.sistina.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/
Luca Berra
2002-10-15 07:34:48 UTC
Permalink
Post by Josh Duncan
Hi all,
the disk is labelled using an "EFI GPT" disk label/partitioning arrangement. I
currently have two partitions defined, the first is 2gb and the second is 16gb.
I can do a pvcreate on the second, but not on the first. I've attached output
from parted, fdisk, and pvcreate below...
looks like you have both a gpt partition and a compatibility dos-like
one. i am missing some info (partition detection logs at boot) output of
/proc/partition and lvmdiskscan. and i don't have an ia64 to play with
any more. might try modifiyng the partition detection code in the kernel
config

L.
--
Luca Berra -- ***@comedia.it
Communication Media & Services S.r.l.
/"\
\ / ASCII RIBBON CAMPAIGN
X AGAINST HTML MAIL
/ \
Josh Duncan
2002-10-15 15:27:24 UTC
Permalink
Hi Luca,

this may sound stupid, but if there is a dos-compatibility partition, why
doesn't it show up in fdisk or parted?

I've included the info you mentioned below, as well as the info for sda...
--Josh
Post by Luca Berra
looks like you have both a gpt partition and a compatibility dos-like
one. i am missing some info (partition detection logs at boot) output of
/proc/partition and lvmdiskscan. and i don't have an ia64 to play with
any more. might try modifiyng the partition detection code in the kernel
config
[***@one sbin]# dmesg|grep sd
Attached scsi disk sdb at scsi0, channel 0, id 1, lun 0
SCSI device sda: 71132960 512-byte hdwr sectors (36420 MB)
sda: sda1 sda2 sda3 sda4
Attached scsi disk sdb at scsi0, channel 0, id 1, lun 0
SCSI device sdb: 71132960 512-byte hdwr sectors (36420 MB)
sdb: sdb1 sdb2

/proc/partitions:
major minor #blocks name rio rmerge rsect ruse wio wmerge wsect wuse running use aveq
8 0 35566480 sda 22661 39173 355842 99578 84426 763195 6796456 1992657 0 508375 2093808
8 1 1024000 sda1 506 17244 17830 1303 14 26 40 3178 0 1183 4482
8 2 17086318 sda2 4662 463 39842 22586 1604 5020 53800 1135352 0 35906 1158022
8 3 15360000 sda3 17426 19290 293722 67802 82808 758149 6742616 854132 0 480061 923424
8 4 2096128 sda4 3 0 96 23 0 0 0 0 0 23 23
8 16 35566480 sdb 285 8353 17020 25452 11 201 424 114 0 25533 25566
8 17 2096111 sdb1 9 135 288 6 0 0 0 0 0 6 6
8 18 17086464 sdb2 25 165 380 12 7 137 288 35 0 47 47

[***@one sbin]# lvmdiskscan
lvmdiskscan -- reading all disks / partitions (this may take a while...)
lvmdiskscan -- /dev/sda1 [ 33.92 GB] Primary [0xEE]
lvmdiskscan -- /dev/sda2 [ 16.29 GB] free whole disk
lvmdiskscan -- /dev/sdb1 [ 33.92 GB] Primary [0xEE]
lvmdiskscan -- /dev/sdb2 [ 16.29 GB] USED LVM whole disk
lvmdiskscan -- 2 disks
lvmdiskscan -- 2 whole disks
lvmdiskscan -- 0 loop devices
lvmdiskscan -- 0 multiple devices
lvmdiskscan -- 0 network block devices
lvmdiskscan -- 6 partitions
lvmdiskscan -- 0 LVM physical volume partitions

[***@one sbin]# fdisk -l /dev/sda

Disk /dev/sda: 255 heads, 63 sectors, 4427 cylinders
Units = cylinders of 16065 * 512 bytes

Device Boot Start End Blocks Id System
/dev/sda1 1 4428 35566479+ ee EFI GPT

[***@one sbin]# parted /dev/sda print
Disk geometry for /dev/sda: 0.000-34732.890 megabytes
Disk label type: GPT
Minor Start End Filesystem Name Flags
1 0.017 1000.016 FAT boot, lba
2 1000.017 17685.874 ext3 lba
3 17685.875 32685.874 ext3 lba
4 32685.875 34732.874 linux-swap lba

[***@one sbin]# df -k
Filesystem 1k-blocks Used Available Use% Mounted on
/dev/sda3 15118728 3718600 10632128 26% /
/dev/sda1 1023728 10720 1013008 2% /boot/efi
/dev/sda2 16817896 5019860 10943724 32% /home
none 505568 0 505568 0% /dev/shm
Luca Berra
2002-10-16 07:39:23 UTC
Permalink
Post by Josh Duncan
Hi Luca,
this may sound stupid, but if there is a dos-compatibility partition, why
doesn't it show up in fdisk or parted?
in fdisk it does show:
/dev/sda1 1 4428 35566479+ ee EFI GPT
parted supports GPT labels and prefers those, so it shows correct
info...

i should have said MBR-compatibility partition, but i prefer referring
to DOS, just to show the idiocy of still having this kind of junk in
A.D. 2002.

kernel does also get GPT info, the problem as heinz pointed out in his
message is in LVM tools (i believe in pv_get_size_ll function), which
does not handle GPT paartitions at all.
[ note i believe we can try putting 0 in part.sys_ind for efi parts or
change pvcreate and every other place this info is used ]
but probably Heinz suggestion of zeroing the damned PC MBR is sound,
I believe the EFI firmware looks for an efi label not for a PC MBR to
find the blasted first vfat partition.

Anyway, if your final desired result is having everithing on lvm on md,
you probably ought to mirror the first vfat partition as well, or at
least copy it on the second device, to be able to boot in case of disk
failure.
so you will end up with
/dev/sda:
MBR PART
/dev/sda1 1 4428 35566479+ ee EFI GPT
GPT PART
1 0.017 1000.016 FAT boot, lba
2 1000.017 34732.874 LVM?? lba, raid

and same thing for sdb

this will fool LVM1, since you'll never try to use as PV the first
partirion.

Regards,
L.
Post by Josh Duncan
I've included the info you mentioned below, as well as the info for sda...
--Josh
Post by Luca Berra
looks like you have both a gpt partition and a compatibility dos-like
one. i am missing some info (partition detection logs at boot) output of
/proc/partition and lvmdiskscan. and i don't have an ia64 to play with
any more. might try modifiyng the partition detection code in the kernel
config
Attached scsi disk sdb at scsi0, channel 0, id 1, lun 0
SCSI device sda: 71132960 512-byte hdwr sectors (36420 MB)
sda: sda1 sda2 sda3 sda4
Attached scsi disk sdb at scsi0, channel 0, id 1, lun 0
SCSI device sdb: 71132960 512-byte hdwr sectors (36420 MB)
sdb: sdb1 sdb2
major minor #blocks name rio rmerge rsect ruse wio wmerge wsect wuse running use aveq
8 0 35566480 sda 22661 39173 355842 99578 84426 763195 6796456 1992657 0 508375 2093808
8 1 1024000 sda1 506 17244 17830 1303 14 26 40 3178 0 1183 4482
8 2 17086318 sda2 4662 463 39842 22586 1604 5020 53800 1135352 0 35906 1158022
8 3 15360000 sda3 17426 19290 293722 67802 82808 758149 6742616 854132 0 480061 923424
8 4 2096128 sda4 3 0 96 23 0 0 0 0 0 23 23
8 16 35566480 sdb 285 8353 17020 25452 11 201 424 114 0 25533 25566
8 17 2096111 sdb1 9 135 288 6 0 0 0 0 0 6 6
8 18 17086464 sdb2 25 165 380 12 7 137 288 35 0 47 47
lvmdiskscan -- reading all disks / partitions (this may take a while...)
lvmdiskscan -- /dev/sda1 [ 33.92 GB] Primary [0xEE]
lvmdiskscan -- /dev/sda2 [ 16.29 GB] free whole disk
lvmdiskscan -- /dev/sdb1 [ 33.92 GB] Primary [0xEE]
lvmdiskscan -- /dev/sdb2 [ 16.29 GB] USED LVM whole disk
lvmdiskscan -- 2 disks
lvmdiskscan -- 2 whole disks
lvmdiskscan -- 0 loop devices
lvmdiskscan -- 0 multiple devices
lvmdiskscan -- 0 network block devices
lvmdiskscan -- 6 partitions
lvmdiskscan -- 0 LVM physical volume partitions
Disk /dev/sda: 255 heads, 63 sectors, 4427 cylinders
Units = cylinders of 16065 * 512 bytes
Device Boot Start End Blocks Id System
/dev/sda1 1 4428 35566479+ ee EFI GPT
Disk geometry for /dev/sda: 0.000-34732.890 megabytes
Disk label type: GPT
Minor Start End Filesystem Name Flags
1 0.017 1000.016 FAT boot, lba
2 1000.017 17685.874 ext3 lba
3 17685.875 32685.874 ext3 lba
4 32685.875 34732.874 linux-swap lba
Filesystem 1k-blocks Used Available Use% Mounted on
/dev/sda3 15118728 3718600 10632128 26% /
/dev/sda1 1023728 10720 1013008 2% /boot/efi
/dev/sda2 16817896 5019860 10943724 32% /home
none 505568 0 505568 0% /dev/shm
_______________________________________________
linux-lvm mailing list
http://lists.sistina.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/
--
Luca Berra -- ***@comedia.it
Communication Media & Services S.r.l.
/"\
\ / ASCII RIBBON CAMPAIGN
X AGAINST HTML MAIL
/ \
Loading...