Now I'm fighting different problem, already tried this:
Done.
...
1. comment lines with:
lxc.mount.entry: /media/dane1 srv/sdc1 none bind,create=dir,optional 0 0
lxc.mount.entry: /media/dane2 srv/sdb1 none bind,create=dir,optional 0 0
in /etc/pve/lxc/<lxc_num>.conf on Proxmox server
2. restart container
3. check in containers /etc/fstab that there is no any lines about mount /dev/sd*
if any mount lines exist - comment them and restart container.
if not - skip reboot and follow to gui and try to mount file systems with applying changes.
4. after successful mount you'll find a new mount options in /etc/fstab of container.
you should comment all this lines with mount options.
5. go back again to Proxmox server to edit /etc/pve/lxc/<lxc_num>.conf and uncomment
lxc.mount.entry: /media/dane1 srv/sdc1 none bind,create=dir,optional 0 0
lxc.mount.entry: /media/dane2 srv/sdb1 none bind,create=dir,optional 0 0
6. restart container with OpenMediaVault.
7. after this manipulati0ns you'll be able to create shared directories via GUI of OpenMediaVailt.
I'm successfully tested this way
this is my output from PVE host:
root@serwer:~# blkid | grep dane
/dev/sdb1: LABEL="dane2" UUID="7980df78-8173-4ae7-a38e-0b3bcb2b9df5" TYPE="ext4" PARTLABEL="dane2" PARTUUID="d34a2a2e-3aff-4e26-b177-8ee886409b3f"
/dev/sdc1: LABEL="dane1" UUID="a6dfa5fb-d16d-4852-a502-7201c3fa9a37" TYPE="ext4" PARTLABEL="dane1" PARTUUID="74df1554-9edc-4b38-b48d-43e0a17c1f8b"
root@serwer:~# cat /etc/fstab | grep dane
UUID=a6dfa5fb-d16d-4852-a502-7201c3fa9a37 /srv/dane1 ext4 defaults 0 0
UUID=7980df78-8173-4ae7-a38e-0b3bcb2b9df5 /srv/dane2 ext4 defaults 0 0
root@serwer:~# ls -la /dev/sd*
brw-rw---- 1 root disk 8, 0 Apr 22 19:11 /dev/sda
brw-rw---- 1 root disk 8, 1 Apr 22 19:11 /dev/sda1
brw-rw---- 1 root disk 8, 2 Apr 22 19:11 /dev/sda2
brw-rw---- 1 root disk 8, 3 Apr 22 19:11 /dev/sda3
brw-rw---- 1 root disk 8, 16 Apr 22 19:11 /dev/sdb
brw-rw---- 1 root disk 8, 17 Apr 22 19:11 /dev/sdb1
brw-rw---- 1 root disk 8, 32 Apr 22 19:11 /dev/sdc
brw-rw---- 1 root disk 8, 33 Apr 22 19:11 /dev/sdc1
I need to use only /dev/sdb1 and /dev/sdc1 partitions in OMV
root@serwer:~# cat /etc/pve/lxc/100.conf
arch: amd64
cores: 2
hostname: omv
memory: 2048
net0: name=eth0,bridge=vmbr0,gw=192.168.0.1,hwaddr=6A:CA:0F:C1:EC:C6,ip=192.168.0.3/24,type=veth
onboot: 1
ostype: debian
rootfs: local-lvm:vm-100-disk-1,size=4G
swap: 2048
lxc.apparmor.profile: unconfined
lxc.mount.auto: cgroup:rw
lxc.mount.auto: proc:rw
lxc.mount.auto: sys:rw
lxc.cgroup.devices.allow: b 8:16 rwm
lxc.cgroup.devices.allow: b 8:17 rwm
lxc.cgroup.devices.allow: b 8:32 rwm
lxc.cgroup.devices.allow: b 8:33 rwm
lxc.autodev: 1
lxc.hook.autodev: /var/lib/lxc/100/mount-hook.sh
lxc.mount.entry: /srv/dane1 media/a6dfa5fb-d16d-4852-a502-7201c3fa9a37 none bind,create=dir,optional 0 0
lxc.mount.entry: /srv/dane2 media/7980df78-8173-4ae7-a38e-0b3bcb2b9df5 none bind,create=dir,optional 0 0
root@serwer:~# cat /var/lib/lxc/100/mount-hook.sh
#!/bin/sh
mknod -m 777 ${LXC_ROOTFS_MOUNT}/dev/sdb b 8 16
mknod -m 777 ${LXC_ROOTFS_MOUNT}/dev/sdb1 b 8 17
mknod -m 777 ${LXC_ROOTFS_MOUNT}/dev/sdc b 8 32
mknod -m 777 ${LXC_ROOTFS_MOUNT}/dev/sdc1 b 8 33
and this is my output from OMV container:
root@omv:~# blkid | grep dane
/dev/sdb1: LABEL="dane2" UUID="7980df78-8173-4ae7-a38e-0b3bcb2b9df5" TYPE="ext4" PARTLABEL="dane2" PARTUUID="d34a2a2e-3aff-4e26-b177-8ee886409b3f"
/dev/sdc1: LABEL="dane1" UUID="a6dfa5fb-d16d-4852-a502-7201c3fa9a37" TYPE="ext4" PARTLABEL="dane1" PARTUUID="74df1554-9edc-4b38-b48d-43e0a17c1f8b"
root@omv:~# cat /etc/fstab
# UNCONFIGURED FSTAB FOR BASE SYSTEM
tmpfs /tmp tmpfs defaults 0 0
# >>> [openmediavault]
# <<< [openmediavault]
root@omv:~# ls -la /dev/sd*
brw-rw---- 1 root disk 8, 16 Apr 22 17:11 /dev/sdb
brw-rw---- 1 root disk 8, 17 Apr 22 17:11 /dev/sdb1
brw-rw---- 1 root disk 8, 32 Apr 22 17:11 /dev/sdc
brw-rw---- 1 root disk 8, 33 Apr 22 17:11 /dev/sdc1
and the problem is I can mount and unmount /dev/sdc1 (dane1) in OMV GUI but not /dev/sdb1 (dane2), it's mounted when I try to umount it I get:
Failed to execute command 'export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin; export LANG=C; umount -v -f '/dev/disk/by-label/dane2' 2>&1' with exit code '32': umount: /media/7980df78-8173-4ae7-a38e-0b3bcb2b9df5: block devices are not permitted on filesystem
what I did wrong?