最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

usb drive - Disks listed by lsblk does not match list devices visible in Docker container - Stack Overflow

programmeradmin3浏览0评论

I have an app in docker which is meant to handle connected USB devices. I launch it with enabled --privileged flag.

Inside my app I use lsblk to find block devices to mount them when they are needed, but sometimes device paths do not match

For example in the container I get:

root@b4c7fe2245e9:/# lsblk | grep -v loop
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
sda      8:0    0 465.8G  0 disk 
|-sda1   8:1    0   512M  0 part 
|-sda2   8:2    0     1K  0 part 
`-sda5   8:5    0 465.3G  0 part 
sdc      8:32   1  57.7G  0 disk 
`-sdc1   8:33   1  57.7G  0 part 
root@b4c7fe2245e9:/# ls /dev | grep sd
sda
sda1
sda2
sda5
sdb   <---this should be sdc
sdb1

while host shows me:

user@machine:~/$ ls /dev | grep sd
sda
sda1
sda2
sda5
sdc
sdc1

Is it a bug in docker, or is something wrong with my config? My host system is Linux.

发布评论

评论列表(0)

  1. 暂无评论