LocalHake

Tutorial

Proxmox - Pass HDD to Container

Step-by-step guide for mounting a physical drive (SSD/HDD) to a Proxmox LXC container using the host configuration and mount points.

Hake HardwarePublished Updated ~3 minintermediate

This post contains paid links (affiliate) — how that works.


▶ Watch this build on YouTube
Contents

This guide covers how to mount or pass through a physical drive (SSD/HDD) to a Proxmox LXC container. You should have Proxmox installed and an LXC container already created.

Identify the Drive UUID

Open the Proxmox host shell and retrieve the disk UUID:

bash
lsblk -f

Find the drive you want to mount and copy its UUID. The UUID format looks like: 6a0be238-82ee-4c22-841c-f57cafb5bcfa

Create Mount Point on Host

Create the directory on the Proxmox host where the drive will be mounted:

bash
mkdir /media/[Your mount point]

For example:

bash
mkdir /media/postdata01

Configure FSTAB on Host

Edit the host's filesystem table to auto-mount the drive:

bash
nano /etc/fstab

Add the drive entry:

text
UUID=<UUID>  /media/<YOUR MOUNT POINT>   ext4   defaults,noatime,nofail 0 0

Save with Ctrl+X, Y, Enter. Then mount the drive:

bash
mount -av

Create Mount Point in Container

Start your container and create the mount point directory inside it:

bash
sudo mkdir /media/<YOUR MOUNT POINT>

For example:

bash
sudo mkdir /media/postdata

Note that the container mount point name doesn't need to match the host mount point name.

Once the directory is created, stop the container.

Modify Container Configuration

On the Proxmox host, edit the container's config file:

bash
nano /etc/pve/lxc/[YOUR CONTAINER ID].conf

Add this line at the bottom:

text
mp0: /media/<HOST Mount Point>,mp=/media/<CONTAINER Mount Point>

For example:

text
mp0: /media/postdata01,mp=/media/postdata

Save with Ctrl+X, Y, Enter.

Verify the Mount

Start the container and verify the drive is mounted:

bash
df -h

You should see your drive mounted at the container mount point. The drive mounts automatically when the container starts because it reads from the config file — no fstab entry is needed inside the container for this.

Additional Notes

Your container can still use its own /etc/fstab for other mounts (like Samba shares that need to auto-mount at startup). The pass-through drive is handled entirely by the LXC config, while fstab handles anything else you want to mount inside the container.

Gear used