616
Server / Re:Mount fyzického disku do kontejneru v Proxmox
« kdy: 06. 06. 2018, 10:12:31 »
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:
Isiel som znova podla toho isteho navodu https://forum.proxmox.com/threads/container-with-physical-disk.42280/
Konfiguraky:
Kód: [Vybrat]
nano /etc/apparmor.d/lxc/lxc-default-with-mounting-cgnsobsah:Kód: [Vybrat]
# 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,
}Kód: [Vybrat]
nano /etc/pve/lxc/101.confobsah:Kód: [Vybrat]
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.sha skript na mount pri starte:Kód: [Vybrat]
nano /var/lib/lxc/101/mount-hook.shobsah:Kód: [Vybrat]
#!/bin/sh
mknod -m 777 ${LXC_ROOTFS_MOUNT}/dev/sdb b 8 16
mknod -m 777 ${LXC_ROOTFS_MOUNT}/dev/sdb1 b 8 17privilegia na spustenieKód: [Vybrat]
chmod 755 /var/lib/lxc/101/mount-hook.shhadam to niekomu pomoze
