Use disk device inside lxd container

I want to use a disk device inside an lxd container but it doesn’t work directly.

root@ocfs1:~# lsblk 
NAME    MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
loop0     7:0    0    49M  1 loop 
loop1     7:1    0  57.8M  1 loop 
loop2     7:2    0 101.5M  1 loop 
loop3     7:3    0  21.5M  1 loop 
loop4     7:4    0  21.5M  1 loop 
loop5     7:5    0  40.6M  1 loop 
loop6     7:6    0  40.6M  1 loop 
loop7     7:7    0  27.9G  0 loop /snap
                                  /
loop8     7:8    0    49M  1 loop 
sda       8:0    0  46.6G  0 disk 
├─sda1    8:1    0  46.5G  0 part 
└─sda15   8:15   0    99M  0 part 
sdb       8:16   0    59G  0 disk 
root@ocfs1:~# mkfs.ocfs2 -L "shared-block" /dev/sdb
mkfs.ocfs2 1.8.7
Cluster stack: classic o2cb
mkfs.ocfs2: Could not open device /dev/sdb: No such file or directory

Is it possible to passthrough a disk device so it can be managed and/or mounted from inside a container?

You can pass it through with a unix-block, the mkfs call will work, but containers cannot perform mounts usually, so you may need to set some of the security.syscalls.intercept.mount option to handle it.