Quantcast
Channel: Proxmox Support Forum
Viewing all articles
Browse latest Browse all 172547

LXC - Cannot assign a block device to container

$
0
0
I want to passthrough my /dev/sdb to a LXC container running OpenMediaVault.

Running
Code:

# lxc-device add -n 102 /dev/sdb
Seems to work perfectly, and /dev/sdb is visible in the container. Unfortunately this command is temporary and doesn't survive a reboot

The solution seems to be to use lxc.cgroup.devices.allow

I first needed to discover the major and minor ID's for my device:
Code:

# ls -al /dev/sdb
brw-rw---- 1 root disk 8, 16 Aug 14 21:02 /dev/sdb

b = This is a block device
8 is the major ID
16 is the minor ID

Adding this to the container conf:
Code:

# devices - set profile to allow mounting block devices (constrained by default)
lxc.aa_profile = lxc-container-default-with-mounting

# lxc.cgroup.devices.allow = typeofdevice majornumber:minornumber rwm
lxc.cgroup.devices.allow = b 8:16 rwm

After adding these two lines, the Proxmox GUI shows the error:
Quote:

Invalid Key 'lxc.cgroup.devices.allow' (500)

  • What am I doing wrong?
  • Is this feature not implemented in Proxmox yet?
  • Is there a way to achieve persistent block device passthrough?

Viewing all articles
Browse latest Browse all 172547

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>