LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 03-22-2006, 12:25 PM   #1
FirebirdV0273
Member
 
Registered: Jul 2003
Distribution: Slackware
Posts: 84

Rep: Reputation: 15
removal of USB device


I dual boot my system with Windows and I have an iPod which I use with iTunes under Windows. My problem is that sometimes I leave my iPod connected to the USB port when I shut down from Windows, and then if I boot up later to Linux I don't know how to safely remove it except for shutting down. I want to know how to kill the USB device so that I can disconnect it and hit the street with my tunes (I tried googling and searching the forum here and couldn't find my answer, and I just wouldn't know what to look for in the man pages). Thanks, much appreciated!

Oh, and I'm on Slackware 10.2 with kernel 2.6.16-rc4
 
Old 03-22-2006, 12:34 PM   #2
weibullguy
ReliaFree Maintainer
 
Registered: Aug 2004
Location: Kalamazoo, Michigan
Distribution: Slackware 14.2
Posts: 2,815
Blog Entries: 1

Rep: Reputation: 261Reputation: 261Reputation: 261
Does your iPOD automount when you boot into Linux? If so, you'll have to unmount it before you pull it out. If not, it's just sitting there doing basically nothing.
 
Old 03-22-2006, 01:26 PM   #3
kg4ysy
Member
 
Registered: May 2005
Location: North Carolina
Distribution: Gentoo
Posts: 123

Rep: Reputation: 19
Look for a device named sd*, it may be listed as this. If so, as root, type umount /dev/sda1 for instance
 
Old 03-22-2006, 01:47 PM   #4
FirebirdV0273
Member
 
Registered: Jul 2003
Distribution: Slackware
Posts: 84

Original Poster
Rep: Reputation: 15
It doesn't automount, that would require an entry in /etc/fstab, correct? So, I don't believe it is mounted. If it weren't in /etc/fstab, how would mount -a know the parameters of the device to actually get it mounted? So I don't think it's mounted, but on the Pod's screen it does say "Do not disconnect." Somewhat ominous for data corruption, no? I tried umounting anyway, just to see if somehow this device mounted itself in some way that I don't know of, that isn't it. "umount /dev/sd*" shows that every sd* is not mounted. Is there a way to end communication over the USB port, effectively kill the device? Like, if the device were a mouse and not a storage device could I kill communications? Send the iPod a hangup signal? I don't want to tear it out, because it says "Do not disconnect." but it's so inconvenient to shut down the whole pc just to remove my iPod.
 
Old 03-22-2006, 07:05 PM   #5
schoo002
LQ Newbie
 
Registered: Jan 2006
Location: B'ham, AL
Distribution: Mandrake 10.1
Posts: 2

Rep: Reputation: 0
My 30GB iPod always says "Do Not Disconnect" when it's plugged in, mounted or not. I read somewhere it'll always say that when it's connected to a Linux machine (sorry, I don't remember where). I just verify it's not mounted, then unplug it. I've never had any problems.
 
Old 03-22-2006, 07:13 PM   #6
FirebirdV0273
Member
 
Registered: Jul 2003
Distribution: Slackware
Posts: 84

Original Poster
Rep: Reputation: 15
Ok, thanks. I thought that might be the case. Once I thought about it and realized that it's not mounted I figured that the file system on the device must not be doing anything, and I just disconnected the cable. Seems ok so far, but I'm going to try to remember to disconnect it while the computer is off, if I forget to kill it while it's on. Thanks again for the replies!
 
Old 03-22-2006, 07:36 PM   #7
Electro
LQ Guru
 
Registered: Jan 2002
Posts: 6,042

Rep: Reputation: Disabled
Quote:
"Do Not Disconnect" when it's plugged in, mounted or not.
This is only for Windows and Mac. Linux is different because you have to actually run the utility mount to access the drive. If it is not mounted you can remove it with out any corruption. If you mounted and write any files to the drive, you will have to run sync before unmounting.

Automount devices does not have to be in /etc/fstab. It could automount through hotplug scripts.
 
Old 03-22-2006, 08:33 PM   #8
FirebirdV0273
Member
 
Registered: Jul 2003
Distribution: Slackware
Posts: 84

Original Poster
Rep: Reputation: 15
Thanks electro, that's very helpful.
 
Old 04-07-2006, 06:29 PM   #9
swiftnet
Member
 
Registered: Aug 2003
Location: Florida, USA
Distribution: Mandrake, Knoppix, Yoper
Posts: 97

Rep: Reputation: 19
Do not Disconnect Fix for USB iPod

To get rid of the Do_Not_Disconnect message:

if eject /mnt/ipod doesn't work try (as root):

umount /mnt/ipod # change this to wherever the ipod is mounted
rmmod ehci_hcd
rmmod ohci_hcd
service usb start
# the "service usb start" line is Mandriva specific, it just reloads the usb modules, so use what your distro needs

If you use gtkpod, you can pop all those into a file called gtkpod.out in the ~/.gtkpod directory. Running as root is scary so you'll need to create a sudo account for them to make life easier. I'd also add some time between commands with sleep, sleep 30 before reloading the usb modules, gives you enough time to unplug the iPod.

Example gtkpod.out file:

sudo umount /mnt/ipod
sleep 3
sudo rmmod ehci_hcd
sleep 1
sudo rmmod ohci_hcd
sleep 30
sudo service usb start
 
Old 04-29-2006, 10:02 AM   #10
secho
Member
 
Registered: Mar 2004
Distribution: Gentoo
Posts: 34

Rep: Reputation: 15
Quote:
Originally Posted by schoo002
My 30GB iPod always says "Do Not Disconnect" when it's plugged in, mounted or not. I read somewhere it'll always say that when it's connected to a Linux machine (sorry, I don't remember where). I just verify it's not mounted, then unplug it. I've never had any problems.

While this *might* be safe, I sometimes like to listen while the ipod is charging.
If you are unmounted, you can type:
eject /dev/sda (or whatever the device is)
to remove the message, buyt continue charging.
To re-mount, you will have to un-plug and then plug in the ipod again though.
 
  


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
Removal of U3 crap from USB-Flash- how? BerzinTehvs Linux - Hardware 21 05-16-2011 02:09 PM
USB drive not working properly, read only device? (USB key storage device) Arodef Linux - Hardware 14 01-01-2010 08:32 AM
How to detect insertion/removal of flash card in usb reader? logularjason Linux - Hardware 9 06-24-2006 04:11 AM
usb flash drive removal crash Shadowalker Linux - Hardware 1 01-28-2006 08:18 AM
Bootup freezes after removal of USB devices hontoo Linux - Hardware 0 12-04-2004 01:23 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 10:57 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