[TUTORIAL] USB Automount

Hi everyone!
I am browsing the Proxmox forum since months, but now its time for my first post ;)

PVE 8

Don't bother with automount, while it would be nice, PVE8 is much better with USB disks.

1. Plug in your USB device
2. In the Proxmox GUI look under the node you plugged into, "disks" section. Note the USB disk/partition if any (ie /dev/sdc1)
3. Make a temporary mount point (ie /mnt/usb)
4. Go to a shell and mount the usb drive (ie mount /dev/sdc1 /mnt/usb)
5. If you like, go to Datacenter, Storage and add your mount point as "directory" storage.

I'm making a lot of assumptions on what one might want to do. I used automount on my PVE7 systems for easy transfer of VMs between nodes that were either not clustered or not on the same network. I came back looking for a PVE8 update since I needed to grab a very old backup I just happened to have on USB. The above worked fine for that.

As a side note, we have been using Proxmox backup server for a while now and most of what we ever did with USB we do now on the backup server. Easy to setup, does not need a lot of CPU or RAM, just storage. You add it as a storage device to your PVE server(s) and it is great for scheduled or manual backups or simple VM moves on non clustered nodes.

While this is true, and I subscribe to it, still, it would be much easier/comfortable to have some better automation for it. There are not many use cases, but hey, in the case you need it, it is annoying to execute the same commands again and again.
Sometimes you need offline backups, or you just don't have the "luxury" of a second host for the pve backup server, or your private network is not as good/fast as a usb3.0 connection. I know, a no-go for enterprise use, but for home labs, this is not uncommon.

That's why I created some rules and a service with a bash script that work on PVE 8 / Debian 12. To be honest, I did not analyze the exact procedure how this was done for pve7, maybe similar to this. Because of some deprecated dependencies in pve I also slightly modified those services, to avoid broken boot-ups already discussed somewhere else in the forum.
It was tested on PVEs with lvm storage. I can't guarantee that this will work with ZFS storages, but there is a good chance that it will. Feedback is welcome. Maybe a new topic should be opened for this. You find further infos the Readme on Github:
Github: Automount for Proxmox 8

Important to note: You still need to do the 5. step (mentioned by @Mulvak) manually, but you do this once, and the next time you plug in the same storage, it will be already available in the Web. GUI.

I like the idea of open source and I am thankful for PVE, that's why I wanted to contribute to the community with my input.
 
Last edited:

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!