Create LVM Volume on Blockdevice

Holger Parplies wfai at parplies.de
Wed Jul 15 14:49:18 CEST 2015


Hi,

Kerim Gueney wrote on 2015-07-09 17:10:25 +0200 [Re: Create LVM Volume on Blockdevice]:
> [...]
> >Here is the main question, is it possible to create a pv directly on a
> >block device without having a partition?
> I am not entirely sure but I think that's possible, yes. I just ran 
> pvcreate /dev/sda in a test environment and created a VG and LV on top 
> of it just fine.

yes, manually, it definitely is possible.

> [...]
> it appears that everything you want is possible but setup-storage 
> doesn't support it, yet. I'll try and implement a solution for your 
> usecase in the upcoming days.

I don't use setup-storage, but from what I've read on the list recently, one
idea does spring to mind:

Stefan Schörghofer wrote on 2015-07-07 15:18:35 +0200 [Create LVM Volume on Blockdevice]:
> [...]
> My current Diskconfig looks like this:
> --------------------------------------------------
> # DATAVG
> disk_config sdb disklabel:msdos
> 
> disk_config lvm
> vg datavg sdb
> datavg-datalv /data 8G xfs rw
> --------------------------------------------------

What happens if you leave out the "disklabel" part? My guess - from what I've
read rather than actual experience - is that setup-storage would not create a
partition table, and consequently pvcreate (or the kernel?) would not complain
when trying to prepare /dev/sdb for LVM. In any case, the "disklabel:msdos" is
wrong, strictly speaking, because you don't want an msdos partition table on
/dev/sdb - you want an LVM PV there.

Hope that helps.

Regards,
Holger


More information about the linux-fai mailing list