Hello all.
I want to access my usb-disk from withing the lxc-container. I'm mounting the disk with following line:
The root filesystem is mounted here:
I know that I can map uid/gids using
Trying it in the container gives me an error:
If I interpret it correctly, the root-dir of sdb3 is owned/modifiable by root(0), which is the reason why the unprivileged root(100000) in the container gets "permission denied". However, the same seems to be working with the root-dir of local-lvm:wm-107-disk-0, which is the root dir(/) of the container.
Can I use a mount option or a container option to access /media/usb-disk/?
Here are some more infos from within the container:
I want to access my usb-disk from withing the lxc-container. I'm mounting the disk with following line:
mp0: /dev/sdb3,mp=/media/usb-disk,backup=0
The root filesystem is mounted here:
rootfs: local-lvm:vm-107-disk-0,mountoptions=lazytime,size=130G
I know that I can map uid/gids using
lxc.idmap
in the config file. But is there a way to modify the directory /media/usb-disk?Trying it in the container gives me an error:
~ # mkdir /media/usb-disk/test
mkdir: can't create directory '/media/usb-disk/test': Permission denied
If I interpret it correctly, the root-dir of sdb3 is owned/modifiable by root(0), which is the reason why the unprivileged root(100000) in the container gets "permission denied". However, the same seems to be working with the root-dir of local-lvm:wm-107-disk-0, which is the root dir(/) of the container.
Can I use a mount option or a container option to access /media/usb-disk/?
Here are some more infos from within the container:
~ # mount
/dev/mapper/pve-vm--107--disk--0 on / type ext4 (rw,lazytime,relatime,stripe=16)
/dev/sdb3 on /media/usb-disk type ext4 (rw,relatime,stripe=8191)
~ # stat /
File: /
Size: 4096 Blocks: 8 IO Block: 4096 directory
Device: fd0dh/64781d Inode: 2 Links: 20
Access: (0755/drwxr-xr-x) Uid: ( 0/ root) Gid: ( 0/ root)
~ # stat /media/usb-disk/
File: /media/usb-disk/
Size: 4096 Blocks: 8 IO Block: 4096 directory
Device: 813h/2067d Inode: 2 Links: 18
Access: (0755/drwxr-xr-x) Uid: (65534/ nobody) Gid: (65534/ nobody)