Restore backup from PBS but exclude manually added mount point from pct.config

Mar 8, 2022
50
9
13
39
I am trying to restore a backup that is roughly 10GB in size however in the pct.config I manually referenced a mount point that was very large (excluded from backup). I cannot restore this backup via the GUI because it also wants to recreate the manually added mountpoint and I don't have sufficient space to restore it.

When restoring the backup I want to exclude mp0. Is it possible for me to do this via cli or can I go into my ProxMox Backup Server and edit the config file there to comment out the mp0 line so it is ignored when restoring the backup?

Code:
arch: amd64
cores: 2
features: nesting=1
hostname: storj
memory: 4096
mp0: ahsnap:vm-109-disk-0,mp=/data/storj,size=16484G
net0: name=eth0,bridge=vmbr0,hwaddr=96:44:F4:81:19:1F,ip=dhcp,type=veth
onboot: 1
ostype: debian
rootfs: local-lvm:vm-109-disk-0,size=23G
swap: 512
tags: storj
lxc.cgroup2.devices.allow: a
lxc.cap.drop:
 
Last edited:
As far as I understand, this should be possible from the CLI with `pct restore`.

For LXC containers, if you explicitly specify `--rootfs` during `pct restore`, it uses the advanced restore mode. In that mode, the `rootfs` and `mpX` mount point settings from the backup config are ignored, and only the mount points specified on the command line are used.

So if you do not want `mp0` to be recreated, restore the container with only `--rootfs` specified, and do not specify `--mp0`.

For example:

pct restore <new-CTID> <backup> --rootfs local-lvm:23

Please adjust the storage and size to your environment.

I would strongly recommend restoring to a new CTID first instead of overwriting the existing container directly, especially because there is a large existing mount point involved.

After the restore, you can add the existing mount point again manually, for example:

pct set <new-CTID> -mp0 ahsnap:vm-109-disk-0,mp=/data/storj,backup=0

Editing the backup data directly on Proxmox Backup Server is not something I would recommend, as it may lead to unexpected issues. I would use the supported `pct restore` options instead.

Before running this on important data, please verify the behavior with `man pct` or the official documentation.