Reverting Thin-LVM to “old” Behavior of /var/lib/vz (Proxmox 4.2 and later)

Reverting Thin-LVM to “old” Behavior of /var/lib/vz (Proxmox 4.2 and later)

If you installed Proxmox 4.2 (or later), you see yourself confronted with a changed layout of your data. There is no mounted /var/lib/vz LVM volume anymore, instead you find a thin-provisioned volume. This is technically the right choice, but one sometimes want to get the old behavior back, which is described here. This section describes the steps to revert to the “old” layout on a freshly installed Proxmox 4.2:

  • After the Installation your storage configuration in /etc/pve/storage.cfg will look like this:
dir: local
        path /var/lib/vz
        content iso,vztmpl,backup

lvmthin: local-lvm
        thinpool data
        vgname pve
        content rootdir,images
  • You can delete the thin-volume via GUI or manually and have to set the local directory to store images and container aswell. You should have such a config in the end:
dir: local
        path /var/lib/vz
        maxfiles 0
        content backup,iso,vztmpl,rootdir,images
  • Now you need to recreate /var/lib/vz
root@pve-42 ~ > lvs
  LV   VG   Attr       LSize  Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  data pve  twi-a-tz-- 16.38g             0.00   0.49
  root pve  -wi-ao----  7.75g
  swap pve  -wi-ao----  3.88g

root@pve-42 ~ > lvremove pve/data
Do you really want to remove active logical volume data? [y/n]: y
  Logical volume "data" successfully removed

root@pve-42 ~ > lvcreate --name data -l +100%FREE pve
  Logical volume "data" created.

root@pve-42 ~ > mkfs.ext4 /dev/pve/data
mke2fs 1.42.12 (29-Aug-2014)
Discarding device blocks: done
Creating filesystem with 5307392 4k blocks and 1327104 inodes
Filesystem UUID: 310d346a-de4e-48ae-83d0-4119088af2e3
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
        4096000

Allocating group tables: done
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done
  • Then add the new volume in your /etc/fstab:
/dev/pve/data /var/lib/vz ext4 defaults 0 1
  • Restart to check if everything survives a reboot.

You should end up with a working “old-style” configuration where you “see” your files as it was before Proxmox 4.2

About the author

norbertk administrator