Skip to content

the loop devices don't get disassociated automatically when umounting #2

Description

@zaoqi

schuhumi commented: (https://www.mobileread.com/forums/showpost.php?p=3885242&postcount=7)

I found out that the loop devices don't get disassociated automatically when umounting, you can check like this:

[root@kindle kual-linuxdeploy-armhf]# cat /sys/block/loop*/loop/backing_file 
/dev/mmcblk0p4
/mnt/us/extensions/kual-linuxdeploy-armhf/rootfs.img (deleted)
/mnt/us/extensions/kual-linuxdeploy-armhf/rootfs.img
/usr/share/X11/xkb.sqsh
/usr/java/lib/fonts.sqsh
/etc/kdb.src.sqsh
/usr/lib/locale.sqsh
/usr/share/keyboard.sqsh
/opt/var/local.sqsh
/mnt/us/extensions/kual-linuxdeploy-armhf/rootfs.img (deleted)
/mnt/us/extensions/kual-linuxdeploy-armhf/rootfs.img (deleted)

That for me leads to a) running out of loop devices at one point (max 16) b) storage doesn't get freed when deleting the umounted image (df -h). Thus I disassociate it manually:

LOOPDEV="$(mount | grep loop | grep /tmp/alpine | cut -d" " -f1)"
... umounts ...
losetup -d $LOOPDEV

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions