When I right-click the desktop icon for my USB drive or SD card I have the choice to "Eject" or "Safely Remove Drive":
In the Tree side pane in Nautilus, I can either "Unmount" or "Eject":
The Places side pane in Nautilus has some kind of eject icon:
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?
When a drive is connected and its filesystem loaded, it is mounted, as if with the
mount
(orpmount
) 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 theumount
orpumount
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 commandeject
. 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.
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:
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:
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.
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".
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.
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
An external USB Hard Drive has the "unmount" option
An external USB DVD Drive has the "Eject" option
Unity Launcher showing an "Eject Parent Drive" option on a multi-partitioned Pen Drive (Has 2 partitions in this case)
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.
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.
I'm pretty sure "safely remove Drive" unmounts any other partitions on that device.