On Sun, Mar 20, 2005 at 12:37:09AM +0100, Christian Jaeger wrote:PS. I've noticed that the loop devices are not released.
mount -o loop $from $to # this allocates a loop device, as can be seen in ps auxww # (under kernel 2.4.x, as [loop0] or similar kernel threads) # or in /proc/mounts (source of the mount point).
umount $to # now it's unmounted, but the loop device is still active. # this means that the space allocated by $from is not released and # that after 8 mount cycles all loop devices are used up.
I don't know whether umount $from combined with a normal /etc/mtab file will deallocate the loop device.
That /does/ work normally - I use it often.
Then I guess umount does not only look at /etc/mtab but also at /proc/mounts, sees that it was a loop mount, and does a losetup -d on it.
> If so, then my previous patch is bad.
If anything I would call that a bug in umount rather than your patch.
Well, there are two separate issues. Firstly, that umount doesn't find $from if mtab is symlinked. Secondly, that loop devices are not released in all circumstances.
At the moment, it's an open question if loop devices are released if mtab is not symlinked (i.e. the "normal" case) but umount $target is done. Someone could check if applying my patch makes the situation worse for "normal" users. (I might do it some time next week.)
Actually, I've just read the manpage for umount and have realised there is a -d option exactly for the purpose of releasing the loop device.
So, additionally to applying my patch, the umount statements in lvmcreate_initrd should be changed to include the -d option. Then everything should be clean in all cases.
Thanks Christian.
-- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]