LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE
User Name
Password
SUSE / openSUSE This Forum is for the discussion of Suse Linux.

Notices


Reply
  Search this Thread
Old 03-21-2006, 11:10 PM   #1
rahilrai
Member
 
Registered: Dec 2005
Location: India
Distribution: Open SUSE 10
Posts: 44

Rep: Reputation: 15
Question Safely remove usb disks/drives


How to Safely remove usb disks/drives

Hi, every time i plig in a usb drive (ipod included) it is automounted and a nice icon shows up on the desktop. So far so good.

My problems start when i right click on any of the usb drive icons and click on remove. It gives an error "cannot unmount" or something like that.

Can somebody shed some light on this. Is it harmful to directly unplug the usb drive from the system?

Thx in advance
 
Old 03-22-2006, 02:41 AM   #2
abisko00
Senior Member
 
Registered: Mar 2004
Location: Munich
Distribution: Ubuntu
Posts: 3,517

Rep: Reputation: 58
"cannot unmount" usually appears when the device is still in use. "Use" can mean that you still have a konqueror window open, that shows the content of the drive. Close all applications that may access the drive and try again. On the other hand, since sync is used (see your other thread) it should be safe to remove the drive anyway.
 
Old 03-26-2006, 04:52 AM   #3
archtoad6
Senior Member
 
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
Blog Entries: 15

Rep: Reputation: 234Reputation: 234Reputation: 234
Code:
lsof  | less -S~#22
can be helpful in finding which app. that is.
 
Old 03-26-2006, 11:06 AM   #4
EclipseAgent
Member
 
Registered: Oct 2005
Location: California
Distribution: SLED 10, openSuSE 10.2, Ubuntu Drapper
Posts: 713

Rep: Reputation: 30
Are you trying to unmount as root or regular user?
 
Old 03-26-2006, 03:13 PM   #5
Korto
LQ Newbie
 
Registered: Jun 2005
Location: Zagreb, Croatia
Distribution: Suse 10.0
Posts: 18

Rep: Reputation: 0
Code:
eject /dev/sda1
works fine for me. The stick may not be sda1, but

Code:
eject /dev/sdaX
should work
 
Old 03-27-2006, 07:27 AM   #6
archtoad6
Senior Member
 
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
Blog Entries: 15

Rep: Reputation: 234Reputation: 234Reputation: 234
All well & good, & eject is a good cmd. to know; but we are not addressing the fact that you can't eject a device if it's busy, even root may not be able to u(n)mount it. Even:
Code:
# umount -f /mnt/cdrom
doesn't work. (The "#" is the root prompt.)

The real Q is: HTF are we supposed to figure out which is the "offending" app. when umount refuses to work & gives a less-than-helpful "device is busy" msg.? Here are some code suggestions:
Code:
DEV=<device_you_are_trying_to_eject>
kill `lsof  | grep $DEV  | awk '{print $2}'`
This works for me, on my cdrom, w/ 2 instances on Konqueror open displaying its contents. I did not test it further. YMMV.


It would be nice if umount had an option to list the apps./open files that are blocking the command. It would be even nicer if umount had an option to close apps./open files & "just do it".

It would be nice if eject had a force option that would incorporate the above.

We shouldn't be having to have this discussion.
 
Old 03-27-2006, 07:36 AM   #7
zba78
Member
 
Registered: Oct 2004
Location: Birmingham, England
Distribution: OpenSuSE 10.2
Posts: 50

Rep: Reputation: 15
With regards to USB drives, I didn’t think the user had to unmount/eject them. When I’m done with the USB stick I just unplug it and it automatically unmounts it without ever giving any trouble.

I though that was the whole point of automounting!
 
Old 03-27-2006, 03:38 PM   #8
archtoad6
Senior Member
 
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
Blog Entries: 15

Rep: Reputation: 234Reputation: 234Reputation: 234
Even in "Winders" you must formally close the open files & "eject" the thumb drive to avoid possible file system corruption.
 
  


Reply



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
how do I (safely) remove gnome? sunpascal Linux - Newbie 1 02-12-2006 09:24 AM
Can't "Safely Remove" usb stick: KDE, SUSE 10.0 m29389 SUSE / openSUSE 8 11-15-2005 11:35 PM
How to safely remove linux :( TRUSTpunk Linux - Newbie 11 01-07-2005 12:55 AM
How to remove old kernels safely satimis Fedora 11 08-21-2004 08:06 AM
Safely remove USB Flash drive? Guitarist88 Linux - Newbie 3 05-26-2004 03:35 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE

All times are GMT -5. The time now is 10:13 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration