LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices

Reply
 
Search this Thread
Old 09-05-2005, 09:34 AM   #1
Mordechai
LQ Newbie
 
Registered: Aug 2005
Location: Israel
Distribution: Arch
Posts: 16

Rep: Reputation: 0
Question Problem disconnecting USB flash drive


I have an MP3 player which SuSE 9.3 sees as removable media (which I assume is normal). Sometimes when I disconnect it, my system doesn't seem to notice. This causes a problem when I try to reconnect it; the system doesn't see the "new" drive. As I'm new to linux, my troubleshooting arsenal is still quite limited. I've tried
Code:
umount /dev/sda1/
but it didn't help.

I'd also appreciate an general troubleshooting tips and links.

Thanks.
 
Old 09-05-2005, 10:12 AM   #2
oneandoneis2
Senior Member
 
Registered: Nov 2003
Location: London, England
Distribution: Ubuntu
Posts: 1,458

Rep: Reputation: 45
You should never disconnect without unmounting it first
 
Old 09-05-2005, 01:15 PM   #3
Mordechai
LQ Newbie
 
Registered: Aug 2005
Location: Israel
Distribution: Arch
Posts: 16

Original Poster
Rep: Reputation: 0
Quote:
Originally posted by oneandoneis2
You should never disconnect without unmounting it first
Doesn't that violate the whole idea behind something being hot-swapable?

Also, what about floppies and CDs? they're also "removible media"?

Last edited by Mordechai; 09-05-2005 at 01:17 PM.
 
Old 09-06-2005, 03:39 AM   #4
oneandoneis2
Senior Member
 
Registered: Nov 2003
Location: London, England
Distribution: Ubuntu
Posts: 1,458

Rep: Reputation: 45
Nope. You can plug & unplug USB devices to your hearts content.

But when you mount something, regardless of what, you should always unmount it before removing it.

CDs are a good parallel: A music CD can be ejected with impunity, but a mounted CD will not eject until it's unmounted. Because you should never remove mounted media.

Especially when it comes to USB flash, because they have limited write cycles: To prolong their life, they should be set to be written to as little as possible. Once this is set up, writes will be done 'virtually', and the physical writes will only be done when needed.

Your flash drive will last a lot longer like this, but if you don't unmount it before removing it, the data might not have been physically written.
 
Old 09-06-2005, 04:44 AM   #5
Mordechai
LQ Newbie
 
Registered: Aug 2005
Location: Israel
Distribution: Arch
Posts: 16

Original Poster
Rep: Reputation: 0
Fair enough, however, as I don't mount it why should I need to umount it? And if it is automatically mounted when I attach it, then it is reasonable to expect it to also automatically umount when I detach it. If it's like a CD, when I remove/eject it the system should recognize this. Normally, that's exactly what happens; I plug it in and a few seconds later I have /media/usbdisk/ and /dev/sda1/ available and when I detach it, a few seconds later they're gone. But sometimes there are glitches and the system doesn't realize the device isn't still attached.

So the question is: "When the system doesn't recognize that the device has been detached, how do I force it to do so short of rebooting?"

Regarding data not being written, that's not an issue as a window opens with a progress bar to provide status.

As far a limited life cycle, as I generally only listen to a podcast once, I'll just have to live with it.
 
Old 09-06-2005, 04:54 AM   #6
oneandoneis2
Senior Member
 
Registered: Nov 2003
Location: London, England
Distribution: Ubuntu
Posts: 1,458

Rep: Reputation: 45
It DOES get mounted - it's just done automatically. But it can't be auto-unmounted (properly) as the event that would trigger an unmount is the removal of the hardware that should be unmounted, so it's no longer present to be unmounted.

My advice is to set up an "unmount" shortcut & make sure you always use it. That would solve the whole problem.

If you really don't want to do that, next time the problem occurs, post:

- The output (if any) from the failed "unmount" command

- The output of "mount" alone, which should list all mounted drives

- The output of the last few lines of "dmesg"

- The last few lines of your syslog file

and we might be able to track down the problem & suggest a fix!
 
Old 09-06-2005, 05:04 AM   #7
abisko00
Senior Member
 
Registered: Mar 2004
Location: Munich
Distribution: SuSE, Ubuntu
Posts: 3,511

Rep: Reputation: 58
I am not sure if this applies to 9.3 as well, since a lot has changed with the hotplug scripts, but in 9.1 it seems to be required to run the 'eject' command on some USB devices in order to stop SUSE from accessing it (e.g. iPOD-mini).

It could cause problems if you remove the drive anyway: if you remove the drive while you are still accessing it (e.g. a konqueror window is open), it may not be unmounted properly.

I never got happy with the submount way of mounting. I prefer to have better control on what is mounted and what is not.
 
Old 09-06-2005, 10:27 AM   #8
Mordechai
LQ Newbie
 
Registered: Aug 2005
Location: Israel
Distribution: Arch
Posts: 16

Original Poster
Rep: Reputation: 0
I figured anything Windows could do linux could do better.

The eject command work (I know, no surprise for you, but is't a new command for me) when things are normal. I'm guessing that it might work for the problem as well. We'll see.

As far as the umount failing, it does so silently.

BTW, do you have any good links regarding dmesg or syslog? If not, I'm sure I could find something at TLDP.

Thank for the help.
 
Old 09-06-2005, 11:09 AM   #9
oneandoneis2
Senior Member
 
Registered: Nov 2003
Location: London, England
Distribution: Ubuntu
Posts: 1,458

Rep: Reputation: 45
"man dmesg" should tell you a bit about dmesg.

The syslog depends on your logger - there are several, such as syslog, syslog-ng, and metalogger. You'll have to find out which one you use before you can find out more about it They usually write to /var/log/messages tho
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with USB flash drive dmsynck Debian 4 11-23-2005 01:43 PM
USB flash drive mount problem servnov Linux - General 4 10-10-2005 08:08 PM
USB flash drive mounting problem guillaume31 Linux - Hardware 4 05-23-2005 11:47 AM
having a problem accessing my usb flash drive vadriaan Linux - Hardware 4 01-27-2005 02:15 AM
USB flash drive problem Kensai Mandriva 6 02-23-2004 02:05 PM


All times are GMT -5. The time now is 04:58 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration