OpenMediaVault installation in LXC with attached HW block device

Inside container there's /dev/sdc and /dev/sdb.
Maybe there's problem that my drives are formated as whole /dev/sdb (and /dev/sdc) but not contains any partition.
I would like not to reformat them due to that they contain big amount of data.
 
Hi.
To correctly mount inside container any block device you need at least two devices:
- "physical" device (/dev/sda for example)
- "partitioned and fs-formatted" device of the mentioned above "physical" device (/dev/sda1 for example).
Do you have /dev/sdc and /dev/sdc1 in container?
 
I has the same problem.

Hello,

Thank you for your tutorial. I managed to get my 2 disks to appear in OMV and I can mount them individually.
However, I have two problems:
1- when I restart OMV, they don't automount
2- when I try to create a Union Filesystem in OMV, I have this error:
Code:
Failed to execute command 'export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin; export LANG=C; mount -v '/srv/834990ca-b113-42b7-9f48-3bda5714862d' 2>&1' with exit code '1': fuse: device not found, try 'modprobe fuse' first

Here are my config files.

/etc/pve/lxc/100.conf:
Code:
arch: amd64
cores: 4
hostname: omv.2566335.lan
memory: 2048
net0: name=eth0,bridge=vmbr0,hwaddr=A6:78:A6:00:4D:94,ip=dhcp,ip6=dhcp,type=veth
ostype: debian
rootfs: local-lvm:vm-100-disk-1,size=8G
swap: 2048
lxc.apparmor.profile: unconfined
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
/var/lib/lxc/100/mount-hook.sh:
Code:
#!/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

Could you tell me what I did wrong or missed? Thank you.

I tried adding
Code:
lxc.mount.entry: /diskmedia1 srv/dev-sdb1 none bind,create=dir,optional 0 0
lxc.mount.entry: /diskmedia2 srv/dev-sdc1 none bind,create=dir,optional 0 0
to /etc/pve/lxc/100.conf but it didn't change anything. I don't understand this part so I probably got it wrong.
 
I did it but have more problems:
I can mount and umount both dane1 and dane2 filesystems, without errors (inc. apply of course)
but when I try to format umounted dane2 this is what I get:
Code:
Device '/dev/dm-0' does not exist.
this is less important, but when I would like to make a share from dane2 and click apply this is what I get:
Code:
Failed to execute command 'export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin; export LANG=C; systemctl start 'sharedfolders-dane2.mount' 2>&1' with exit code '4': Failed to start sharedfolders-dane2.mount: Access denied See system logs and 'systemctl status sharedfolders-dane2.mount' for details.

fixed

https://github.com/openmediavault/openmediavault/pull/942

https://github.com/openmediavault/openmediavault/issues/944
 
...first I reopen this old thread ..., informations here are very valuable for me, but I need a little help....

My context:
I have an old PC (limited ressources: core2duo intel 2.93GHz, 4Go Ram- SSD for Proxmox, and 2 mecanical Sata HD for more storage).
I install OpenMedialVault 6.2 as an LXC container (to minimize overhead of a full VM), and I'm able to mount the 2 mecanical sata drive on the OMV container.

My Problem:
The successful mount in OMV is very very slow,
I see syslog message every 30 secondes, that mount failed ... and then 2 mn after, HD are mount correctly !
After that everything work correctly : in OMV GUI I am able to define the Storage/Disk/File Systems/Share...
This is NOT a blocker ... but this 2 minutes startup is really annoying ... and I don't understand where it come from ....

If you have any idea, how can I investigate that ? I would appreciate your help

---
For information my container 103.conf and the specific mount-hook.sh file

/etc/pve/lxc/103.conf
Code:
arch: amd64
cores: 2
features: nesting=1
hostname: nas2
memory: 1024
net0: name=eth0,bridge=vmbr0,hwaddr=AE:2F:7E:64:01:6E,ip=dhcp,type=veth
onboot: 1
ostype: debian
rootfs: local-lvm:vm-103-disk-0,size=4G
swap: 512
lxc.cgroup2.devices.allow: a
lxc.cap.drop:
lxc.cgroup2.devices.allow: c 188:* rwm
lxc.cgroup2.devices.allow: c 189:* rwm
lxc.mount.entry: /dev/serial/by-id  dev/serial/by-id  none bind,optional,create=dir
lxc.mount.entry: /dev/ttyUSB0       dev/ttyUSB0       none bind,optional,create=file
lxc.mount.entry: /dev/ttyACM0       dev/ttyACM0       none bind,optional,create=file
lxc.cgroup2.devices.allow: b 8:16 rwm
lxc.cgroup2.devices.allow: b 8:17 rwm
lxc.cgroup2.devices.allow: b 8:32 rwm
lxc.cgroup2.devices.allow: b 8:33 rwm
lxc.autodev: 1
lxc.hook.autodev: /var/lib/lxc/103/mount-hook.sh

/var/lib/lxc/103/mount-hook.sh
Code:
#!/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

In the container OMV add the standard line
/etc/fstab
Code:
# UNCONFIGURED FSTAB FOR BASE SYSTEM
# >>> [openmediavault]
/dev/sdb1               /srv/dev-sdb1   ext4    defaults,nofail,user_xattr,usrjquota=aquota.user,grpjquota=aquota.group,jqfmt=vfsv0,acl        0 2
/dev/sdc1               /srv/dev-sdc1   ext4    defaults,nofail,user_xattr,usrjquota=aquota.user,grpjquota=aquota.group,jqfmt=vfsv0,acl        0 2
# <<< [openmediavault]
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!