Can "local" (/var/lib/vz) storage be moved/mounted to a different disk?

mircolino

New Member
Feb 9, 2023
25
8
3
I installed PVE on a single node PC with two SSDs (a smaller NVMe and a larger SATA).
I would like to have PVE itself, "Disk Image" and "Container" on the main faster SSD. And "VZDump backup", "ISO image" and "Container template" on the secondary, slower but larger SSD.
I could simply create another "directory" storage on the second SSD, and stop using "local". But before I do that, is there a simple way to move/mount "local" (/var/lib/vz) to another disk? I tried deleting it but the GUI won't let me.
 
  • Like
Reactions: LEI
To answer my own question, I wanted to change as little as possible of the pve configuration, so I ended up doing the following:

From the PVE GUI:

- To initialize the disk, I created a new "directory", with the storage checkbox selected, using the secondary disk (/dev/sda1)
- Then I deleted the newly created "directory" and the associated storage configuration but without wiping the disk

From the PVE Shell:

root@pve:~# blkid

/dev/sda1: UUID="<DEV_UUID>" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="<PART_UUID>"

root@pve:~# nano /etc/fstab

UUID="<DEV_UUID>" /var/lib/vz ext4 defaults 0 0

root@pve:~# rm -rf /var/lib/vz/*
root@pve:~# mount -a

This seems to be working well so far and allows me to have pve, vms and containers on one disk, and backups, isos, templates on the other disk.

Any reason why I shouldn't do this? Any other better/simpler way?
 
Last edited:
I believe this is what the pvesm command is for. Perhaps someone more knowledgable can fill in the details.
 
  • Like
Reactions: trentmu

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!