How does "Safely Remove Drive" in nemo differ from eject?

Questions about applications and software
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Post Reply
HyperBear
Level 3
Level 3
Posts: 115
Joined: Thu May 04, 2023 3:39 am

How does "Safely Remove Drive" in nemo differ from eject?

Post by HyperBear »

It seems "Safely Remove Drive" and the eject command are not exactly the same. For example, "Safely Remove Drive" spins down an external hard drive (not even hdparm -y does this) while eject does not spin down the drive. eject while the drive is not spinning spins it up, even if no partition from that drive is mounted.

Are there any other differences I am unaware of? Is this documented somewhere?
vanadium
Level 5
Level 5
Posts: 629
Joined: Sun Dec 27, 2015 1:07 pm

Re: How does "Safely Remove Drive" in nemo differ from eject?

Post by vanadium »

As I understand, "Eject" merely disconnects the partition. The icon remains, and you can mount later again by clicking the icon.

"Safely remove drive" thoroughly takes the drive "out of view" of the OS. It umounts, but also disconnects the driver, i.e., after that, the system does not anymore see the device. The only way to reconnect is to physically unplug the drive and plug it back in.
MiZoG
Level 14
Level 14
Posts: 5008
Joined: Fri Jan 26, 2018 8:30 pm
Location: Athens, Greece

Re: How does "Safely Remove Drive" in nemo differ from eject?

Post by MiZoG »

"Safely Remove Drive" is syncing, unmounting filesystem and powering off device.
"Eject" is meant for devices like optical drives that do not need syncing but it is available for flash drives too which of course as we know need syncing, anyway it is not meant for HDDs/SSDs.
Eject is a standalone program and has its own man page which states that it performs 4 (!) different types of ejection.
"Safely Remove Drive" combines sync with udisks2 commands.
HyperBear
Level 3
Level 3
Posts: 115
Joined: Thu May 04, 2023 3:39 am

Re: How does "Safely Remove Drive" in nemo differ from eject?

Post by HyperBear »

vanadium wrote: Mon Aug 25, 2025 6:34 am As I understand, "Eject" merely disconnects the partition. The icon remains, and you can mount later again by clicking the icon.
No, that's what unmounting does.

After running the eject command, the device is still listed in lsusb and lsblk but with zero bytes in size, and it can not be mounted again without being physically disconnected (or powered on/off if it has a physical switch like some HDDs and USB hubs do).

"Safely remove drive" also unlists it from lsusb and lsblk.
MiZoG wrote: Mon Aug 25, 2025 6:42 am "Safely Remove Drive" is syncing, unmounting filesystem and powering off device.
"Eject" is meant for devices like optical drives that do not need syncing but it is available for flash drives too which of course as we know need syncing, anyway it is not meant for HDDs/SSDs.
So eject on a hard drive or SSD or USB stick does not include syncing?
Post Reply

Return to “Software & Applications”