Prepare virtualization host: how to partition?

Machines are provided with 2x300 GB SAS hdd disks dedicated for the root system and 2x1.92GB SSD for the vms. I was looking for informations on how to partition the root and didn’t find a good answer. How do people? Is partionning them as a single / with an ext4 filesystem good? Is there any more efficient pattern for it? In the past I would have create a separate /var/log but i’m not sure now. On freebsd I would have just use zfs with different datasets … Any feedback is welcome.

Hi @benoitc, IMO, if this is a production machine, you should use Raid1 using 2x300GB SAS with just one ‘/’ partition enough. And use 2x1.92GB ssd for zfs mirror. I mean separate the host boot disk and the ssd ones. And add the apool storage to lxd.
Regards.

zfs create apool mirror </dev/ssd1> </dev/ssd2> 
1 Like

This is not a production machine, this is my homelab machine, but I use this kind of partitioning :

nvme0n1                               259:3    0 238.5G  0 disk
├─nvme0n1p1                           259:4    0     1G  0 part /boot/efi
├─nvme0n1p2                           259:5    0     1G  0 part /boot
└─nvme0n1p3                           259:6    0 236.4G  0 part
  ├─system-root                       253:0    0    20G  0 lvm  /
  ├─system-logs                       253:1    0    10G  0 lvm  /var/log
  ├─system-snap                       253:2    0    10G  0 lvm  /var/lib/snapd
  ├─system-snap--var                  253:3    0    10G  0 lvm  /var/snap
  └─system-swap                       253:4    0    16G  0 lvm  [SWAP]

All these LVM volumes are formatted using EXT4 (except the /boot/efi one ofc). I usually like to separate everything, I use this scheme mostly in virtual machines, but I applied it on my bare-metal machine too. Regarding ZFS, I agree with @cemzafer, a ZFS mirror on your SSD should be fine.

2 Likes