[pve-devel] [PATCH container] Fix restore with multiple mountpoints

Wolfgang Bumiller w.bumiller at proxmox.com
Tue Oct 10 11:20:03 CEST 2017

On Mon, Oct 09, 2017 at 02:34:04PM +0200, Tom Weber wrote:
> Anyone care about this?
> I have two cases of containers were i have to manually fix after a
> restore.
>   Tom
> Am Dienstag, den 26.09.2017, 15:29 +0200 schrieb Tom Weber:
> > If you use mountpoints inside a container, and change ownership of
> > these, a restore of the CT will reset them to root:root again.
> > 
> > That's because the whole CT FS gets prepared and mounted together
> > with
> > (of course) an owner of root:root for the mp.
> > As tar uses the option --skip-old-files it won't touch these dirs
> > then.
> > 
> > I don't see why one would need --skip-old-files for a restore job (or
> > did I miss something?)

It's a detail which we can probably use a better solution for: backups
contain the configuration in /etc/pve/pct.conf (changing this would
break backward compatibility), but some older versions did not remove
the file, as well as include one from the container itself if it had one
(iow. the tar file contained the file twice), and we need to only
extract the first one.
Running the tar command twice is problematic because it would prevent
restoring over a pipe from stdin (and older backups also did not order
our file at the front, doubling potentially long extraction times).

More information about the pve-devel mailing list