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