I would like to install Debian 9.8 (i.e. an older version) on a VM with two disks. The first disk /dev/sda is for the boot partition, the second disk /dev/sdb should contain an LVM physical volume (PV; with subsequent VG and LVs) for the "rest" of the OS.

I want the PV to sit directly on the disk without any partition layer in between. On the command line I would issue pvcreate /dev/sdb, but the Debian Installer apparently insists on partitions (like /dev/sdb1) at corresponding points. I've also tried executing a shell before the installer's "Partition disks" step, but this does not give access to pvcreate (nor dpkg) so I am stuck again.

My question is this: Does the Debian installer (for Debian 9.8) allow configururation of a PV that comprises an entire disk (not just a partition) or is there a reasonably simple workaround that may e.g. involve issuing commands in an intermediate shell?

  • 1
    With no partition table, the disk will always look unformatted, which may confuse some tools. Is there a reason why you want to do this? – stark Jan 10 '20 at 14:01
  • @stark I'll like to replicate a legacy system in order to evaluate/test upgrade options. It uses the described configuration, so I'd like to keep also this aspect if feasible/reasonable. It's not too big a deal though. – rookie099 Jan 10 '20 at 15:02
  • Have you tried creating the VG and LVs from the command line? – Emmanuel Rosa Jan 11 '20 at 15:11
  • @EmmanuelRosa Yes, see sentence about executing a shell. – rookie099 Jan 13 '20 at 8:31

The installer package containing LVM commands, lvm-udeb, is installed during the initialization of the partitioning step. So proceed with the installation until you get to the "Partition disks" menu, then "Go Back" and start a shell. There you can issue

# pvcreate /dev/sdb
# vgcreate OS /dev/sdb
# lvcreate -n home -L 1g OS

and so on as appropriate, then exit the shell. If you restart the partitioner, the newly created logical volumes will show up in the menu and you can set them up.

  • Thx, works beautifully. – rookie099 Jan 13 '20 at 8:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.