How can I safely remove my USB hard drive in Fedora 17?

9

3

In Fedora 17, when I want to plug my USB hard disk out, I can only unmount it. But the problem is that the hard drive won't be powered off so that I can plug it out.

In some other distros like Ubuntu there is a Safely Remove option which powers the hard drive off.

How can I fix that?

Mehrdad

Posted 2012-11-11T17:58:25.970

Reputation: 223

Does hdparm -y /dev/sdX work? – slhck – 2012-11-11T19:56:04.710

Nope sir. This command removes the drive name from nautilus menu but does not power it off. – Mehrdad – 2012-11-11T20:44:06.433

2Hey guys, I found it myself. I needed to run the command: udisks --detach /dev/sdX I will post it as an answer as soon as the 8-hour time limit for forum newbies passes. – Mehrdad – 2012-11-11T20:51:24.077

Alright, great. Glad you solved the problem. – Josiah – 2012-11-12T02:18:29.897

Answers

10

After a lot of web surfing I came across the solution suggested by someone in askubuntu.com. Thank you everybody. I just needed to install udisks package! To power off my hard disk I have to enter the following command in terminal after unmounting all of its partitions:

udisks --detach /dev/sdX

Mehrdad

Posted 2012-11-11T17:58:25.970

Reputation: 223

2As of ubuntu 15.10, this seems to be udisksctl power-off -b /dev/sdb. BTW, as a response, my HDD switched off its light but still emitted noise and vibration until I physically plugged it off. – gluk47 – 2015-10-30T23:50:52.540

@gluk47's comment is worked for me on ubuntu 16.04. Though my hard-drive did fully power down. – Totem – 2017-01-16T18:39:11.583

Haven't tested this (used udisks --unmount) and udisks -h doesn't list --detach for me. Fedora 19. – hakre – 2013-08-27T19:30:16.610

2

Try

eject /dev/sdX

where X is the letter of your device.

Edit

You can find all available drive letters by using fdisk -l.

Josiah

Posted 2012-11-11T17:58:25.970

Reputation: 1 674

If you are not root, you can still get an idea what the drive letter is, using blkid. – gluk47 – 2017-01-16T20:25:03.860

1Could you explain how to find out what the device letter is? I would assume this can be confused quite easily. – slhck – 2012-11-11T18:52:10.130

This did not help. I also checked eject's man page in which it is written that this command does the same as umount according to the device in use. – Mehrdad – 2012-11-11T19:01:26.287

eject /media/THE_DISK should also work (if it is mounted there). @Mehrdad, don't believe too much what manuals say. They might be wron (report to bugzilla if so). – vonbrand – 2013-02-25T02:57:34.497

@Josiah please mention fdisk -l in your answer as the means to check drive letters, or any other mean you find appropriate. – Lorenzo Von Matterhorn – 2013-04-20T20:22:16.103

2

There is no safe removal button for the USB drive. You can eject the USB drive by clicking the small triangle which is on the side of the USB drive.

For ejecting a flash drive follow these steps:

  1. First see the USB drive by entering this command:

    fdisk -l
    
  2. Assuming your USB drive is /dev/sdb1, eject it with the following command:

    umount /dev/sdb1
    

    Alternatively:

    eject /dev/sdb1 
    

This will allow you to safely remove your USB drive.

Rahul Bhadana

Posted 2012-11-11T17:58:25.970

Reputation: 133

The "little triangle" can be found under Activities > Files and by locating the USB drive on the left pane. The icon is to the right of the USB drive's label. – Matthew Walker – 2015-06-18T05:53:55.267

0

Enter the following command to power off the hard drive:

hdparm -y /dev/sdx

eaglelinu

Posted 2012-11-11T17:58:25.970

Reputation: 1