0

I want to create a LVM partition using the parted command. So far I did:

# set up the partition table
parted /dev/sda mklabel msdos

#/dev/sda1 (boot) :
parted /dev/sda mkpart primary ext2 1MiB 513MiB

#/dev/sda2 (LVM) :
parted /dev/sda mkpart extended 513MiB 100%

# set up partitions' flags
parted /dev/sda set 1 boot on
parted /dev/sda set 2 lvm on

But I get a "W95 Ext'd (LBA)" partition (type f), see fdisk -l output. I would like a "Linux LVM" partition (type 8e).

How can I force the partition ID using the parted command? .

1 Answer 1

1

The type on an extended partition MUST be 0F. You can't directly use the extended partition as an LVM PV. Instead, you need to make an extended partition, then make a logical partition inside the extended partition. The parted manual has an example of how to make a logical partition. (Note: logical partitions are not to be confused with logical volumes.)

Extended and logical partitions were created to hack around MS-DOS's limit of 4 partitions per disk, which is why this is so painful.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.