Hi,
I just freshly installed Linux Mint (19.1, Cinnamon) again after a few years of standard Ubuntu and I am very happy with it. There is only one thing I can't figure out. How to safely remove external hard drives with Nemo?
When I have a hard drive plugged in via USB, the right-click menu offers me to mount/unmount only. And unmounting the hard drive doesn't spin it down / power it off.
Thanks a lot,
Tim
PS: While this sounds like a straightforwad problem, I couldn't find results for that.
Safely remove external hard drives with Nemo
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Safely remove external hard drives with Nemo
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Re: Safely remove external hard drives with Nemo
Click on the up arrow icon next to the drive..
Re: Safely remove external hard drives with Nemo
Unfortunately, that unmounts the drive only. It's still spinning and powered. Is there a way to actually power it down?
Edit: I am currecntly using `udisksctl power-off -b /dev/sdaX` to power the hard drives off, but it would be nice to do that directly via Nemo.
Re: Safely remove external hard drives with Nemo
I managed to hack together an entry in the right-hand menu. Unfortunately, one has to click in the space where files and folders are shown. I do not know how to add an action to a device.
Adding the two files /usr/share/nemo/actions/power_off_external_drive.nemo_action
and /usr/share/nemo/actions/power_off_external_drive
seems to be okai as a work-around. Still it would be nice if it were working directly out-of-the-box in Nemo or I could add this script to the right-click menu of the devices somehow.
PS: You have to make the second script exectuable for all.
Adding the two files /usr/share/nemo/actions/power_off_external_drive.nemo_action
Code: Select all
[Nemo Action]
Name=Power off hard drive
Exec=<power_off_external_drive %U>
Selection=none
Extensions=any;
EscapeSpaces=true
#Terminal=true
Code: Select all
#!/bin/sh
path=$1
device=$(df $path --output=source | tail -n 1)
label=$(lsblk $device -o LABEL | tail -n 1)
zenity --question --text="Are you sure you want to power off $label ($device)?" && udisksctl unmount -b $device && udisksctl power-off -b $device && notify-send -c "presence.offline" "$label" "$label ($device) has been powered off and can be unplugged."
PS: You have to make the second script exectuable for all.