From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.1.4) Gecko/20070603 Fedora/2.0.0.4-2.fc7 Firefox/2.0.0.4 Description of problem: See the summary. Version-Release number of selected component (if applicable): util-linux-2.13-0.51 How reproducible: Always Steps to Reproduce: 1.mount an image via the loop device, e.g. mount -o loop,offset=32256 /usr/local/kvm-images/WinXP.raw /mnt/ 2.check that the corresponding entry in /etc/mtab doesn't have the 'loop=...' option Actual Results: # grep loop /etc/mtab /dev/loop0 /mnt fuseblk rw,nosuid,nodev,noatime,allow_other,blksize=4096 0 0 Expected Results: # grep loop /etc/mtab /dev/loop0 /mnt fuseblk rw,nosuid,nodev,noatime,allow_other,blksize=4096,loop=/dev/loop0 0 0 Additional info: The consequence of this is that umount doesn't free the loop device. losetup -a still shows /dev/loop0: [080c]:14073859 (/usr/local/kvm-images/WinXP.raw), offset 32256 after umount /mnt Given that there are only 8 loop devices by default, after a few mount/unmount's one runs out of free loop devices.
The problem doesn't show up when mounting iso images. (Thanks to Luciano Rocha for the suggestion.)
I think 'fuseblk' uses a special mount program (e.g. /sbin/mount.<foo>) and it seems that this program doesn't add the loop=/dev/loopN to the /etc/mtab file. Right?
Might be... How do I check it? /sbin/mount.ntfs-fuse certainly seems to be involved in the process.
Please, try "strace -o log mount <your options>". And add the log as an bugzilla attachment.
Created attachment 158042 [details] output of strace on mount
The problem is /sbin/mount.ntfs that ignores the loop=/dev/loopN option.
Well, this is interesting. ntfs-3g (the package that provides /sbin/mount.ntfs) doesn't need any loop= options to mount local files into a directory. See: http://www.ntfs-3g.org/quality.html (at the bottom) So, what is happening (to the best of my knowledge) is that mount sees the loop= command, allocates a loop device, then mount.ntfs ignores it (because it doesn't need it). The obvious workaround is to remove the loop option from the initial mount command, as it is not needed. [root@localhost ~]# mount /root/ntfs-test.img /mnt/ [root@localhost ~]# losetup -a [root@localhost ~]# mount /dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw) proc on /proc type proc (rw) sysfs on /sys type sysfs (rw) devpts on /dev/pts type devpts (rw,gid=5,mode=620) /dev/sda1 on /boot type ext3 (rw) tmpfs on /dev/shm type tmpfs (rw) none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw) sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw) /root/ntfs-test.img on /mnt type fuse (rw,nosuid,nodev,noatime,allow_other) This might be a case where ntfs-3g would either want to silently free up the loop device if it sees a loop option passed to it, or outright throw an error when it sees a loop device (*** ntfs-3g mounts do not require loop options! ***). Adding upstream maintainer to CC for his opinion.
In my copy of mount the loop=/dev/loopN option isn't passed to ntfs-3g. If it were then ntfs-3g passes it to FUSE which does the /etc/mtab modification. I think FUSE indeed ignores the 'loop' mount option. I notified Miklos Szeredi, FUSE maintainer.
(In reply to comment #7) > This might be a case where ntfs-3g would either want to silently free up the > loop device if it sees a loop option passed to it, or outright throw an error > when it sees a loop device (*** ntfs-3g mounts do not require loop options! ***). I think an error/warning message is good idea. (In reply to comment #8) > In my copy of mount the loop=/dev/loopN option isn't passed to ntfs-3g. What version of util-linux is in use?
(In reply to comment #7) > Well, this is interesting. ntfs-3g (the package that provides /sbin/mount.ntfs) > doesn't need any loop= options to mount local files into a directory. > > See: > http://www.ntfs-3g.org/quality.html (at the bottom) > > So, what is happening (to the best of my knowledge) is that mount sees the loop= > command, allocates a loop device, then mount.ntfs ignores it (because it doesn't > need it). > > The obvious workaround is to remove the loop option from the initial mount > command, as it is not needed. > > [root@localhost ~]# mount /root/ntfs-test.img /mnt/ > [root@localhost ~]# losetup -a > [root@localhost ~]# mount > /dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw) > proc on /proc type proc (rw) > sysfs on /sys type sysfs (rw) > devpts on /dev/pts type devpts (rw,gid=5,mode=620) > /dev/sda1 on /boot type ext3 (rw) > tmpfs on /dev/shm type tmpfs (rw) > none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw) > sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw) > /root/ntfs-test.img on /mnt type fuse (rw,nosuid,nodev,noatime,allow_other) > > This might be a case where ntfs-3g would either want to silently free up the > loop device if it sees a loop option passed to it, or outright throw an error > when it sees a loop device (*** ntfs-3g mounts do not require loop options! ***). [root@localhost ~]# losetup -a [root@localhost ~]# mount -o offset=32256 /usr/local/kvm-images/WinXP.raw /mnt/ [root@localhost ~]# losetup -a /dev/loop0: [080c]:14073859 (/usr/local/kvm-images/WinXP.raw), offset 32256 [root@localhost ~]# umount /mnt/ [root@localhost ~]# losetup -a /dev/loop0: [080c]:14073859 (/usr/local/kvm-images/WinXP.raw), offset 32256 So it doesn't seem to make a difference whether the loop option for mount is used or not.
> > What version of util-linux is in use? > 2.13-0.51.fc7
The offset option seems to be triggering the loop initialization. My dummy filesystem also uses a loop device. But, if I mount with no offset option, no loop device. [root@localhost ~]# losetup -a [root@localhost ~]# mount -o offset=0 /root/ntfs-test.img /mnt/loop [root@localhost ~]# losetup -a /dev/loop0: [fd00]:16876164 (/root/ntfs-test.img) [root@localhost ~]# umount /mnt/loop [root@localhost ~]# losetup -a /dev/loop0: [fd00]:16876164 (/root/ntfs-test.img) [root@localhost ~]# losetup -d /dev/loop0 [root@localhost ~]# mount /root/ntfs-test.img /mnt/loop [root@localhost ~]# losetup -a [root@localhost ~]#
> This might be a case where ntfs-3g would either want to silently free up the > loop device if it sees a loop option passed to it, or outright throw an error > when it sees a loop device (*** ntfs-3g mounts do not require loop options! ***). Loop device is need if the 'offset' mount option is used. > What version of util-linux is in use? 2.12a, 2.12q, 2.12r. None of them sends the 'loop=' option to ntfs-3g. So unless it's fixed in recent util-linux versions, this is an util-linux and FUSE bug. Ntfs-3g passes all unhandled options to FUSE for further processing and the /etc/mtab modification is done by FUSE. Workaround could be 'umount -d mountpoint' but sometimes that could fail with EBUSY (probably due to a known FUSE issue).
Miklos Szeredi's opinion is that mount(8) should write a flag into e.g. /var/lib/mount/loopX, so umount(8) could free the loop device. He thinks the issue has nothing to do with the mounted file system, this is a characteristic of the loop device handling. Karel could discuss this with him directly or on util-linux-ng list. Miklos is working on /etc/mtab elimination. So, from FUSE point of view, this is an util-linux problem. From ntfs-3g point of view, this is not a direct ntfs-3g issue and there isn't anything we could help here.
Yes, I'm going to play with this issue next week.
Sorry, the bug is really in the mount(8) -- the command doesn't correctly call external mount programs with a "loop=" option. The bug has been fixed in the upstream code and will be fixed in F7, FC6 ASAP.
(In reply to comment #16) Great! Thanks!
(In reply to comment #16) > Sorry, the bug is really in the mount(8) -- the command doesn't correctly call > external mount programs with a "loop=" option. > > The bug has been fixed in the upstream code and will be fixed in F7, FC6 ASAP. Thanks but I think that will not solve the problem. Ntfs-3g will pass it to FUSE which is doing the /etc/mtab modification but FUSE will not process it, it will give it back to ntfs-3g which will ignore it since it's a mount(8) option which should be handled either by mount(8) or FUSE. Thus the option will basically go to /dev/null. Miklos says since loop is created by mount(8) thus mount(8) should handle this case entirely. Mount(8) indeed tries this by passing the option (now) to the external mount utilities. But FUSE ignores it. So if Miklos won't fix it, what he apparently is willing at the moment (please discuss this with him directly!) and you also don't store this information somewhere else then this bug won't get fixed. I think it would be completely insane if ntfs-3g would start editing /etc/mtab too besides FUSE, mount(8) and plenty of other utilities, just to fix this loop= mount option case.
(In reply to comment #18) > So if Miklos won't fix it, what he apparently is willing at the moment > (please discuss this with him directly!) Ooops, I wanted to write that "he is apparently __not__ willing to fix this issue in FUSE". I think, it should be fixed in FUSE too.
util-linux-2.13-0.52.fc7 has been pushed to the Fedora 7 testing repository. If problems still persist, please make note of it in this bug report.
util-linux-2.13-0.52.fc7 has been pushed to the Fedora 7 stable repository. If problems still persist, please make note of it in this bug report.
> ------- Additional Comments From updates 2007-07-18 16:57 EST ------- > util-linux-2.13-0.52.fc7 has been pushed to the Fedora 7 stable > repository. If problems still persist, please make note of it in this > bug report. Problem should be still persist, it was noted in comment #18.
Btw, thinking on the issue a bit and contrary to my opinion above, I also think that this should be entirely fixed in util-linux, not FUSE. See Miklos' argument above.
This message is a reminder that Fedora 7 is nearing the end of life. Approximately 30 (thirty) days from now Fedora will stop maintaining and issuing updates for Fedora 7. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as WONTFIX if it remains open with a Fedora 'version' of '7'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version prior to Fedora 7's end of life. Bug Reporter: Thank you for reporting this issue and we are sorry that we may not be able to fix it before Fedora 7 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora please change the 'version' of this bug. If you are unable to change the version, please add a comment here and someone will do it for you. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete. If possible, it is recommended that you try the newest available Fedora distribution to see if your bug still exists. Please read the Release Notes for the newest Fedora distribution to make sure it will meet your needs: http://docs.fedoraproject.org/release-notes/ The process we are following is described here: http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Fedora 7 changed to end-of-life (EOL) status on June 13, 2008. Fedora 7 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug. If you can reproduce this bug against a currently maintained version of Fedora please feel free to reopen this bug against that version. Thank you for reporting this bug and we are sorry it could not be fixed.