Mounting USB Drives in ProxMox
Summary
This guide was built using syncbricks' video, linked below.
- Erase the disk
- Run lsblk to identify the device
- You can use
lsblk -o NAME,UUID,ID-LINK,LABEL,MODEL,PARTUUID,TYPE,PATH,MOUNTPOINTS | sed -n '1p;/disk\|part/p'
to get the information you need for each drive to get a more consistent method of ID^[grep works too, but sed can display the header]NAME
: for your own reference, shows parent drives and partitionsUUID
:/dev/disk/by-uuid
ID-LINK
:/dev/disk/by-id
(most helpful)LABEL
:/dev/disk/by-label
(likely unhelpful, probably should remove)MODEL
: for your own referencePARTUUID
:/dev/disk/by-partuuid
(only helpful with partitions)TYPE
: for sortingPATH
: for your own referenceMOUNTPOINTS
: for your own reference
- You can use
- Two methods to wipe the drive
sudo wipefs -a /dev/sdX
, with X being the drive's NAME- Warning: As Xepher notes, you're more likely to select the wrong disk with
/dev/sdX
, and the better alternative is to use/dev/disk/*
, which has a bunch of folders grouped by better identifiers for disks. While a disksdX
ID might change between reboots or systems, the parameters identified in/dev/disk/*
are not.
- Warning: As Xepher notes, you're more likely to select the wrong disk with
sudo wipefs -a /dev/disk/by-label/xyz
, withxyz
being the drive's ID-LINK- Don't forget that you can hit Tab once you've written most of the command for it to autofill what must remain.
- For example,
sudo wipefs -a /dev/disk/by-label/usb-G
+Tab would complete assudo wipefs -a /dev/disk/by-label/usb-Generic_STORAGE_DEVICE-0:0
if that was the only label that started withusb-G
- Run lsblk to identify the device
- Initialize Disk with GPT and create the partition
- Either through the GUI and Initialize with GPT or with
sgdisk -N 1 /dev/disk/by-label/xyz
- Either through the GUI and Initialize with GPT or with
- Format the partition
mkfs.ext4 /dev/disk/by-partuuid/123
with 123 being the PARTUUID- You will have to re-run the
lsblk
command from earlier, but you will use the PARTUUID in the next step
- You will have to re-run the
- Create mount directory and mount partition
- Create a mountpoint directory with
mkdir /mnt/dir-name-of-choice
(e.g.,/mnt/usb-drive
or/mnt/ext-backup
) - Use nano to append fstab to include the PARTUUID and mount point you created
nano /etc/fstab
/dev/disk/by-uuid/123 /mnt/dir-name-of-choice ext4 defaults
,[1] with 123 being the PARTUUID
- Run
systemctl daemon-reload && mount -a
to reload the system daemons and mount all file systems- As a reminder,
&&
allows you to run two commands sequentially in the same line.
- As a reminder,
- Confirm all is correct by running
lsblk
to see that it's mounted- Refreshing the GUI should also show that it's mounted.
- Create a mountpoint directory with
- Add to Datacenter through the GUI
- Navigate up a level from your host system to the Datacenter view, go to Storage, and select the "Add" dropdown menu, and choose "Directory"
- Fill in the information requested:
- ID: any name you want
- Directory: the mountpath you configured earlier (`/mnt/dir-name-of-choice)
- Content: Select everything to make sure you can use the drive however you would like.
- The drive should now appear under the host, and allow you to store any information you want there.
Metadata
Sources
Proxmox USB Storage Tutorial - How to mount USB disks in Proxmox VE - YouTube