X
X
x4IPx2018-09-12 15:30:00
linux
x4IPx, 2018-09-12 15:30:00

How to prevent vzdump from backing up to an unmounted directory?

Hello!
I implement in PROXMOX(Debian) recording VM backups to an external HDD.
Created a directory:
mkdir /media/archive

in /etc/fstab prescribed to mount the disk at boot:
UUID="666D-4D98" /media/archive exfat defaults,uid=1000 0 0

The problem is that if you pull out the external HDD or let it out of order, then vzdump will start writing to the system disk directory, and this can lead to other unfortunate consequences.
How to make sure that if the disk is missing for some reason, then the backup is not carried out (For example, there was a directory missing error)
Thanks in advance for your help!

Answer the question

In order to leave comments, you need to log in

3 answer(s)
M
mikes, 2018-09-12
@mikes

If a backup is made using proxmox, and it is instructed to backup to the /media/archive folder, then from the point of view of the script, what difference does it make whether the thread is mounted there or not. the path exists.
Ways out of this situation:
a) stop fencing crutches with removable disks and taking them out and inserting them back, and so on. (if you have grown to virtualization, then get a separate nas / computer for backups)
b) modify proxmox (the script that makes the backup) by checking whether the disk is mounted or not.

A
AVKor, 2018-09-12
@AVKor

Check before use (simplest shell script) whether it is mounted or not. If yes, make a backup. If not, don't do it.

P
Puma Thailand, 2018-09-12
@opium

Add a directory check to the backup call script

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question