Bind mount an exFAT USB Hard Drive to an unprivileged LXC Arch Linux container

blakyris

New Member
Feb 16, 2024
2
1
3
Hi, I'm trying to bind mount an exFAT 5 To Western Digital Essentials Drive which i previously use for my Mac and Windows PC so I have a lot of data on it.
I just noticed that the new Western Digital HDDs are soldered to the USB port. What a hell !
Because i don't have a lot of money for the moment, I would like to use this USB external drive as Storage for my Samba and Jellyfin containers on my Proxmox VE server without reformating it to ext4 or ZFS.
I would like this drive to be hot-pluggable also. Is it possible ?

I mounted the drive like this on the PVE host for testing before configuring fstab :
Code:
mkdir /mnt/bindmounts
mkdir /mnt/bindmounts/usbhdd
mount -o umask=000 /dev/sda2 /mnt/bindmounts/usbhdd/

This is the configuration file of my Samba fIle sharing LXC container :
Code:
h: amd64
cores: 2
features: nesting=1
hostname: fileserver
memory: 2048
mp0: /mnt/bindmounts/usbhdd, mp=/mnt/storage
net0: name=eth0,bridge=vmbr0,firewall=1,hwaddr=BC:24:11:B9:AE:63,ip=dhcp,ip6=dhcp,type=veth
ostype: archlinux
rootfs: local-lvm:vm-102-disk-0,size=8G
swap: 512
unprivileged: 1

if I do
Code:
ls -al /mnt/bindmounts/usbhdd
the output is :
Code:
total 61700
drwxrwxrwx 11 root root   262144 Feb 16 16:20  .
drwxr-xr-x  3 root root     4096 Feb 16 15:41  ..
drwxrwxrwx  4 root root   262144 Aug 11  2022  Documents
...

When trying to do
Code:
ls -al /mnt/storage
on the guest there is nothing.

Even if i use
Code:
umask=000
when mounting the drive, do I need to set UIDs or GIDs ?
 
I got the answer to my problem.

I was doing this :
Code:
mp0: /mnt/bindmounts/usbhdd, mp=/mnt/storage

Instead of this :
Code:
mp0: /mnt/bindmounts/usbhdd,mp=/mnt/storage

Yeah find the difference....
1 day of my life just for a whitespace....
Maybe Proxmox needs a config checker.
 
  • Like
Reactions: leesteken

blakyris

hello! can you write guide how to make it correct?
a have same problem with mount, but my hdd is connected by sata cable inside case