Mounting USB Drive for backups

bearhntr

Member
Sep 9, 2022
167
13
23
Atlanta, GA USA
Is there any way (steps or documents) to set PVE to mount an external HDD (I am running PVE 8.1.3 latest updates installed this AM), and have it auto-mount and allow me to make backups to it? I have an SSD which I did manually mount and make a couple backups, but if I unplug it and re-plug it (especially if I have rebooted the host after updates are done) - the drive mounting process has to be re-done.
 
I have a USB SSD I use for backup. Probably a similar setup to what you want. I formatted it ext4 and gave it a label of
"backup". In /etc/fstab I added the line:

Code:
LABEL=backup            /mnt/backup     ext4    noauto,x-systemd.automount      0 2

I think you may need to do "mount -a" here? Don't remember. Also, there are other ways to do this besides with disk labels, UUID for example. Then I created a backup storage in PVE using this mount point. I named mine "backup". Make sure to mark it as a mount point. The USB drive will be auto-mounted when PVE does its disk checks, takes a minute or so. To swap the disk I do this:

Code:
# pvesm set backup -disable 1
# umount /mnt/backup
--- switch disk ---
#pvesm set backup -disable 0

That's pretty much it.

ETA: I actually have two of these SSD's and rotate them on a monthly basis with one going off-site.
 
Last edited:
I did some googling before I posted here, and there apparently used to be a 'tool' for PVE 7x which allowed and set all this up (see below). I tried to follow the same steps on PVE 8.1.3 and it fails {see image}

[TUTORIAL] USB Automount

1702478714802.png

I only have one HDD that I want to use for this - it is an External Seagate 1TB HDD. I used to use it to make backups for the stand-alone Server 2016 box, as I could plug it in - run the backup, and disconnect it and store it (monthly).

I have seen another article on Google - which mentions UUID, I will have to see if I saved that link.
 
My method uses systemd automount, which is already installed by default, instead of that package. You can just leave the storage in the disabled state when you aren't using it. You can enable/disable from the GUI as well as on the command line.

To use a UUID, replace "LABEL=" with "UUID=" in /etc/fstab. To find the UUID of a disk use:
lsblk -o +UUID
as root.
 
  • Like
Reactions: roxy
My method uses systemd automount, which is already installed by default, instead of that package. You can just leave the storage in the disabled state when you aren't using it. You can enable/disable from the GUI as well as on the command line.

To use a UUID, replace "LABEL=" with "UUID=" in /etc/fstab. To find the UUID of a disk use:
lsblk -o +UUID
as root.
Thanks --- I will try this later today and advise how I fare.
 
I have the exact same intention like you, but I don't think this works for more than one drive as the UUIDs are different (am I wrong?)
And the mounting has to be done manually, so my intention to just unplug a USB drive and plug another one, day by day, won't work.
 

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!