Sample Header Ad - 728x90

Delete /dev/loopX entry after detaching loop device

5 votes
1 answer
4902 views
I created a loop device using losetup /dev/loop90 /tmp/disk1, where /tmp/disk1 is a 512M file I have created. Then the loop device was detached using losetup -d /dev/loop90. It was removed from the output of losetup -a, but the entry in /dev and /sys/devices/virtual/block is still present. Because this entry is present, whenever a udev scan is performed, all the removed devices are also listed. How can these loop devices be completely deleted and all the entries removed without a reboot?
Asked by Akhil Mohan (125 rep)
Sep 24, 2019, 09:26 AM
Last activity: May 20, 2025, 09:08 AM