the umount() saga for regular linux desktop users
Hi
I am a linux desktop user. I love linux and all the wonderfull open-source/free software that comes with it... blah, blah, blah :). The following comments and suggestions about umount() stem from personal experience and are meant as friendly feedback for all you clever people. (I wish I understook how the kernel works)
Regularly, when attempting to umount() a filesystem I receive 'device is busy' errors. The only way (that I have found) to solve these problems is to go on a journey into processland and kill all the guilty ones that have tied themselves to the filesystem concerned.
In order to help solve this problem is it possible to modify the behaviour of the linux kernel.
In my opinion, in order for linux to be trully user friendly, "a umount() should NEVER fail" (even if the device containing the filesystem is no longuer attached to the system). The kernel should do it's best to satisfy the umount request and cleanup. Maybe the kernel could try some of the following:
1) if the device containing the filesystem (for local filesystems) is no longer physicaly attached to the system: revoke all process access to the filesystem and umount. Notify umount that the filesystem was not cleanly umounted.
2) notify all processes attached to the filesystem that they must release control of it.
3) the processes may respond to the notifications and request time to clean up in order to read/write any remaining data.
4) processes that do not respond within a given time-frame should have their filesystem access revoked.
5) once all the clean up has finnished... umount the filesystem.....
I am not subscribed to the list so please email me on [email protected]
Kind Regards
William Heyland
the new "a umount() should NEVER fail" campaign launched by me on december the 31 of 2004. Just in time for new year ;-)
PS: I am currently teaching myself about kernels in general and am hoping to start contributing to linux soon. But until then... if the kernel can't handle a umount() then nothing in userspace can do any better... rant, rant, rant, ... make umount() smarter.... Please?
Quoted 8 lines · William
Hi
I am a linux desktop user. I love linux and all the wonderfull open-source/free software that comes with it... blah, blah, blah :). The following comments and suggestions about
umount()stem from personal experience and are meant as friendly feedback for all you clever people. (I wish I understook how the kernel works)
Quoted 7 lines
Regularly, when attempting to
umount()a filesystem I receive 'device is busy' errors. The only way (that I have found) to solve these problems is to go on a journey into processland and kill all the guilty ones that have tied themselves to the filesystem concerned.In order to help solve this problem is it possible to modify the behaviour of the linux kernel.
what you describe is almost like lazy umounting.. which I think comes quite close...
Quoted 4 lines · William
Regularly, when attempting to
umount()a filesystem I receive 'device is busy' errors. The only way (that I have found) to solve these problems is to go on a journey into processland and kill all the guilty ones that have tied themselves to the filesystem concerned.
Even a lazy umount doesn't work? "umount -l <filesystem-name>"
Quoted 5 lines
In my opinion, in order for linux to be trully user friendly, "a
umount()should NEVER fail" (even if the device containing the filesystem is no longuer attached to the system). The kernel should do it's best to satisfy the umount request and cleanup. Maybe the kernel could try some of the following:
Would it be user-friendly if this forcible umount caused the user to lose data?
Oisin
Quoted 1 line · Ush
On Fri, 31 Dec 2004 17:41:02 +0000, William <[email protected]>
Quoted 8 lines · wrote:
Quoted 5 lines
Regularly, when attempting to
umount()a filesystem I receive 'device is busy' errors. The only way (that I have found) to solve these problems is to go on a journey into processland and kill all the guilty ones that have tied themselves to the filesystem concerned.Even a lazy umount doesn't work? "umount -l <filesystem-name>"
Quoted 8 lines
Quoted 5 lines
In my opinion, in order for linux to be trully user friendly, "a
umount()should NEVER fail" (even if the device containing the filesystem is no longuer attached to the system). The kernel should do it's best to satisfy the umount request and cleanup. Maybe the kernel could try some of the following:Would it be user-friendly if this forcible umount caused the user to lose data?
No, it wouldn't be user friendly, but it would sure be user educational when he asked why his resume dissappeared.
Let me toss this out for discussion.
There are some times when the usual 5 second flush schedule should be tossed out the window, and the data written immediately. A quickly unpluggable usb memory dongle is a prime candidate to bite the user precisely where it hurts. Floppies also fit this same scenario, I don't know at the times I've written an image with dd, got up out of my chair and went to the machine and slapped the eject button to discover to my horror, that when my hand came away from the button with disk in hand, the frigging access led was now on that wasn't when I tapped the button.
Usually just re-inserting the disk allows the write to continue and nothing is lost. But I've learned to do a couple of sync's and the umount before pulling the disk. But theres a whole lot more protocol to doing that with a usb device.
Thats one of the things that could be done to improve the user friendliness of linux. Really Old Hands are used to those limits, but newbies just coming in from the dark side are not impressed when its something like that as nearly their first exposure to linux.
Quoted 6 lines
Oisin
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Signature · 8 lines
Cheers, Gene "There are four boxes to be used in defense of liberty: soap, ballot, jury, and ammo. Please use in that order." -Ed Howdershelt (Author) 99.31% setiathome rank, not too shabby for a WV hillbilly Yahoo.com attorneys please note, additions to this message by Gene Heskett are: Copyright 2004 by Maurice Eugene Heskett, all rights reserved.
In article <[email protected]>,
Quoted 11 lines · Gene Heskett
Let me toss this out for discussion.
There are some times when the usual 5 second flush schedule should be tossed out the window, and the data written immediately. A quickly unpluggable usb memory dongle is a prime candidate to bite the user precisely where it hurts. Floppies also fit this same scenario, I don't know at the times I've written an image with dd, got up out of my chair and went to the machine and slapped the eject button to discover to my horror, that when my hand came away from the button with disk in hand, the frigging access led was now on that wasn't when I tapped the button.
Google for "supermount".
Mike.
Quoted 9 lines · Gene Heskett
There are some times when the usual 5 second flush schedule should be tossed out the window, and the data written immediately. A quickly unpluggable usb memory dongle is a prime candidate to bite the user precisely where it hurts. Floppies also fit this same scenario, I don't know at the times I've written an image with dd, got up out of my chair and went to the machine and slapped the eject button to discover to my horror, that when my hand came away from the button with disk in hand, the frigging access led was now on that wasn't when I tapped the button.
For that you should add "sync" as an option when mounting the filesystem, in which case writes won't return until the data has actually been written. man mount doesn't mention that being implemented for FAT, though - is that accurate, and if so, shouldn't it be?
Signature · 4 lines
Tom Felker, <[email protected]> <http://vlevel.sourceforge.net> - Stop fiddling with the volume knob. McBride: "I have here in my hand a list of two hundred and five..."
Quoted 11 lines · Tom Felker
Quoted 9 lines · Gene Heskett
There are some times when the usual 5 second flush schedule should be tossed out the window, and the data written immediately. A quickly unpluggable usb memory dongle is a prime candidate to bite the user precisely where it hurts. Floppies also fit this same scenario, I don't know at the times I've written an image with dd, got up out of my chair and went to the machine and slapped the eject button to discover to my horror, that when my hand came away from the button with disk in hand, the frigging access led was now on that wasn't when I tapped the button.
Quoted 5 lines
For that you should add "sync" as an option when mounting the filesystem, in which case writes won't return until the data has actually been written. man mount doesn't mention that being implemented for FAT, though - is that accurate, and if so, shouldn't it be?
Don't know about vfat, which is how I mount a floppy, but I just put that in the options list in /etc/fstab & will test it the next time I need to sneakernet something small around here. Many thanks for what might be a valuable bit of info!
Signature · 8 lines
Cheers, Gene "There are four boxes to be used in defense of liberty: soap, ballot, jury, and ammo. Please use in that order." -Ed Howdershelt (Author) 99.31% setiathome rank, not too shabby for a WV hillbilly Yahoo.com attorneys please note, additions to this message by Gene Heskett are: Copyright 2004 by Maurice Eugene Heskett, all rights reserved.
Quoted 4 lines · William
Regularly, when attempting to
umount()a filesystem I receive 'device is busy' errors. The only way (that I have found) to solve these problems is to go on a journey into processland and kill all the guilty ones that have tied themselves to the filesystem concerned.
Do you know about the existence of the MNT_DETACH flag of umount(2), or the -l option of umount(8)?
It seems that does at least some of the things you are asking for.
Andries
Quoted 10 lines · Andries Brouwer
Quoted 1 line · William
Regularly, when attempting to
umount()a filesystem I receive 'device is busy' errors. The only way (that I have found) to solve these problems is to go on a journey into processland and kill all the guilty ones that have tied themselves to the filesystem concerned.Do you know about the existence of the
MNT_DETACHflag of umount(2), or the -l option of umount(8)?It seems that does at least some of the things you are asking for.
I have this complaint too, and MNT_DETACH doesn't really do it. Sometimes I want to "unmount cleanly, damnit, and I don't care if applications that are currently accessing it lose data." Windows can do this, and it's _useful_.
<rant>
I think part of the nastiness is that mount now means too things:
1) Read the superblock, fire up the fs, etc.
2) Shove the thing into the namespace.
The fact that the current mount/umount interface papers over the distinction is at least confusing. It made sense before there were bind mounts. Now, for example, mount /dev/hda2 /mnt/whatever does something _different_ depending on whether hda2 is already mounted. And the mount options will be silently ignored sometimes. Then, I can MNT_DETACH something to separate it from the namespace, but I can't force it to actually shut down the fs. There is no interface for it.
Shouldn't these be separate syscalls with separate parameters? For example, ro applied to the fs should mean "don't touch the device" and ro applied to the view in the namespace should mean "don't write to this view." </rant>
Quoted 8 lines · William
Hi
I am a linux desktop user. I love linux and all the wonderfull open-source/free software that comes with it... blah, blah, blah :). The following comments and suggestions about
umount()stem from personal experience and are meant as friendly feedback for all you clever people. (I wish I understook how the kernel works)
Quoted 6 lines
Regularly, when attempting to
umount()a filesystem I receive 'device is busy' errors. The only way (that I have found) to solve these problems is to go on a journey into processland and kill all the guilty ones that have tied themselves to the filesystem concerned.
If you are running kernel.org kernels, the fix is to update to at least 2.6.10-ac1, where much of this malarkey, particularly with regard to samba, has been attended to.
Quoted 45 lines
In order to help solve this problem is it possible to modify the behaviour of the linux kernel.
In my opinion, in order for linux to be trully user friendly, "a
umount()should NEVER fail" (even if the device containing the filesystem is no longuer attached to the system). The kernel should do it's best to satisfy the umount request and cleanup. Maybe the kernel could try some of the following:1) if the device containing the filesystem (for local filesystems) is no longer physicaly attached to the system: revoke all process access to the filesystem and umount. Notify umount that the filesystem was not cleanly umounted.
2) notify all processes attached to the filesystem that they must release control of it.
3) the processes may respond to the notifications and request time to clean up in order to read/write any remaining data.
4) processes that do not respond within a given time-frame should have their filesystem access revoked.
5) once all the clean up has finnished... umount the filesystem.....
I am not subscribed to the list so please email me on [email protected]
Kind Regards
William Heylandthe new "a
umount()should NEVER fail" campaign launched by me on december the 31 of 2004. Just in time for new year ;-)PS: I am currently teaching myself about kernels in general and am hoping to start contributing to linux soon. But until then... if the kernel can't handle a
umount()then nothing in userspace can do any better... rant, rant, rant, ... makeumount()smarter.... Please?
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Signature · 8 lines
Cheers, Gene "There are four boxes to be used in defense of liberty: soap, ballot, jury, and ammo. Please use in that order." -Ed Howdershelt (Author) 99.31% setiathome rank, not too shabby for a WV hillbilly Yahoo.com attorneys please note, additions to this message by Gene Heskett are: Copyright 2004 by Maurice Eugene Heskett, all rights reserved.
Quoted 5 lines · William
In my opinion, in order for linux to be trully user friendly, "a
umount()should NEVER fail" (even if the device containing the filesystem is no longuer attached to the system). The kernel should do it's best to satisfy the umount request and cleanup. Maybe the kernel could try some of the following:
What you're asking for is for the umount -f option to be supported. This isn't a new fangled idea. BSD supported has supported it since sometime in the last millennium. Seriously, it's pretty basic functionality and really ought to be supported.
The semantics of umount -f are simpler than you make it sound. It just unmounts the file system normally and revokes any file descriptors for that file system. Any further i/o on those file descriptors just gets an error (EINVAL I expect).
This is one of my biggest pet peeves about Linux.
Signature · 1 line
greg