Closed bilalshaikh42 closed 1 year ago
Here is the results of the debugging steps you asked for in #13. The only difference here is that I am using the latest tag for the image rather than the previous version.
bilal@bilal-framework ~ $ docker run --rm -i -t --privileged --entrypoint bash linkacloud/d2vm:latest
root@87661a652d6b:/# fallocate -l 5G /tmp/disk
root@87661a652d6b:/# parted -s /tmp/disk mklabel msdos mkpart primary 1Mib 100% set 1 boot on
root@87661a652d6b:/# fdisk -l /tmp/disk
Disk /tmp/disk: 5 GiB, 5368709120 bytes, 10485760 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x0a7ae771
Device Boot Start End Sectors Size Id Type
/tmp/disk1 * 2048 10485759 10483712 5G 83 Linux
root@87661a652d6b:/# losetup
root@87661a652d6b:/# LOOPDEV=$(losetup --show -f /tmp/disk)
root@87661a652d6b:/# echo $LOOPDEV
/dev/loop0
root@87661a652d6b:/# partprobe $LOOPDEV
root@87661a652d6b:/# ls /dev/loop*
/dev/loop-control /dev/loop0
root@87661a652d6b:/# mkfs.ext4 ${LOOPDEV}p1
mke2fs 1.45.5 (07-Jan-2020)
The file /dev/loop0p1 does not exist and no size was specified.
root@87661a652d6b:/# mkfs.ext4 ${LOOPDEV}p0
mke2fs 1.45.5 (07-Jan-2020)
The file /dev/loop0p0 does not exist and no size was specified.
root@87661a652d6b:/# losetup -d $LOOPDEV
root@87661a652d6b:/#
Lately I have been experiencing the same problem after every restart of Docker. But usually it works without problems after that first failure.
On other projects I had a lot of problems with the behaviour of partprobe
in containers. I have to change the implementation to use kpartx
which seems to work much better.
If you are on linux, can you try to also mount /dev/
inside the container (-v /dev:/dev
) ?
Mounting dev seems to have helped!
bilal@bilal-framework ~$ docker run --rm -i -t --privileged -v /dev:/dev --entrypoint bash linkacloud/d2vm:latest
root@dc1a38e3afa7:/# fallocate -l 5G /tmp/disk
root@dc1a38e3afa7:/#
root@dc1a38e3afa7:/# parted -s /tmp/disk mklabel msdos mkpart primary 1Mib 100% set 1 boot on
root@dc1a38e3afa7:/# fdisk -l /tmp/disk
Disk /tmp/disk: 5 GiB, 5368709120 bytes, 10485760 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x9a7ae2fc
Device Boot Start End Sectors Size Id Type
/tmp/disk1 * 2048 10485759 10483712 5G 83 Linux
root@dc1a38e3afa7:/# losetup
root@dc1a38e3afa7:/# LOOPDEV=$(losetup --show -f /tmp/disk)
root@dc1a38e3afa7:/# echo $LOOPDEV
/dev/loop0
root@dc1a38e3afa7:/# partprobe $LOOPDEV
root@dc1a38e3afa7:/# mkfs.ext4 ${LOOPDEV}p1
mke2fs 1.45.5 (07-Jan-2020)
Discarding device blocks: done
Creating filesystem with 1310464 4k blocks and 327680 inodes
Filesystem UUID: c04a3613-344c-440b-bd45-dfae2761201f
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736
Allocating group tables: done
Writing inode tables: done
Creating journal (16384 blocks): done
Writing superblocks and filesystem accounting information: done
root@dc1a38e3afa7:/# partprobe $LOOPDEV
root@dc1a38e3afa7:/# losetup -d $LOOPDEV
root@dc1a38e3afa7:/#
Thanks for the great work on this! I am running into the same error reported in #13, but didnt see a solution in there.
This happens regardless of the approach I take, using docker, building from source, binaries, and with and without sudo.
Here is the output I get using the docker instructions in the readme.
And here is the verbose output