Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Hardware
User Name
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?


  Search this Thread
Old 09-26-2010, 03:06 PM   #1
LQ Newbie
Registered: Dec 2009
Distribution: Debian
Posts: 7

Rep: Reputation: 0
Question How to shutdown a USB device (pen drive) from a console?

The umount command sync and release the USB device (pen drive or external HD) from the filesystem, but does not shutdown it, like Nautilus does with the safe remove. How can i properly shutdown it from the command line?
Old 09-26-2010, 03:11 PM   #2
Registered: May 2004
Location: Orlando, Florida
Distribution: SLES10/11, RH4/5 svrs, Fedora, Debian/Ubuntu/Mint; FreeBSD/OpenBSD
Posts: 63

Rep: Reputation: 26
'umount' will report the device is busy if something is still accessing the device. Just execute 'umount /<mountpoint>'. If you want to be even more thorough, execute:
# sync;sync;umount <mountpoint>

...where mountpoint is the full directory path where it is mounted.
Old 09-26-2010, 05:39 PM   #3
LQ Newbie
Registered: Dec 2009
Distribution: Debian
Posts: 7

Original Poster
Rep: Reputation: 0
Unhappy not yet

umount and sync are obvious and well knowed. thanks. ;-)

After the umount some usb devices still "on" with a lighting let and listed on the file browsers. For some devices is more secure to turn it "off" before remove from the USB slot. With this care the device life will be longer. By that you can see "umount" and "safe remove" on Nautilus and some other file browsers.

So... how to shutdown a USB device by the commandline?
Old 09-26-2010, 06:02 PM   #4
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671
You might want to look at ivman. It makes mounting removable devices easier from the console. ( and you may already have it installed ) You can use "halmount -e <device|mount point|label name>" to eject a device. You will need to cd out of a directory on the device before you can eject it.

For large pen drives (8 GB & greater) the light will remain lit after ejecting. It will dim & brighten about once a second. This will also be true for Macs as well.

Last edited by jschiwal; 09-26-2010 at 06:03 PM.
Old 09-27-2010, 05:26 AM   #5
LQ 5k Club
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,087

Rep: Reputation: 407Reputation: 407Reputation: 407Reputation: 407Reputation: 407
If you want to unmount and power-down the device, try the command eject /dev/whatever
Old 09-27-2010, 05:00 PM   #6
Registered: Mar 2008
Posts: 17,101

Rep: Reputation: 2552Reputation: 2552Reputation: 2552Reputation: 2552Reputation: 2552Reputation: 2552Reputation: 2552Reputation: 2552Reputation: 2552Reputation: 2552Reputation: 2552
I'd simply unmount it and remove it.

I can't find it but isn't there usbtools or some package like that with all the command line tools?
Old 10-01-2010, 09:05 AM   #7
LQ Newbie
Registered: Sep 2010
Posts: 1

Rep: Reputation: 0
Please do this

Login to Root
#fdisk -l - To find the mount point and the device name
#umount /dev/device name

eg:#umount /dev/sda1
Old 10-02-2010, 07:33 AM   #8
LQ Newbie
Registered: Dec 2009
Distribution: Debian
Posts: 7

Original Poster
Rep: Reputation: 0
Thumbs down Read the question is a good practices

binu1208, again... umount is obvious.

You must to read the question and read the previews conversation before answer.

Que question is not about to remove from the file system, is about to shutdown a device!



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
can longer copy files to my empty USB pen drive on DSL - "no space left on device" misterfever Linux - Newbie 11 03-18-2009 04:42 PM
using usb pen drive as multi-boot device blotch Linux - Software 1 09-27-2007 06:39 AM
A guide to USB pen drive, mounting device in mdv2007 Emmanuel_uk Mandriva 7 12-10-2006 01:45 PM
device driver for usb pen drive sagsun Programming 1 09-24-2004 01:35 AM
USB Pen Drive, /dev/sda1 is not a valid block device Aeiri Linux - Hardware 3 08-13-2004 11:32 AM > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 10:11 AM.

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