Tak nakoniec sa mi podarilo mountnut fyzicky disk /dev/sdb do LXC aj s automountom pri starte systemu.
Isiel som znova podla toho isteho navodu
https://forum.proxmox.com/threads/container-with-physical-disk.42280/Konfiguraky:
nano /etc/apparmor.d/lxc/lxc-default-with-mounting-cgns
obsah:
# Do not load this file. Rather, load /etc/apparmor.d/lxc-containers, which
# will source all profiles under /etc/apparmor.d/lxc
profile lxc-default-with-mounting-cgns flags=(attach_disconnected,mediate_deleted) {
#include <abstractions/lxc/container-base>
# allow standard blockdevtypes.
# The concern here is in-kernel superblock parsers bringing down the
# host with bad data. However, we continue to disallow proc, sys, securityfs,
# etc to nonstandard locations.
mount fstype=cgroup -> /sys/fs/cgroup/**,
mount fstype=ext*,
mount fstype=xfs,
mount fstype=btrfs,
}
nano /etc/pve/lxc/101.conf
obsah:
arch: amd64
cores: 1
hostname: web-debian
memory: 1024
net0: name=eth0,bridge=vmbr0,gw=192.168.1.1,hwaddr=9E:43:6D:25:D9:CB,ip=192.168.1.101/24,type=veth
onboot: 1
ostype: debian
rootfs: local-lvm:vm-101-disk-2,size=32G
swap: 1024
lxc.apparmor.profile: lxc-default-with-mounting-cgns
lxc.cgroup.devices.allow = b 8:16 rwm
lxc.cgroup.devices.allow = b 8:17 rwm
mp0: /dev/sdb1,mp=/mnt/sdb,backup=0
lxc.autodev: 1
lxc.hook.autodev: /var/lib/lxc/101/mount-hook.sh
a skript na mount pri starte:
nano /var/lib/lxc/101/mount-hook.sh
obsah:
#!/bin/sh
mknod -m 777 ${LXC_ROOTFS_MOUNT}/dev/sdb b 8 16
mknod -m 777 ${LXC_ROOTFS_MOUNT}/dev/sdb1 b 8 17
privilegia na spustenie
chmod 755 /var/lib/lxc/101/mount-hook.sh
hadam to niekomu pomoze