LinuxQuestions.org
Help answer threads with 0 replies.
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-26-2010, 02:06 PM   #1
aurium
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, 02:11 PM   #2
fuubar2003
Member
 
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, 04:39 PM   #3
aurium
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, 05:02 PM   #4
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
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 05:03 PM.
 
Old 09-27-2010, 04:26 AM   #5
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
If you want to unmount and power-down the device, try the command eject /dev/whatever
 
Old 09-27-2010, 04:00 PM   #6
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,973

Rep: Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623
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, 08:05 AM   #7
binu1208
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, 06:33 AM   #8
aurium
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!
 
  


Reply

Tags
usb


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 03:42 PM
using usb pen drive as multi-boot device blotch Linux - Software 1 09-27-2007 05:39 AM
A guide to USB pen drive, mounting device in mdv2007 Emmanuel_uk Mandriva 7 12-10-2006 12:45 PM
device driver for usb pen drive sagsun Programming 1 09-24-2004 12:35 AM
USB Pen Drive, /dev/sda1 is not a valid block device Aeiri Linux - Hardware 3 08-13-2004 10:32 AM

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

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