123

When I right-click the desktop icon for my USB drive or SD card I have the choice to "Eject" or "Safely Remove Drive":

screenshot

In the Tree side pane in Nautilus, I can either "Unmount" or "Eject":

screenshot

The Places side pane in Nautilus has some kind of eject icon:

screenshot

What do all of these do?

Specifics I've been wondering about include:

  • What happens when a drive has multiple partitions mounted?
  • Under what conditions is a prompt to empty the trash displayed?
  • Do any of these result in a state in which the drive cannot be mounted again without first being physically reconnected?
5
  • I think that there was a papercut on LP about unifying/simplifying these names.
    – papukaija
    Jan 26, 2011 at 21:33
  • What version of Ubuntu is this? Why does it look so much better than both 16.04 and 17.04? Aug 16, 2017 at 23:40
  • @Hashim This is Ubuntu 10.10 with the font set to Droid Sans. I'd recommend exploring a few old releases in a virtual machine if you're curious; it's fun to see how the interface evolved.
    – ændrük
    Aug 17, 2017 at 2:01
  • So it wouldn't be possible to get any of the new versions to look like this? Aug 17, 2017 at 2:02
  • @Hashim That would be better as a new question; it's a different topic and the answer is likely to be complicated.
    – ændrük
    Aug 17, 2017 at 2:05

4 Answers 4

40

When a drive is connected and its filesystem loaded, it is mounted, as if with the mount (or pmount) command, to a location on the root filesystem (usually somewhere inside /media). When the filesystem is no longer needed, it can be unmounted (as if with the umount or pumount commands), which flushes any pending writes to disk, so that you can remove the drive safely. If the drive is removed without doing this, some pending writes will be lost, and the drive can potentially be rendered unreadable or otherwise lose data.

"Safely Remove Drive" and "Eject" are basically equivalent and do two things: It first unmounts the filesystem (as if the umount command were used), then it issues a SCSI eject command (which is accepted by things like CD-ROM drives, and ignored by almost everything else). It works the same as the command-line command eject. Many USB devices seem to respond to the eject command by shutting down or de-registering themselves from the USB host.

For most devices, all of these commands are functionally equivalent. For CD-ROM, DVD, Blu ray, etc. devices, "Eject" additionally physically ejects the media.

6
  • 17
    "Safely Remove Drive" and "Unmount" definitely don't do the same thing. "Safely Remove Drive" unmounts both partitions on my SD card, while "Unmount" only unmounts one. After "Unmount", my SD card is still not safe to remove. I've clarified my question above.
    – ændrük
    Oct 11, 2010 at 16:35
  • That seems a minor enough detail that I thought it not worth mentioning. The process is the same, regardless.
    – greyfade
    Oct 11, 2010 at 19:14
  • 10
    @ændrük makes a major point. Please address it in your otherwise excellent answer, which will lead to data loss if people unmount one filesystem and then pull a USB which had multiple mounted filesystems. Eject seems like the way to go.
    – nealmcb
    Feb 12, 2011 at 14:32
  • While we're at it, @greyfade, might you know something about my unanswered question on avoiding some USB automounts? askubuntu.com/questions/25110/… I would really appreciate it!
    – nealmcb
    Feb 12, 2011 at 14:34
  • 2
    on a portable music player the difference between unmount and safely remove can be the fact that after unmounting it will still charge the battery but not after eject/safely remove
    – seb
    Sep 6, 2011 at 13:54
37

The main differences are the following:

Unmount

This option will "literally" unmount the device/partition and it applies normally (In Nautilus) to hard drives, be them, internal or external. Is not common to see it for Flash Drives / Pen Drives / Thumb Drives / SD Card / Digital Camera and any other device that needs to sync before powering down.

This is not the recommended way of doing it when addressing a device that needs to power down first if your intention is to disconnect the device afterwards, as the device will still show in the Nautilus panel..

Have in mind that unmount gives you the ability to mount the device again (since it did not power down or actually eject the device from the system).

Eject / Eject Button

Somehow similar to Unmount, it will unmount the device/partition. The problem is that this option should only be present for Optical Devices (Devices that do not need to sync data before disconnecting) since this actually EJECTS the device. I mean literally ejects or opens your CD Drive/DVD Drive Device so you can take the CD/DVD out of it, physically speaking.

You will not be able to mount the device again, except if you insert the CD/DVD back in (With Optical devices) or remove and reinsert the USB Drive again (For Flash Drives and other similar devices). Since this option also appears for USB Drives, and CD/DVD Drives behave differently than USB Drives (Hard Drives and Pen Drives in this case, Optical devices are omitted), ejecting a not properly synced USB Drive (Flash Drive or Hard Drive) could cause problems.

There is however a verification process that runs when you try to Eject a device that needs sync. For example, if you try to eject a device that is copying data at that precise moment, it will give you the following warning:

enter image description here

If you try to Eject the device and the sync is not done yet, you will get a message along the lines of "waiting for sync to finish before ejecting device". This only shows or at least it gives you enough time to see the message if you copy a lot files, specially small ones mixed in with big ones and then immediately after finishing the copy process you try to Eject it.

Note a couple of things:

  1. If you have an USB CD/DVD Drive and you Eject the medium, this will actually eject the whole device. You would have to insert the CD/DVD image back in to make the device appear again.

  2. If you Eject (At least with 12.04 and 12.10, haven't tested older versions) a USB Device that needs sync, the Eject process will power down the device AFTER the sync is done. This might be the cause of not seeing the option for "Safely Remove Drive".

  3. If you connect a device that has multiple partitions (Like some IPods, N900 Smartphone or other devices that show 2 or more Devices in Nautilus), Eject will only "eject" with the device you have selected. It will not work with others until you specifically tell it.

  4. Ejecting a device that has multiple partitions does not work correctly. It does not power down the device correctly so you might have problems or issues.

Safely Remove Drive

This option differs from the others since it is specifically design for synced devices like USB Hard Drives, Pen Drives, etc.. It will sync the device, unmount it and then power it down. This option should be available for devices that need sync, although Eject has taken some of the properties of Safely Remove Drive.

Here are some pics that show what you can see when you try to disconnect the device:

As you can see in this image, a Pen Drive / Flash Drive has the "Eject" option enter image description here

An external USB Hard Drive has the "unmount" option enter image description here

An external USB DVD Drive has the "Eject" option
enter image description here

Unity Launcher showing an "Eject Parent Drive" option on a multi-partitioned Pen Drive (Has 2 partitions in this case) enter image description here

A 2 partition created pen drive

Basically what we should see is this:

Unmount - For Hard Drives
Eject - For Optical Drives
Safely Remove - For USB Drives that need sync and power down (Pen Drives for example)

Should be noted that Unity Launcher shows options differently than Nautilus. GPARTED or the Disk App also show differently than Nautilus.

4
  • 1
    after safely remove drive now drive wont remount
    – user391339
    Dec 11, 2014 at 19:50
  • You may have found a bug Dec 11, 2014 at 20:15
  • 5
    Thanks. How can we do "Safely Remove" a external hdd by command line?
    – Tim
    Mar 4, 2015 at 21:04
  • 1
    umount /dev/DRIVE_ID then eject /dev/DRIVE_ID Mar 4, 2015 at 23:42
5

When it comes to USB devices eject only unmounts the device but it is still connected. Removing it might cause damage. After ejecting the device you have to safely remove it to be sure it won't damage yoru device.

0
5

I'm pretty sure "safely remove Drive" unmounts any other partitions on that device.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .