to...@tuxteam.de wrote: > On Sat, Nov 04, 2023 at 01:20:08PM -0400, gene heskett wrote: > > [...] > > > Indeed it does clarify the mechanics. thank you. Now do I have to > > zero them first before I can then create (pvcreate) them, > > Not necessarily. Unless, of course, there are sensitive data on them. > > The process would go roughly:
I agree with what Tomas has said, but I would add a step before creating the PVs. # partition your devices I usually put a small partition at the start of the disk and another small one at the end (these are protection against some kind of errors that can occur - you just leave them blank) and then create a single large partition using the rest of the space on the device for use by LVM. There doesn't seem much point in having more than one LVM partition on a device to me (as suggested below)? > # put the necessary PV metadata on your raw devices > pvcreate /dev/foo1 /dev/foo2 ... > > # make them to a volume group named my-volgroup > vgcreate my-volgroup /dev/foo1 /dev/foo2 ... > > # cut out a logical volume from that, named my-logvol > lvcreate --name my-logvol my-volgroup > > # put a file system on that logical volume > mkfs.ext4 /dev/mapper/my-logvol > > # mount it > mount /dev/mapper/my-logvol /home > > Now convince your boot setup to add the logical vols > and mount them (this somehow involves fstab). > > Perhaps this [1] page is enlightening (just disregard the > talk about vagrant(. I'm not yet quite sure you really > want this, but hey. Learning new tricks is what keeps one > happy. > > In my case I actually have a volume group (spanning a single > physical device), but the use case is different: the physical > device is encrypted (laptops get lost) and I wanted to have > several partitions on it (and still move space from the one > to the other in a pinch). > > Cheers & enjoy > > [1] https://linuxhandbook.com/lvm-guide/