How do I eject a USB flash drive from a computer?

eject-and-remove-usb.jpg

Updated: 12/16/2018 by Computer Hope

When you are finished using a USB flash drive that is connected to your computer, you should not pull it out of the USB port. Instead, you should eject it, using the eject option provided by your OS (operating system).

Note: The steps on this page can also be used to safely eject other devices connected to a computer via USB, including smartphones.

When you eject a flash drive, you’re telling the operating system that the drive is about to be disconnected. The operating system will complete any read or write operations on the drive, and unmount it from the computer.

If you do not eject a USB flash drive before disconnecting it, there is a chance that data on the drive will be corrupted, because the operating system was not expecting it to be disconnected. For this reason, it’s best to always eject your USB drive before physically disconnecting it from your USB port.

The Windows, macOS X, and Linux operating systems each provide a safe method to eject a flash drive.

Eject a USB drive in Windows

Using the notification area

  1. In the Notification Area of the taskbar, click the up arrow to view the items in the systray. Then, right-click the Eject Media Eject Media icon in Windows Notification Area icon.

Screenshot: In the Notification Area, click the up arrow to view the systray. Click the Eject media button, which looks like a USB flash drive.

  1. A menu lists the removable media you can eject. Click the name of your USB flash drive. In this example, the open to eject the USB flash drive is named “Eject Cruzer Glide.”

Eject USB thumb drive

After clicking the eject option, wait for a message stating it is safe to remove the hardware before pulling the flash drive out of your computer.

Using File Explorer

  1. Open File Explorer by pressing Win+E.
  2. On the left, click This PC.
  3. On the right, right-click your USB flash drive.
  4. Select Eject.

Eject a USB drive in macOS

With ⌘+E keyboard shortcut

  1. Locate the USB flash drive on your desktop. Click it once to select it.
  2. On your keyboard, press ⌘+E to eject the flash drive.

Screenshot: Select the USB flash drive icon on your macOS desktop, and press Command+E.

In Finder

  1. Open the Finder utility. On the left, locate your USB flash drive under Devices.
  2. Click the eject icon (⏏) to the right of the flash drive.

Screenshot: In the macOS finder, locate your USB flash drive on the left under Devices, and click the eject icon next to its name.

Using Trash

  1. Locate the USB flash drive on your desktop.
  2. Drag-and-drop the USB flash drive into the trash bin icon. When you start dragging a removable disk, such as your USB flash drive, the Trash turns into an eject icon (⏏). When you drop the disk on the eject icon, the disk is ejected. No data is deleted by using the Trash icon this way.

Screenshot: Locate the icon for your USB flash drive on your macOS desktop, and drag-and-drop it into the Trash.

You can now safely remove the USB flash drive from your computer.

Eject a USB drive in Linux

In a Linux operating system, you can eject a USB flash drive in your file manager, or in the command line shell.

File manager example: Nautilus

In this example, we’ll eject a USB flash drive using Nautilus, the default file manager in Ubuntu. Nautilus is a lot like the Windows File Explorer. (Your file manager may be different if you’re using another Linux OS.)

Open a new Nautilus window by clicking the shortcut on your dock. It looks like a file cabinet, labeled Files.

Screenshot: launching Nautilus from the Ubuntu dock.

Or, click Activities (on the left side of your taskbar). In the search box, type Files, or Nautilus. In the search results, click the Files icon.

Screenshot: launching Nautilus from the Ubuntu Activities search bar.

Or, open a terminal (Ctrl+Alt+T), type nautilus, and press Enter.

Screenshot: launching Nautilus file manager from the Ubuntu terminal.

In the Nautilus file manager window, you’ll find your USB flash drive listed on the left. Click the eject icon () next to the disk name.

Screenshot: In a Nautilus window, locate your USB flash drive on the left, and click the Eject icon.

Your disk is removed from the list, and a notification informs you that it’s safe to remove the USB flash drive.

Ejecting from the Linux shell.

In every Linux operating system, the administrator can eject a mounted USB flash drive with the eject command, specifying the device name of the USB flash drive.

For example, if your USB flash drive is mounted as the device name /dev/sdc, and your user is a sudoer (you have administrator rights), you can eject it with the command:

 sudo eject /dev/sdc

Here, the sudo command means “run the following command as administrator.” When you press Enter, you are prompted for your password.

When the command runs, all pending I/O operations for the specified device are forced to complete immediately, as if you’d run the sync command. Then, the device is unmounted, as if you’d run umount.

If eject is successful, the command will display no output. You can safely disconnect your USB flash drive.

Determining your flash drive’s device name

If you’re not sure of the device name for your USB flash drive, you can list it with parted.

The device name of your USB flash drive is /dev/sdx, where x is a lowercase letter az.

List your mounted devices by running parted -l as root, or with sudo:

 sudo parted -l

Screenshot: listing Linux block devices with gparted.

In this example, disk /dev/sdb is our USB flash drive, so the eject command would be:

 sudo eject /dev/sdb
PinIt
submit to reddit

Leave a Reply

Your email address will not be published. Required fields are marked *

Top
Web Design BangladeshWeb Design BangladeshMymensingh