So you have a USB drive that you want to mount to a specific container.
In my case, I want to mount a 10TB USB hard drive (a Seagate Expansion) where I store my media for radarr, sonnar and jellyfin.
Let's get started!
Permanently mount your USB drive
There are several steps you need to follow for a USB device to be permanently mounted to Proxmox. This is, to have it mounted even if the node restarts.
Find the USB device by going to your node -> Disks
In my case it's easily identifiable, as I can see a USB device with 10TB of space: /dev/sdb2
Edit the /etc/fstab
file
You can use nano
or your favorite editor and add the following line to the end of the file:
<file system> <mount point> <type> <options> <dump> <pass>
In my case:
/dev/sdb2 /mnt/expansion xfs defaults,noatime,nofail 0 2
This means that I'm:
- Mounting the device in
/dev/sdb2
- Mounting it to the route
/mnt/expansion
in my Proxmox host - Mounting it as an
xfs
file system - With the options
-
defaults
(enables several standard mount options) -
noatime
(disables updating of file access times on the filesystem) -
nofail
(tells the system to continue booting even if this device cannot be mounted)
-
- Dump
0
means the filesystem will not be backed up by the dump utility - File system check
2
indicates this filesystem should be checked after the root filesystem
Note: I previously formatted my external drive as
xfs
before plugging it in to make my life easier since that format is directly compatible with my Proxmox host.
Mount it!
You can either reboot your system or run mount -a
to finish mounting your device.
Passing the device to the container
Start by editing the configuration file for your container. Identify your container ID and run:
nano /etc/pve/lxc/<continer id>.conf
Add this line to the end of the file:
<Mount point id> <Host path>,mp=<container path>
In my case I have:
mp0: /mnt/expansion,mp=/home/media
mp1: /mnt/downloads,mp=/home/downloads
As you can see the mount points are sequential, so be mindful of the id you're choosing if you already have other mount points in your container
Restart your container and you're good to go!
Verify mount points
If you now go to your container resources in the Proxmox GUI you should see your mountpoints being specified there:
Top comments (0)