Connect a USB Drive to Your Cloud

![[head.png]]

USB passthrough is a technology enabling a USB device connected to a physical machine to be shared on a virtual machine hosted on it's cloud system. This capability is especially useful in scenarios like data backups and transferring large files between virtual machines.

In environments built on Proxmox, you can connect a USB drive directly to the Proxmox hardware and share it with a virtual container (CT).

Steps to Connect and Share a USB Drive in Proxmox

Prepare the USB Drive

Attach the USB drive to your Proxmox server and prepare it using standard Linux commands:

$ lsblk 
$ fdisk /dev/sdb # choose 'n' for new partition, then follow default prompts, and 'w' to write changes
$ mkfs.ext4 /dev/sdb1 # format the new partition

Mount the USB Drive on Proxmox Node: Create a directory to mount the USB drive and then mount it:

$ mkdir /mnt/usb
$ mount /dev/sdb1 /mnt/usb

Share the Drive with a Container: Share the mounted USB drive with your container. First, identify a free mount point in your container's resource panel. Then, share the drive:

pct set 101 -mp1 /mnt/usb,mp=/shared_usb

![[Pasted image 20240106144256.png]]

After setting up the mount point, restart your container. You'll then have access to the USB drive from the /shared_usb directory within the container.

Caveats

For more detailed information, refer to Proxmox's official documentation on Linux Container Bind Mount Points.