1

I am trying to detach a loopback device.

The losetup --detach presumably succeeds (no error message and return code 0) but the device is still there.

Any ideas?

root@Cassiopeia:~# losetup -a
/dev/loop1: [2053]:5243868 (/var/lib/snapd/snaps/core_6034.snap)
/dev/loop6: [2053]:19401380 (/tmp/imagefile)
/dev/loop4: [2053]:5249290 (/var/lib/snapd/snaps/canonical-livepatch_49.snap)
/dev/loop2: [2053]:5243293 (/var/lib/snapd/snaps/canonical-livepatch_50.snap)
/dev/loop0: [2053]:5249134 (/var/lib/snapd/snaps/core_5897.snap)
/dev/loop5: [2053]:5249130 (/var/lib/snapd/snaps/core_6130.snap)
/dev/loop3: [2053]:5244442 (/var/lib/snapd/snaps/canonical-livepatch_54.snap)
root@Cassiopeia:~# losetup --detach /dev/loop6
root@Cassiopeia:~# echo $?
0
root@Cassiopeia:~# losetup -a
/dev/loop1: [2053]:5243868 (/var/lib/snapd/snaps/core_6034.snap)
/dev/loop6: [2053]:19401380 (/tmp/imagefile)
/dev/loop4: [2053]:5249290 (/var/lib/snapd/snaps/canonical-livepatch_49.snap)
/dev/loop2: [2053]:5243293 (/var/lib/snapd/snaps/canonical-livepatch_50.snap)
/dev/loop0: [2053]:5249134 (/var/lib/snapd/snaps/core_5897.snap)
/dev/loop5: [2053]:5249130 (/var/lib/snapd/snaps/core_6130.snap)
/dev/loop3: [2053]:5244442 (/var/lib/snapd/snaps/canonical-livepatch_54.snap)
  • You have to umount them first. – Rui F Ribeiro Jan 6 at 8:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.