[PVE-User] Proxmox usb automount

Wolfgang Bumiller w.bumiller at proxmox.com
Thu Oct 4 10:19:05 CEST 2018


On Thu, Oct 04, 2018 at 10:05:18AM +0200, Thomas Lamprecht wrote:
> On 10/4/18 9:22 AM, lord_Niedzwiedz wrote:
> > root at hayneee:~# apt install pve5-usb-automount
> > Reading package lists... Done
> > Building dependency tree
> > Reading state information... Done
> > E: Unable to locate package pve5-usb-automount
> > 
> >> apt install pve5-usb-automount
> >>
> >>
> >>
> >>
> >> On Oct 3, 2018, at 05:16, lord_Niedzwiedz <sir_Misiek1 at o2.pl<mailto:sir_Misiek1 at o2.pl>> wrote:
> >>
> >>      Hi,
> >>
> >> Why i make easy add auto mount usb device to ProxMox.
> >>
> >> example:
> >> /dev/sde1    /media/sde1
> 
> normally this is done by an desktop environment, not often used for
> headless Proxmox VE setups.
> 
> You may want to take a look at udisks2[0][1], there some wikis[2]/tutorials
> showing it's usage.
> 
> Playing around with udev/automountfs could also be an option.
> 
> [0]: https://www.freedesktop.org/wiki/Software/udisks/
> [1]: https://packages.debian.org/en/stretch/udisks2
> [2]: https://wiki.archlinux.org/index.php/udisks

This covers the case where any usb stick will mounted to a
reasonably-named directory.

Other cases:
To have a specific stick (e.g. by label or uuid) mounted to a specific
location you can use a simple 'enabled' systemd.mount(5)[1] unit
using a What= option pointing to a corresponding path (eg. one in
/dev/disk/by-label or /dev/disk/by-uuid).

And if you make such a unit with a path in /dev/disk/by-path you can
have a fixed mapping of physical usb slots to paths in the file system.

Finally, to cause a mount-attempt upon accessing the target path, rather
than when it gets plugged in, an x-systemd.automount[2] entry in
/etc/fstab or systemd.automount(5)[2] unit can be used.

[1] https://www.freedesktop.org/software/systemd/man/systemd.mount.html
[2] https://www.freedesktop.org/software/systemd/man/systemd.automount.html




More information about the pve-user mailing list