umount
command itself doesn't cut off power to the drive, mounting really means linking a filesystem on drive with a directory, so unmounting just does that - unlinks a mount from particular directory; and as far as Nautilus file manager goes that's not what it uses under the hood, in fact it uses GMount objects from the standard Gio API for all GNOME-related type of development.
Without confusing you too much, let me explain it in terms of source code and documentation. Brief search through source code reveals that in nautilus-file-operations.c file, the nautilus_file_operations_unmount_mount_full
function calls do_unmount
, which calls g_mount_eject_with_operation
function. That last one belongs to GMount portion of API. Ejecting would involve sync-ing remaining data that needs to be written to the mount, unmounting
a volume or drive, and then powering it off in case of USB drive or optical disk.
If you're expecting a shell command that can power off a drive just like in Nautilus, there is one via udisks
or udisksctl
, and if I'm not mistaken udisksctl
comes with OSes that use systemd
(but don't quote me on this last statement, that's an opinion only). That makes use of UDisks2, which is actually another API for handling drives and volumes via D-Bus interface; it is actually quite nice and I've used for developing my own indicator on Ubuntu.
So TL;DR:
- Nautilus uses Gio API to handle mounts, but doesn't call any external or standalone command-line utility
- There is command-line equivalent that performs similar operations as Nautilus
- You can always write your own using Gio API, UDisks API, or call external
udisks
or udisksctl
command.
See also: