title: How to access block device inside a Docker container
body: <p>I have been trying to access block storage device of host system from a docker container though binding mount. Getting 'Operation not permitted' error.</p>
  <p>Is there anything that I'm missing here:</p>
  <pre><code># ls -l /dev/sdb
  brw-rw---- 1 root disk 8, 16 Sep  3 00:52 /dev/sdb
  # 
  # dd if=/dev/zero of=/dev/sdb bs=1M
  16005+0 records in
  16005+0 records out
  16782458880 bytes (17 GB) copied, 12.4396 s, 1.3 GB/s
  
  # 
  # 
  # docker container run --name c1 -it --mount type=bind,source=/dev/sdb,target=/data centos
  /# ls -l /data
  brw-rw---- 1 root disk 8, 16 Sep  3 06:52 /data
  /# 
  /#
  /# dd if=/dev/zero of=/data bs=1M
  dd: failed to open '/data': Operation not permitted
  /#
  </code></pre>