Safely Remove an external hard disk in linux(tested in ubuntu)

wdpassport.png

Powering down an USB-powered external hard disk
An USB-powered external hard disk

In Ubuntu, unmounting an USB-powered external hard disk will not work in the same way as the safe removal would in Windows. What it won’t do is powering down the hard drive. You will notice this when you unplug the USB cable, because of the clicking sound coming from the hard disk, similar to the one you would hear if the power supply got suddenly cut off.

I’ve figured out the solution.

First of all, you will need to install sdparm:
sudo apt-get install sdparm

At this point, unmount the drive and then issue the command:
sudo sdparm –command=stop [device]

Replace [device] with whatever you need, and that’s it: your hard disk will spin down and rest, in the same way it would do in Windows after a safe removal. Now you may safely unplug your hard disk.


Notes

This  is based on my experience with a Western Digital WD Passport/Elements hard disk.

NB: it looks like this won’t work with some Lacie external hard disks.

Advertisements

One comment on “Safely Remove an external hard disk in linux(tested in ubuntu)

  1. […] external hdd to “spin-down” and shut-off (it is to be hoped), much as in Windows.  -Bill.  https://sekharpadikkal.wordpress.com/2008/03/01/safely-remove-an-external-hard-disk-in-linuxtested-in… What Ubuntu doesn’t seem to want to do is powering down the [external] hard drive. You will […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s