LXC restore operation should leave additional disks that are not included in backup untouched (IMHO)

Chentoa

Well-Known Member
Feb 14, 2018
32
1
48
46
I think the way LXC backup/restore works toward additional mounted disks can be misleading and dangerous (I recently lost some data, fortunately not important).

Let's say I have a container with an additional disk (mp0, "Backup" checkbox left unchecked, so the disk is NOT included in backups).

Backup the container : mp0 disk is NOT included, so far so good

Restore the container : mp0 disk gets deleted (another one, blank, is created). So, all data on the initial mp0 disk are lost !

IMHO an LXC restore operation should leave additional disks that are not included in backup untouched
 
the GUI explicitly tells you it will "permanently erase current data" when restoring into an existing container. keeping the old content around does not make much sense in most cases (if you don't want it backed up, it's either for temporary data, or backed up using another mechanism). if you really need this, you can use a bind mount instead of the regular mount point (the contents of bind mounts are not touched when restoring)
 
Well, in some cases it does make sense to keep old data around : I have a mail server inside an LXC container, with a dedicated disk for the data (mail repository), which I didn't include to the proxmox backups (voluntarily, I wanted to keep the system backups separated from the data backups) . I wanted to restore an old configuration, and I thought that since the data disk wasn't included in the backup, it would be left untouched, so I was surprised to find out that the data disk has been overwritten with an empty disk (and all the emails gone...fortunately we had a failover server...)

but yes, it's probably not the most frequent use case, and it isn't a problem as long as the admin is aware of what's going to happen... maybe improve the GUI message, something like "permanently erase current data, including disks not included in the backup"

and, thanks for the binded mount tip, that should indeed do the trick
 

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!