Linux – Create Logical Volume with non-LVM partition

fdisklinuxlvmpartition

I have seen everywhere it is mentioned to create a partition of type LVM (8e) and then create logical volume with lvcreate.

My question is, what if I create logical volume using lvcreate with non-LVM (83 Linux) disks/parition? I have actually created one so it is possible without changing it to LVM (8e) but I wonder what's the disadvantage of doing this? Is there anything/feature I won't be able to do using this way?

Thank you, I hope the question makes sense.

Edit: Just to demonstrate my point with an example:

# fdisk -l /dev/sdb
   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1         132     1060258+  82  Linux swap / Solaris
/dev/sdb2             133         394     2104515   83  Linux
/dev/sdb3             395         656     2104515   83  Linux
/dev/sdb4             657        1044     3116610   83  Linux

Note all sdb[234] are type 83

[root@localhost ~]# pvs
  PV         VG          Fmt  Attr PSize PFree 
  /dev/sdb2  vol_group01 lvm2 a--  2.00g 52.00m
  /dev/sdb3  vol_group01 lvm2 a--  2.00g  2.00g
  /dev/sdb4  vol_group01 lvm2 a--  2.97g  2.97g




[root@localhost ~]# vgdisplay -v  vol_group01
    Using volume group(s) on command line
    Finding volume group "vol_group01"
  --- Volume group ---
  VG Name               vol_group01
  System ID             
  Format                lvm2
  Metadata Areas        3
  Metadata Sequence No  5
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                1
  Open LV               0
  Max PV                0
  Cur PV                3
  Act PV                3
  VG Size               6.98 GiB
  PE Size               4.00 MiB
  Total PE              1786
  Alloc PE / Size       500 / 1.95 GiB
  Free  PE / Size       1286 / 5.02 GiB
  VG UUID               3lw7zo-rIb1-Px1v-qn5Q-FErx-eFAp-QvTosm

  --- Logical volume ---
  LV Path                /dev/vol_group01/Log_Vol01
  LV Name                Log_Vol01
  VG Name                vol_group01
  LV UUID                Z6FMzG-WHFS-Z8iQ-gnps-DqkM-oJtc-kPupmq
  LV Write Access        read/write
  LV Creation host, time localhost.localdomain, 2013-01-19 21:13:58 +0000
  LV Status              available
  # open                 0
  LV Size                1.95 GiB
  Current LE             500
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:2

  --- Physical volumes ---
  PV Name               /dev/sdb2     
  PV UUID               5IFORy-K475-xgYl-w7wL-ILA8-B4Ib-e6RobL
  PV Status             allocatable
  Total PE / Free PE    513 / 13

  PV Name               /dev/sdb3     
  PV UUID               v4wc0X-16P2-x1cY-A9Pu-Dl3W-Us1N-A26EBp
  PV Status             allocatable
  Total PE / Free PE    513 / 513

  PV Name               /dev/sdb4     
  PV UUID               L4uHEc-0Fnt-BLIa-9T5v-0IxP-o8PX-diQx5N
  PV Status             allocatable
  Total PE / Free PE    760 / 760

Best Answer

See this SF question/answer: https://serverfault.com/questions/306419/is-the-fdisk-partition-type-important-when-using-lvm

Excerpt of answer from above question

LVM does not look at the partition table at all - it doesn't even know 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

Good resource for LVM related questions: http://ds9a.nl/lvm-howto/HOWTO//cvs/lvm-howto/lvm-howto.html

Related Question