[SOLVED] LXC container not cloning when mp mounts present

kyriazis

Well-Known Member
Oct 28, 2019
98
6
48
Austin, TX
Hello,

I am trying to clone a container that has a mp0 mount point, but I'm getting an error "unable to clone mount point 'mp0' (type bind) (500)".

Of course I can remove the mount, clone, and then re-add it, but it gets cumbersome after a while.

Any particular reason why it is not allowed to clone the mounpoint to the new container? Is that going to be fixed in the (near) future?

Running PVE 6.4-5.

Thank you!

george
 
hi,

but I'm getting an error "unable to clone mount point 'mp0' (type bind) (500)".
that error message means your mountpoint is a bind mount. [0]

since a bindmount exposes an arbitrary directory from your host, if we included those when cloning a container, it would clone also those files that are mounted -- every time. so if you had a big NFS share mounted from your host, all those files would be needlessly copied and it could take a lot of time

[0]: https://pve.proxmox.com/wiki/Linux_Container#_bind_mount_points
 
Bind mounts, however, are not backed up, which seems like an inconsistency to me. Why they would behave one way during a backup and a different way during a clone?

Is there a way to create a mount point in such a way that a CT clone will clone the mount point and not the contents?

Thank you!

George
 
Bind mounts, however, are not backed up, which seems like an inconsistency to me. Why they would behave one way during a backup and a different way during a clone?
they're not included in neither backups nor clones.
if i make a backup of the container with bindmount i'll get:
Code:
INFO: starting new backup job: vzdump 103
INFO: filesystem type on dumpdir is 'zfs' -using /var/tmp/vzdumptmp939380_103 for temporary files
INFO: Starting Backup of VM 103 (lxc)
INFO: Backup started at 2021-06-09 16:12:18
INFO: status = running
INFO: CT Name: deb
INFO: including mount point rootfs ('/') in backup
INFO: excluding bind mount point mp0 ('/test') from backup (not a volume)
...
INFO: backup mode: snapshot
INFO: ionice priority: 7
INFO: create storage snapshot 'vzdump'
INFO: creating vzdump archive '/var/lib/vz/dump/vzdump-lxc-103-2021_06_09-16_16_15.tar'
INFO: Total bytes written: 822118400 (785MiB, 128MiB/s)
INFO: archive file size: 784MB
INFO: removing backup 'local:backup/vzdump-lxc-103-2020_07_07-16_41_35.tar'
INFO: cleanup temporary 'vzdump' snapshot
INFO: Finished Backup of VM 103 (00:00:08)
INFO: Backup finished at 2021-06-09 16:16:23
INFO: Backup job finished successfully

see the line that mentions it was excluded.

Is there a way to create a mount point in such a way that a CT clone will clone the mount point and not the contents?
you mean you still want to keep the mp0 line in your configuration or?

if you do a backup/restore instead of clone, then this line will be kept in the configuration

Code:
$ pct restore 10104 /var/lib/vz/dump/vzdump-lxc-103-2021_06_09-16_16_15.tar
...
restoring '/var/lib/vz/dump/vzdump-lxc-103-2021_06_09-16_16_15.tar' now..
extracting archive '/var/lib/vz/dump/vzdump-lxc-103-2021_06_09-16_16_15.tar'
Total bytes read: 822118400 (785MiB, 241MiB/s)
Detected container architecture: amd64
merging backed-up and given configuration..

$ pct config 10104
arch: amd64
cores: 1
hostname: deb
memory: 512
mp0: /home/oguz/test,mp=/test,size=0T
nameserver: 1.1.1.1 8.8.8.8
net0: name=eth0,bridge=vmbr0,firewall=1,hwaddr=2E:37:D8:89:F1:AB,ip=dhcp,type=veth
ostype: debian
rootfs: local:10104/vm-10104-disk-0.raw,size=8G
swap: 512
unprivileged: 1
and you can see the mp0 line in the config of the new container.

hope this helps!
 
Last edited: