fdisk doesn't find loop device in docker

Having a somewhat odd problem. I am testing out an installation on Docker that needs a free block device, here are the steps I took:

  • Mounted an image file as /dev/loop4 on the host
  • Wrote a label to it and created a partition: /dev/loop4p1 (this is for testing only, what I need is the raw device)
  • Launched a Docker container (ubuntu:14.04) in privileged mode

Now, using the device/partition works fine: I can mount it and read/write data; fdisk -l /dev/loop4 does the expected thing; it shows up in lsblk; and /proc/partitions looks as expected:

  • Error: EACCES: permission denied using docker-compose
  • Gitlab CI: mount Apache service Docker DocumentRoot directory into main Docker
  • Detect if Docker image would change on running build
  • Unable to pull private repo in docker
  • Data lost after dinghy restart (postgres container)
  • How to install Docker on 32bit machine having Ubuntu 12.04?
  • root@e1047c0fa3a3:/proc# cat /proc/partitions 
    major minor  #blocks  name
     259        0  500107608 nvme0n1
     259        1     266240 nvme0n1p1
     259        2  494927872 nvme0n1p2
     259        3    4912455 nvme0n1p3
       7        0  104857600 loop0
       7        1    2097152 loop1
       7        4   25165824 loop4
     259        4   25164783 loop4p1
     254        0  104857600 dm-0
     254        1   10485760 dm-1

    BUT if I run just fdisk -l, ‘loop4’ doesn’t show up (only the system drive comes up), and apparently that’s how the install tool I’m using is looking for available drives, so I can’t pick ‘loop4’.

    fdisk -l on the host shows everything from /proc/partitions.

    Any ideas on what else fdisk looks for when listing devices?


    Apparently this is a problem specifically on 14, and 16 works as expected. Still would be nice to have a workaround on 14.

  • Links between service Rancher Server 1.0.0
  • Bash - seamlessly run scripts with CRLF line endings
  • Rename docker machine
  • How to run docker image with specific version and port forwarding
  • Prometheus - Docker/JVM Monitoring
  • How to run a full laravel on kubernetes?
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.