I unsafely removed a USB device that was attached to loop0 with losetup
and could not delete nor detach loop0 afterwards.
losetup -a
shows /dev/loop0: [0005]:145606719 (/dev/sdb1)
When I remount the device to /dev/sdb1, umount
it and try losetup -d /dev/loop0
, I will still get the same error loop: can't delete device /dev/loop0: Device or resource busy
. Is there a way to get rid of the loop device?
If /dev/loop* are created by snaps, just remove the snaps that created them, using snap remove <name_of_snap> . You can get a list of your installed snaps by running snap list .
What is /dev/loop? /dev/loop is a virtual / loop device which is basically a file in Linux system which acts as a block device. It is used for mounting disk images like Snap. /dev/loop is read only so the size is fixed once created and cannot be modified. The naming is /dev/loopX.
Your /dev/loop0 is full because you continue to use the app associcated with the block device and whatever that app is creates or increases the block device sized based on usage if it is full then you need to uninstall the app or move the app install location to a different drive.
DESCRIPTION. The loop device is a block device that maps its data blocks not to a physical device such as a hard disk or optical disk drive, but to the blocks of a regular file in a filesystem or to another block device.
You may have to also use dmsetup
to remove the device mapping. Easiest way, if it doesn't interfere with any other mappings is to use a dmsetup remove_all
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With