Skip to contentSkip to conversation

umount

DISCUSSION [email protected] 7 participants 10 messages Nov 27, 2005 – Nov 29, 2005

lore
Share & tools
lore
#0 lore raw

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

#1 lore raw
Quoted 9 lines · 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.

Quoted 3 lines

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.

#2 lore raw
Quoted 5 lines · Grant Coady

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

#3 lore raw
Quoted 13 lines · Mark Knecht
Quoted 4 lines · Grant Coady

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.

Quoted 3 lines

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.

Signature · 5 lines
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
#4 lore raw
Quoted 14 lines · Patrick McFarland
Quoted 13 lines · Mark Knecht
Quoted 4 lines · Grant Coady

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.

Quoted 7 lines
Quoted 3 lines

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.

Quoted 8 lines
Signature · 6 lines
-- 
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.

#5 lore raw
Quoted 19 lines · Jim Crilly
Quoted 18 lines · Patrick McFarland
Quoted 16 lines · Mark Knecht
Quoted 4 lines · Grant Coady

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.

Quoted 5 lines
Quoted 3 lines

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

Quoted 14 lines

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.

#6 lore raw
Quoted 38 lines · Mark Knecht
Quoted 19 lines · Jim Crilly
Quoted 18 lines · Patrick McFarland
Quoted 16 lines · Mark Knecht
Quoted 4 lines · Grant Coady

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.

Quoted 5 lines
Quoted 3 lines

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.

Quoted 3 lines

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.

Quoted 12 lines
Quoted 12 lines

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.

Quoted 8 lines
Quoted 2 lines

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.

#7 lore raw
Quoted 50 lines · linux-os (Dick Johnson)
Quoted 42 lines · Mark Knecht
Quoted 22 lines · Jim Crilly
Quoted 20 lines · Patrick McFarland
Quoted 17 lines · Mark Knecht
Quoted 4 lines · Grant Coady

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.

Quoted 5 lines
Quoted 3 lines

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.

Quoted 3 lines

Thanks,
Mark

Quoted 7 lines

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

Signature · 3 lines
   -bill davidsen ([email protected])
"The secret to procrastination is to put things off until the
 last possible moment - but no longer"  -me
#8 lore raw
Quoted 55 lines · Bill Davidsen
Quoted 54 lines · linux-os (Dick Johnson)
Quoted 42 lines · Mark Knecht
Quoted 22 lines · Jim Crilly
Quoted 20 lines · Patrick McFarland
Quoted 17 lines · Mark Knecht
Quoted 4 lines · Grant Coady

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.

Quoted 5 lines
Quoted 3 lines

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.

Quoted 3 lines

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.

Quoted 6 lines
Quoted 3 lines

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.

Quoted 6 lines

--
-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.

#9 lore raw
In reply to linux-os (Dick Johnson)
Quoted 41 lines · linux-os (Dick Johnson)
Quoted 38 lines · Mark Knecht
Quoted 19 lines · Jim Crilly
Quoted 18 lines · Patrick McFarland
Quoted 16 lines · Mark Knecht
Quoted 4 lines · Grant Coady

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.

Quoted 5 lines
Quoted 3 lines

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.

Quoted 5 lines
Quoted 3 lines

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>

Quoted 4 lines

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