
Hi,
I noticed that loop mounts are not automatically cleaned in my system. Is there any way that I can fix it?
Each time after I loop mount, the loop device number increased. When I do ps, I found that there are many loop process in execution:
$ ps -eaf | grep loop root 5566 1 0 Jan05 ? 00:01:44 [loop0] root 5597 1 0 Jan05 ? 00:00:00 [loop1] root 5603 1 0 Jan05 ? 00:00:00 [loop2] root 10995 1 0 00:28 ? 00:01:41 [loop3] root 26656 1 0 11:42 ? 00:01:40 [loop4] root 6234 1 0 17:45 ? 00:00:00 [loop5]
Previously, the loop process will be gone after I umount the loop mount.
As the result, my disk space did not re-gain after deleting loop mounted iso files:
sudo mount -o loop my-big.iso /mnt/tmp1
$ df /dev/sda14 79631676 52241640 27390036 66% /lfs/cache12 /dev/loop3 4571190 4571190 0 100% /mnt/tmp1
sudo umount /mnt/tmp1
$ lsof | grep my-big
rm my-big.iso
$ df /dev/sda14 79631676 52241640 27390036 66% /lfs/cache12
The my-big.iso is over 4G in size, but there is no space increase after it being deleted. I've checked with lsof that no one is using it.
please help. thanks

* ][ mlist4suntong@yahoo.com [20070206 06:15]:
I noticed that loop mounts are not automatically cleaned in my system. Is there any way that I can fix it?
[...]
Which mount version are you using? 'dpkg -S =mount ; mount --version' I'm using mount of package loop-aes-utils and did not notice the mentioned behaviour.
regards, -mika-

On Tue, 06 Feb 2007 09:10:18 +0100, Michael Prokop wrote:
I noticed that loop mounts are not automatically cleaned in my system. Is there any way that I can fix it?
[...]
Which mount version are you using? 'dpkg -S =mount ; mount --version' I'm using mount of package loop-aes-utils and did not notice the mentioned behaviour.
Strange to me too. Here is the required info:
$ dpkg -S =mount dpkg: *=mount* not found.
$ dpkg -S mount ncpfs: /usr/bin/ncpumount smbfs: /usr/share/man/man8/smbmount.8.gz os-prober: /usr/lib/linux-boot-probes/mounted [...to much hits...]
$ mount --version mount: mount-2.12r
$ apt-cache policy mount mount: Installed: 2.12r-16 Candidate: 2.12r-16
$ apt-cache policy loop-aes-utils loop-aes-utils: Installed: 2.12r-15 Candidate: 2.12r-15
$ sudo mount -o loop grml_small_0.3.iso /mnt/os2/
$ mount | grep os2 /dev/loop2 on /mnt/os2 type iso9660 (ro)
$ sudo umount /mnt/os2/
$ ps -e | grep loop 32721 ? 00:00:00 loop0 3332 ? 00:00:00 loop1 2776 ? 00:00:00 loop2

* ][ mlist4suntong@yahoo.com [20070207 04:15]:
On Tue, 06 Feb 2007 09:10:18 +0100, Michael Prokop wrote:
I noticed that loop mounts are not automatically cleaned in my system. Is there any way that I can fix it?
Which mount version are you using? 'dpkg -S =mount ; mount --version' I'm using mount of package loop-aes-utils and did not notice the mentioned behaviour.
Strange to me too. Here is the required info:
$ dpkg -S =mount dpkg: *=mount* not found.
bash user, ey? 8-)
[...]
$ sudo mount -o loop grml_small_0.3.iso /mnt/os2/
$ mount | grep os2 /dev/loop2 on /mnt/os2 type iso9660 (ro)
$ sudo umount /mnt/os2/
$ ps -e | grep loop 32721 ? 00:00:00 loop0 3332 ? 00:00:00 loop1 2776 ? 00:00:00 loop2
Run 'losetup -d /dev/loop2' to fix the issue manually. To fix the issue for the future remove the symlink /etc/mtab pointing to /proc/mounts:
rm /etc/mtab cp /proc/mounts /etc/mtab
-> from now on your system should remove the loop device automatically.
regards, -mika-

][ schrieb:
Hi,
I noticed that loop mounts are not automatically cleaned in my system. Is there any way that I can fix it?
How do you mount it (with "-o loop" or with losetup)? How do you unmount it (by giving the mountpoint, the image file or the loop device)? Is your /etc/mtab a file or is it a symbolic link to /proc/mounts?
The behaviour I know is that the loop device will *not* be freed if a) /etc/mtab is a link to /proc/mounts *or* b) you gave the loop device explicitly as umount argument *or* c) you mounted it with losetup explicitly *or* d) you used -n when mounting (so the mountpoint does not end up in mtab)
But different mount versions do it differently (busybox mount even has its own parameter for it, because embedded systems usually use the /mtab symlink).
You can always free your loop devices with losetup.
Michael

I noticed that loop mounts are not automatically cleaned in my system. Is there any way that I can fix it?
thanks for your help, mika & Michael.
problem solved, as you described.
Teilnehmer (3)
-
][
-
Michael Prokop
-
Michael Schierl