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:

  • Is it possible to restart docker container from inside it
  • how to update docker in coreos
  • It's possible to tie a domain to the docker container when building it?
  • supervisord: is it possible to redirect subprocess stdout back to supervisord?
  • Golang Dockerfile Failing
  • Xdebug breaks on access to class static property
  • 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.

  • How to find exposed port of linked service with Docker Compose v2 format?
  • Announcing your app from within a container (docker)
  • serverspec command returning blank strings
  • How can I restrict ports to a host created by docker-machine?
  • Docker build fails on COPY or ADD statement for entrypoint, Windows only
  • OPTIONS field in Docker CLI commands - diff and cp
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.