Is the fdisk partition type important when using lvm

I have inherited a few LVM volumes and I noticed that fdisk reports the disks that make up the volume group as partition type 83 (Linux) and not 8e (Linux LVM). Is this a problem and how important are the fdisk partion types? Do they affect anything or are they just labels for convenience sake? Thanks for your help.


Solution 1:

LVM does not look at the partition table at all - it doesn't even knows it actually exist. So you can set whatever "partition type" value you want there and it won't change anything as far as LVM is concerned.

LVM uses regular expressions in its config file to know what block devices to check for physical volumes, see the filter keyword in lvm.conf(5).

Some other tools do look at partition types, the linux kernel itself being the first example:

  • partition type 0x05, "Extended", tells the kernel to go look for an Extended Boot Record in the given partition, to find so called "logical partitions"
  • partition type 0xfd, "Linux RAID", tells the md driver in the kernel to try to autostart that raid volume, if it finds a suitable superblock in the given partition

Solution 2:

The partition type is not important for lvm, md or mount. All of them are checking for signatures and internal structures to determine if they can use the device. Only user friendly partitioning programs might get confused. You can safely change the partition type if you want to be correct.

I think it is better not to use MS-DOS disk-label (partition table) at all if the disk is the 2nd disk in the system and you intend to use LVM. You can use LVM disk-label directly on the disk. For x86 and x64 architecture you need to use MS-DOS partitions (or GPT for UEFI systems) for boot disk, but the rest can have the LVM disk-label directly on the unpatitioned disk.