1 |
On Thursday 02 Jan 2014 17:16:32 Andrew Tselischev wrote: |
2 |
> Hello list, |
3 |
> |
4 |
> Recently I came into possession of an external USB hard drive. The |
5 |
> user's manual (obviously) stated that I should always use "safe removal |
6 |
> function" prior to disconnecting the hard drive. I suspect the purpose |
7 |
> of this is to tell the device to properly park the heads and power down, |
8 |
> but I don't have any idea how to do that on linux. |
9 |
|
10 |
Are you sure of this, or is it just an assumption? |
11 |
|
12 |
I would think that the "safe removal" refers to unmounting the fs so that |
13 |
nothing is writing to it at the moment you are unplugging it. If not it will |
14 |
likely corrupt the filesystem. So use whichever method you used to mount it |
15 |
to safely unmount it before you physically disconnect it from your PC. |
16 |
|
17 |
|
18 |
> I tried writing '3' to /sys/bus/usb/device/.../power/autosuspend and |
19 |
> 'auto' to /sys/.../power/control but this doesn't power down the drive. |
20 |
> I do hear the indicative "click" after 3 seconds (at least I think I do), |
21 |
> but the "PWR" led still stays on, /sys/.../power/runtime_status still |
22 |
> says "active" (instead of "suspended") and I can access the data on the |
23 |
> block device /dev/sdb, all of which suggests that the drive is still |
24 |
> powered on. |
25 |
> |
26 |
> So, perhaps you could give me a tip on how to properly detach USB |
27 |
> drives or link me to an up-to-date information about the kernel's USB |
28 |
> subsystem. |
29 |
> |
30 |
> |
31 |
> I should mention that I'm not using any of the over-complicated DEs, |
32 |
> just the bare bones X server with awesomewm and a terminal emulator. |
33 |
> |
34 |
> I'm currently running kernel version 3.12.6-gentoo with udev-208 and |
35 |
> udisks-2.1.1 |
36 |
|
37 |
So, you should be able to do something like: |
38 |
|
39 |
udisksctl unmount -b /dev/sdd1 (or whatever is your device recognised as) |
40 |
|
41 |
to be able to safely unmount it. When power is removed by physically unplugin |
42 |
it the disk will stop spinning and the head will be parked. Also have a look |
43 |
at 'man eject'. |
44 |
|
45 |
-- |
46 |
Regards, |
47 |
Mick |