2005-11-27 21:54:13

by Andries E. Brouwer

[permalink] [raw]
Subject: umount

Recently I have seen cases where I/O to a device with bad media
was never noticed (except in the syslog). I think that is bad.
The application writes, but the stuff written lives in buffers.
The close() still does not force file I/O.
But the umount() causes the I/O to happen. Writes fail and the
syslog is full of messages. But the user does not see any messages,
the umount returns without error, and there is no reason to suspect
that anything is wrong.

I am not sure about the correct solution.
Perhaps umount should return -EIO if it did the umount but
I/O errors happened?

Andries


2005-11-28 00:45:43

by Grant Coady

[permalink] [raw]
Subject: Re: umount

On Sun, 27 Nov 2005 22:54:11 +0100 (MET), <[email protected]> wrote:

>Recently I have seen cases where I/O to a device with bad media
>was never noticed (except in the syslog). I think that is bad.
>The application writes, but the stuff written lives in buffers.
>The close() still does not force file I/O.
>But the umount() causes the I/O to happen. Writes fail and the
>syslog is full of messages. But the user does not see any messages,
>the umount returns without error, and there is no reason to suspect
>that anything is wrong.
>
>I am not sure about the correct solution.
>Perhaps umount should return -EIO if it did the umount but
>I/O errors happened?

I wrote a bad boot disk recently, then I write; sync; cmp until
floppy image matched source, a user can do that if they care...

Related: observed that a USB CompactFlash adapter under windows,
the device light goes out when unmounted, but under linux the
light stays on after umount, this seems bad from usability perspective.

It leaves me with a little distrust of linux' handling of non-locked
removable media (as opposed to lockable media like a zipdisk or cdrom).

Grant.

2005-11-28 01:42:29

by Mark Knecht

[permalink] [raw]
Subject: Re: umount

On 11/27/05, Grant Coady <[email protected]> wrote:
>
> It leaves me with a little distrust of linux' handling of non-locked
> removable media (as opposed to lockable media like a zipdisk or cdrom).
>
> Grant.

Under Windows, if a 1394 drive is unplugged without unmounting, it you
get a pop up dialog on screen telling you that data may be lost, etc.
while under any of the main environments I've tried under Linux
(Gnome, KDE, fluxbox) there are no such messages to the user. I have
not investigated log files very deeply, other than to say that dmesg
will show the drive going away but doesn't say it was a problem.

I realize it's probably 100x more difficult to do this under Linux, at
least at the gui level, but I agree with your main point that my trust
factor is just a bit lower here.

- Mark

2005-11-28 02:01:14

by Patrick McFarland

[permalink] [raw]
Subject: Re: umount

On Sunday 27 November 2005 20:42, Mark Knecht wrote:
> On 11/27/05, Grant Coady <[email protected]> wrote:
> > It leaves me with a little distrust of linux' handling of non-locked
> > removable media (as opposed to lockable media like a zipdisk or cdrom).
> >
> > Grant.
>
> Under Windows, if a 1394 drive is unplugged without unmounting, it you
> get a pop up dialog on screen telling you that data may be lost, etc.
> while under any of the main environments I've tried under Linux
> (Gnome, KDE, fluxbox) there are no such messages to the user. I have
> not investigated log files very deeply, other than to say that dmesg
> will show the drive going away but doesn't say it was a problem.
>
> I realize it's probably 100x more difficult to do this under Linux, at
> least at the gui level, but I agree with your main point that my trust
> factor is just a bit lower here.

No, WIndows says that because it is unable to mount a partition as sync,
unlike Linux. Linux Desktop Environments simply don't tell the user because
no data is lost if they unplug the media.

--
Patrick "Diablo-D3" McFarland || [email protected]
"Computer games don't affect kids; I mean if Pac-Man affected us as kids,
we'd all be running around in darkened rooms, munching magic pills and
listening to repetitive electronic music." -- Kristian Wilson, Nintendo,
Inc, 1989

2005-11-28 07:15:55

by Jim Crilly

[permalink] [raw]
Subject: Re: umount

On 11/27/05 09:01:07PM -0500, Patrick McFarland wrote:
> On Sunday 27 November 2005 20:42, Mark Knecht wrote:
> > On 11/27/05, Grant Coady <[email protected]> wrote:
> > > It leaves me with a little distrust of linux' handling of non-locked
> > > removable media (as opposed to lockable media like a zipdisk or cdrom).
> > >
> > > Grant.
> >
> > Under Windows, if a 1394 drive is unplugged without unmounting, it you
> > get a pop up dialog on screen telling you that data may be lost, etc.
> > while under any of the main environments I've tried under Linux
> > (Gnome, KDE, fluxbox) there are no such messages to the user. I have
> > not investigated log files very deeply, other than to say that dmesg
> > will show the drive going away but doesn't say it was a problem.
> >
> > I realize it's probably 100x more difficult to do this under Linux, at
> > least at the gui level, but I agree with your main point that my trust
> > factor is just a bit lower here.
>
> No, WIndows says that because it is unable to mount a partition as sync,
> unlike Linux. Linux Desktop Environments simply don't tell the user because
> no data is lost if they unplug the media.

Both of those statements are not true. At least in XP removable media is
mounted sync by default, you have to go into the device manager and toggle
a radio button to "optimize for performance" before it'll do async writes.
I think the setting was the opposite in Win2K but I can't say for sure.

And even with sync writes it's possible to unplug the drive before the
write completes and if the drive is powered by USB there's no way to know
just how much data made it to disk. Ideally the kernel would emit some
message so that HAL or something can catch it and popup a message or
something.

>
> --
> Patrick "Diablo-D3" McFarland || [email protected]
> "Computer games don't affect kids; I mean if Pac-Man affected us as kids,
> we'd all be running around in darkened rooms, munching magic pills and
> listening to repetitive electronic music." -- Kristian Wilson, Nintendo,
> Inc, 1989
>

Jim.

2005-11-28 17:20:07

by Mark Knecht

[permalink] [raw]
Subject: Re: umount

On 11/27/05, Jim Crilly <[email protected]> wrote:
> On 11/27/05 09:01:07PM -0500, Patrick McFarland wrote:
> > On Sunday 27 November 2005 20:42, Mark Knecht wrote:
> > > On 11/27/05, Grant Coady <[email protected]> wrote:
> > > > It leaves me with a little distrust of linux' handling of non-locked
> > > > removable media (as opposed to lockable media like a zipdisk or cdrom).
> > > >
> > > > Grant.
> > >
> > > Under Windows, if a 1394 drive is unplugged without unmounting, it you
> > > get a pop up dialog on screen telling you that data may be lost, etc.
> > > while under any of the main environments I've tried under Linux
> > > (Gnome, KDE, fluxbox) there are no such messages to the user. I have
> > > not investigated log files very deeply, other than to say that dmesg
> > > will show the drive going away but doesn't say it was a problem.
> > >
> > > I realize it's probably 100x more difficult to do this under Linux, at
> > > least at the gui level, but I agree with your main point that my trust
> > > factor is just a bit lower here.
> >
> > No, WIndows says that because it is unable to mount a partition as sync,
> > unlike Linux. Linux Desktop Environments simply don't tell the user because
> > no data is lost if they unplug the media.
>
> Both of those statements are not true.

Jim,
I'm not clear if 'both statements' included any of mine or not? :-)

You discussed the event I was thinking of. I am writing to a 1394
drive, bus powered or not, and while the write is occuring I unplug
the cable. Clearly the data being written is not going to finish, and
that's expected, but the 'reduced confidence' issue is that I'm not
told directly of the event. Granted I'll eventually discover it in
some indrect manner, like a GUI action failing or something timing
out. However in Windows I do appreciate the clear message that this
has happened.

Thanks,
Mark

> At least in XP removable media is
> mounted sync by default, you have to go into the device manager and toggle
> a radio button to "optimize for performance" before it'll do async writes.
> I think the setting was the opposite in Win2K but I can't say for sure.
>
> And even with sync writes it's possible to unplug the drive before the
> write completes and if the drive is powered by USB there's no way to know
> just how much data made it to disk. Ideally the kernel would emit some
> message so that HAL or something can catch it and popup a message or
> something.
>
>
> Jim.
>

2005-11-28 17:51:58

by linux-os (Dick Johnson)

[permalink] [raw]
Subject: Re: umount


On Mon, 28 Nov 2005, Mark Knecht wrote:

> On 11/27/05, Jim Crilly <[email protected]> wrote:
>> On 11/27/05 09:01:07PM -0500, Patrick McFarland wrote:
>>> On Sunday 27 November 2005 20:42, Mark Knecht wrote:
>>>> On 11/27/05, Grant Coady <[email protected]> wrote:
>>>>> It leaves me with a little distrust of linux' handling of non-locked
>>>>> removable media (as opposed to lockable media like a zipdisk or cdrom).
>>>>>
>>>>> Grant.
>>>>
>>>> Under Windows, if a 1394 drive is unplugged without unmounting, it you
>>>> get a pop up dialog on screen telling you that data may be lost, etc.
>>>> while under any of the main environments I've tried under Linux
>>>> (Gnome, KDE, fluxbox) there are no such messages to the user. I have
>>>> not investigated log files very deeply, other than to say that dmesg
>>>> will show the drive going away but doesn't say it was a problem.
>>>>
>>>> I realize it's probably 100x more difficult to do this under Linux, at
>>>> least at the gui level, but I agree with your main point that my trust
>>>> factor is just a bit lower here.
>>>
>>> No, WIndows says that because it is unable to mount a partition as sync,
>>> unlike Linux. Linux Desktop Environments simply don't tell the user because
>>> no data is lost if they unplug the media.
>>
>> Both of those statements are not true.
>
> Jim,
> I'm not clear if 'both statements' included any of mine or not? :-)
>
> You discussed the event I was thinking of. I am writing to a 1394
> drive, bus powered or not, and while the write is occuring I unplug
> the cable. Clearly the data being written is not going to finish, and
> that's expected, but the 'reduced confidence' issue is that I'm not
> told directly of the event. Granted I'll eventually discover it in
> some indrect manner, like a GUI action failing or something timing
> out. However in Windows I do appreciate the clear message that this
> has happened.
>
> Thanks,
> Mark
>

Doesn't your GUI show a 'console' window? I don't use the GUI,
but the last time I checked, there was a 'console' window that
showed the error messages. This was standard with Sun.

If you can find the 'console' window in your distribution, activate
it. If it doesn't have one, contact your vendor or make one. There
needs to be some visible evidence that something is going wrong.

Although the messages may 'come from' the kernel, they are not
produced by the kernel. It is not the responsibility of the kernel
to display messages. The kernel writes those messages to a virtual
file, /proc/kmsg. It is, again, user-mode code that is supposed
to put those messages someplace useful. If the user-mode code
isn't doing that, contact your vendor. On this distribution,
syslogd reads /proc/kmsg and writes formatted data to /dev/console
and to various log-files so there already is a daemon that is
supposed to handle this.

A 'console' program, trivially reads /dev/console and writes
to STDOUT_FILENO. That will get all the messages onto your GUI
screen.


>> At least in XP removable media is
>> mounted sync by default, you have to go into the device manager and toggle
>> a radio button to "optimize for performance" before it'll do async writes.
>> I think the setting was the opposite in Win2K but I can't say for sure.
>>
>> And even with sync writes it's possible to unplug the drive before the
>> write completes and if the drive is powered by USB there's no way to know
>> just how much data made it to disk. Ideally the kernel would emit some
>> message so that HAL or something can catch it and popup a message or
>> something.
>>
>>
>> Jim.
>>
> -
> 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/
>

Cheers,
Dick Johnson
Penguin : Linux version 2.6.13.4 on an i686 machine (5589.55 BogoMips).
Warning : 98.36% of all statistics are fiction.
.

****************************************************************
The information transmitted in this message is confidential and may be privileged. Any review, retransmission, dissemination, or other use of this information by persons or entities other than the intended recipient is prohibited. If you are not the intended recipient, please notify Analogic Corporation immediately - by replying to this message or by sending an email to [email protected] - and destroy all copies of this information, including any attachments, without reading or disclosing them.

Thank you.

2005-11-28 21:08:42

by Bill Davidsen

[permalink] [raw]
Subject: Re: umount

linux-os (Dick Johnson) wrote:
> On Mon, 28 Nov 2005, Mark Knecht wrote:
>
>
>>On 11/27/05, Jim Crilly <[email protected]> wrote:
>>
>>>On 11/27/05 09:01:07PM -0500, Patrick McFarland wrote:
>>>
>>>>On Sunday 27 November 2005 20:42, Mark Knecht wrote:
>>>>
>>>>>On 11/27/05, Grant Coady <[email protected]> wrote:
>>>>>
>>>>>>It leaves me with a little distrust of linux' handling of non-locked
>>>>>>removable media (as opposed to lockable media like a zipdisk or cdrom).
>>>>>>
>>>>>>Grant.
>>>>>
>>>>>Under Windows, if a 1394 drive is unplugged without unmounting, it you
>>>>>get a pop up dialog on screen telling you that data may be lost, etc.
>>>>>while under any of the main environments I've tried under Linux
>>>>>(Gnome, KDE, fluxbox) there are no such messages to the user. I have
>>>>>not investigated log files very deeply, other than to say that dmesg
>>>>>will show the drive going away but doesn't say it was a problem.
>>>>>
>>>>>I realize it's probably 100x more difficult to do this under Linux, at
>>>>>least at the gui level, but I agree with your main point that my trust
>>>>>factor is just a bit lower here.
>>>>
>>>>No, WIndows says that because it is unable to mount a partition as sync,
>>>>unlike Linux. Linux Desktop Environments simply don't tell the user because
>>>>no data is lost if they unplug the media.
>>>
>>>Both of those statements are not true.
>>
>>Jim,
>> I'm not clear if 'both statements' included any of mine or not? :-)
>>
>> You discussed the event I was thinking of. I am writing to a 1394
>>drive, bus powered or not, and while the write is occuring I unplug
>>the cable. Clearly the data being written is not going to finish, and
>>that's expected, but the 'reduced confidence' issue is that I'm not
>>told directly of the event. Granted I'll eventually discover it in
>>some indrect manner, like a GUI action failing or something timing
>>out. However in Windows I do appreciate the clear message that this
>>has happened.
>>
>>Thanks,
>>Mark
>>
>
>
> Doesn't your GUI show a 'console' window? I don't use the GUI,
> but the last time I checked, there was a 'console' window that
> showed the error messages. This was standard with Sun.
>
> If you can find the 'console' window in your distribution, activate
> it. If it doesn't have one, contact your vendor or make one. There
> needs to be some visible evidence that something is going wrong.

xterm -C


--
-bill davidsen ([email protected])
"The secret to procrastination is to put things off until the
last possible moment - but no longer" -me

2005-11-28 21:16:40

by linux-os (Dick Johnson)

[permalink] [raw]
Subject: Re: umount


On Mon, 28 Nov 2005, Bill Davidsen wrote:

> linux-os (Dick Johnson) wrote:
>> On Mon, 28 Nov 2005, Mark Knecht wrote:
>>
>>
>>> On 11/27/05, Jim Crilly <[email protected]> wrote:
>>>
>>>> On 11/27/05 09:01:07PM -0500, Patrick McFarland wrote:
>>>>
>>>>> On Sunday 27 November 2005 20:42, Mark Knecht wrote:
>>>>>
>>>>>> On 11/27/05, Grant Coady <[email protected]> wrote:
>>>>>>
>>>>>>> It leaves me with a little distrust of linux' handling of non-locked
>>>>>>> removable media (as opposed to lockable media like a zipdisk or cdrom).
>>>>>>>
>>>>>>> Grant.
>>>>>>
>>>>>> Under Windows, if a 1394 drive is unplugged without unmounting, it you
>>>>>> get a pop up dialog on screen telling you that data may be lost, etc.
>>>>>> while under any of the main environments I've tried under Linux
>>>>>> (Gnome, KDE, fluxbox) there are no such messages to the user. I have
>>>>>> not investigated log files very deeply, other than to say that dmesg
>>>>>> will show the drive going away but doesn't say it was a problem.
>>>>>>
>>>>>> I realize it's probably 100x more difficult to do this under Linux, at
>>>>>> least at the gui level, but I agree with your main point that my trust
>>>>>> factor is just a bit lower here.
>>>>>
>>>>> No, WIndows says that because it is unable to mount a partition as sync,
>>>>> unlike Linux. Linux Desktop Environments simply don't tell the user because
>>>>> no data is lost if they unplug the media.
>>>>
>>>> Both of those statements are not true.
>>>
>>> Jim,
>>> I'm not clear if 'both statements' included any of mine or not? :-)
>>>
>>> You discussed the event I was thinking of. I am writing to a 1394
>>> drive, bus powered or not, and while the write is occuring I unplug
>>> the cable. Clearly the data being written is not going to finish, and
>>> that's expected, but the 'reduced confidence' issue is that I'm not
>>> told directly of the event. Granted I'll eventually discover it in
>>> some indrect manner, like a GUI action failing or something timing
>>> out. However in Windows I do appreciate the clear message that this
>>> has happened.
>>>
>>> Thanks,
>>> Mark
>>>
>>
>>
>> Doesn't your GUI show a 'console' window? I don't use the GUI,
>> but the last time I checked, there was a 'console' window that
>> showed the error messages. This was standard with Sun.
>>
>> If you can find the 'console' window in your distribution, activate
>> it. If it doesn't have one, contact your vendor or make one. There
>> needs to be some visible evidence that something is going wrong.
>
> xterm -C
>

Right! Thanks.

>
> --
> -bill davidsen ([email protected])
> "The secret to procrastination is to put things off until the
> last possible moment - but no longer" -me
>

Cheers,
Dick Johnson
Penguin : Linux version 2.6.13.4 on an i686 machine (5589.55 BogoMips).
Warning : 98.36% of all statistics are fiction.
.

****************************************************************
The information transmitted in this message is confidential and may be privileged. Any review, retransmission, dissemination, or other use of this information by persons or entities other than the intended recipient is prohibited. If you are not the intended recipient, please notify Analogic Corporation immediately - by replying to this message or by sending an email to [email protected] - and destroy all copies of this information, including any attachments, without reading or disclosing them.

Thank you.

2005-11-29 00:11:20

by Mark Knecht

[permalink] [raw]
Subject: Re: umount

On 11/28/05, linux-os (Dick Johnson) <[email protected]> wrote:
>
> On Mon, 28 Nov 2005, Mark Knecht wrote:
>
> > On 11/27/05, Jim Crilly <[email protected]> wrote:
> >> On 11/27/05 09:01:07PM -0500, Patrick McFarland wrote:
> >>> On Sunday 27 November 2005 20:42, Mark Knecht wrote:
> >>>> On 11/27/05, Grant Coady <[email protected]> wrote:
> >>>>> It leaves me with a little distrust of linux' handling of non-locked
> >>>>> removable media (as opposed to lockable media like a zipdisk or cdrom).
> >>>>>
> >>>>> Grant.
> >>>>
> >>>> Under Windows, if a 1394 drive is unplugged without unmounting, it you
> >>>> get a pop up dialog on screen telling you that data may be lost, etc.
> >>>> while under any of the main environments I've tried under Linux
> >>>> (Gnome, KDE, fluxbox) there are no such messages to the user. I have
> >>>> not investigated log files very deeply, other than to say that dmesg
> >>>> will show the drive going away but doesn't say it was a problem.
> >>>>
> >>>> I realize it's probably 100x more difficult to do this under Linux, at
> >>>> least at the gui level, but I agree with your main point that my trust
> >>>> factor is just a bit lower here.
> >>>
> >>> No, WIndows says that because it is unable to mount a partition as sync,
> >>> unlike Linux. Linux Desktop Environments simply don't tell the user because
> >>> no data is lost if they unplug the media.
> >>
> >> Both of those statements are not true.
> >
> > Jim,
> > I'm not clear if 'both statements' included any of mine or not? :-)
> >
> > You discussed the event I was thinking of. I am writing to a 1394
> > drive, bus powered or not, and while the write is occuring I unplug
> > the cable. Clearly the data being written is not going to finish, and
> > that's expected, but the 'reduced confidence' issue is that I'm not
> > told directly of the event. Granted I'll eventually discover it in
> > some indrect manner, like a GUI action failing or something timing
> > out. However in Windows I do appreciate the clear message that this
> > has happened.
> >
> > Thanks,
> > Mark
> >
>
> Doesn't your GUI show a 'console' window?

No, Gnome does not, by default, show a console window. Many GUI based
users like me, coming from Windows a couple of years ago, prefer to
remain GUI based. I don't open termainals except to build kernels and
do system admin stuff. Most all of my day to day like is spent in the
GUI or in graphical applications. I move files, change permissions,
etc., in GUI apps, at least most of the time. I know that's going to
be pretty foreign to many old timers here, and that's cool, but I'm
just saying that this is the way it is for me.

Please note that I didn't say the info wasn't available. The info is
available in dmesg and I know to go look there. The point I was making
is that as a user I get no specific GUI level messages about this sort
of problem like I do in Windows and I think as more Windows folks come
to Linux there will be times they do not know what's going on.

<SNIP>
>
> Although the messages may 'come from' the kernel, they are not
> produced by the kernel. It is not the responsibility of the kernel
> to display messages.

Yes, I understand that. As I said in my first post, I think it would
be quite difficult to guarantee that every GUI environment running
under a Linux kernel handle stuff like this. I think it's enough that
the kernel makes the message available to the GUI developers. I would
hope that one day the GUI developers see the value of messages like
this from a user POV. To often the developers don't see things the way
new users see (or don't see!) things so the learning curve is pretty
steep.

Maybe one thing kernel messages could do is identify which ones really
should be driven up to the user level, if possible. I wouldn't have a
clue what to do for someone not using a GUI, but getting a dialog
based message about a system hardware problem seems pretty freindly to
a user like me.

Thanks,
Mark

2005-11-29 01:16:41

by Steve French

[permalink] [raw]
Subject: Re: umount

> >>>> drive is unplugged without unmounting, it you
> >>>> get a pop up dialog on screen telling you that data may be lost, etc.
> >>>> while under any of the main environments I've tried under Linux
> >>>> (Gnome, KDE, fluxbox) there are no such messages to the user.

I get somewhat similar feedback from users who would like to see more informative
user notification when other types of "removeable media" e.g a network mount
are temporarily or permanently unavailable. An interesting example which can be
quite damaging is the case of password expiration when a user is mounted from
two systems ... if the session to the server ever drops from the other machine the reconnection
retries on machine one (with the bad password) silently cause the account to be locked on the server
if the user changed his password from the second machine. There is no particularly good way to
tell the user "your password is expired or changed and I can't reconnect you to the server to
write out this file until you tell me what the right password is" without some integration
with the desktop.

Obviously MacOS, OS/2, Windows etc. had a head start on this kind of usability, but it would
be nice to talk with the KDE or Gnome people about what their needs are in this area -
another example which comes up from time to time is that KDE and Gnome have no way on Linux
to detect or represent an "offline" file (ie a file which is on some HSM, such as a slow tape)
that looks different from other files when browsing around in the standard file managers
(this would be easy enough to do by query xattrs as XFS and JFS apparently stored information along
these lines in xattrs at one point). These kinds of files show up with a different icon in
other desktops and it is important for some types of users to be able to tell which files or directories
are "slow" to retrieve (offline).