Nautilus unmount volume, also power-off?



Hi All,

Currently Nautilus offers the option to either unmount or eject (if
suitable) a volume, such as an external USB harddisk or flash drive.

There has been discussion in user forums if it is possible to power off
those external storage devices as well,
http://ubuntuforums.org/showthread.php?mode=hybrid&t=451344
http://www.techteam.gr/index.php?showtopic=118719

A way to implement the "unmount+poweroff" in Nautilus is to create a
Nautilus action that calls "umount", then "sdparm --command=stop", and
there is such a script circulating the forums.

Here is what I have in mind in implementing this
a. An external device can have several partitions. A power-off must be
attempted only when all partitions have been unmounted. Currently, the
UI does not offer yet an option of the sort "You have 4 partitions
mounted, shall I unmount them all?" but this can be done latter.
b. The user should not be confronted with information on "power-off"; a
power-off should be attempted when the last partition of a device has
been unmounted. That appears to be the case in Win/OSX.
c. Sending the STOP command appears not to work for some external USB
devices. I think it should be ok to try it anyway after the last umount
of a partition.
An alternative to sdparm is "sg_start --stop /dev/sdX".
d. Sending STOP to a flash drive can switch off the indicator light,
which is nice feedback to the user that they can unplug. 
d. This requires distributions to include "sdparm" or "sg3_utils" by
default.

I am wondering if there are any gotchas to this approach.

Simos




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]