Artificial intelligent assistant

Eject / safely remove vs umount I'm using Ubuntu 12.04, and when I rigth click on a my flash drive icon (in the Unity left bar) I get two options that have me confused: **eject** and **safely remove**. The closer I came to an answer was this forum thread, which concludes that (for a flash drive) they are both equal and also equivalent to use the `umount` command. However, this last assertion seems to be false. If I use `umount` from the console to unmount my flash dive, and then I use the command `lsblk`, I still see my device (with nothing under MOUNTPOINT, of course). On the other hand, if I **eject** or **safely remove** my flash drive, `lsblk` does not list it anymore. So, my question is, what would be the console command/commands that would really reproduce the behaviour of **eject** and **safely remove**?

If you are using `systemd` then use `udisksctl` utility with `power-off` option:

> power-off
>
> Arranges for the drive to be safely removed and powered off. On the OS side this includes ensuring that no process is using the drive, then requesting that in-flight buffers and caches are committed to stable storage.

I would recommend first to unmount all filesystems on that usb. This can be done also with `udisksctl`, so steps would be:


udisksctl unmount -b /dev/sda1
udisksctl power-off -b /dev/sda


* * *

If you are not using `systemd` then old good `udisks` should work:


udisks --unmount /dev/sda1
udisks --detach /dev/sda

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy ec1d29548e6537300c00e2a3af2df5be