How to Mount an External Hard Drive in Ubuntu?
This article provides a straightforward guide on how to mount an external hard drive in Ubuntu, covering both the automatic graphical method and the manual command-line approach. Whether you are using a standard desktop environment or working entirely in the terminal, you will learn how to detect your drive, create a mount point, and successfully access your files. Additionally, we will cover how to configure your system to safely unmount the drive when you are finished.
Method 1: The Automatic Graphical User Interface (GUI) Method
For most desktop users, Ubuntu makes managing external storage incredibly simple by handling the process automatically.
- Connect the Drive: Plug your external hard drive into an available USB port on your computer.
- Automatic Detection: Ubuntu will automatically recognize the device, file system, and partitions.
- Accessing Files: A shortcut icon for the hard drive will typically appear on the desktop dock or launcher. You can also open the Files application (Nautilus) and look under the Other Locations or devices sidebar to click on your drive and view its contents.
Method 2: The Manual Command-Line Interface (CLI) Method
If you are using Ubuntu Server or the drive does not mount automatically, you can manually mount it using the terminal by following these steps.
1. Identify the Hard Drive Before mounting, you need to know the device name assigned to your external drive. Open your terminal and run the following command:
lsblk
Look for your external drive in the list (usually labeled as
sdb, sdc, etc., based on the size of the
disk). Note the specific partition name, such as
/dev/sdb1.
2. Create a Mount Point Ubuntu needs a directory
where the contents of the hard drive will be linked. You can create a
new folder in the /media or /mnt
directory:
sudo mkdir -p /media/external_drive
3. Mount the Drive Run the mount command by specifying the partition name and the mount point you just created:
sudo mount /dev/sdb1 /media/external_drive
You can now navigate to /media/external_drive to access,
read, and write your files.
Safely Unmounting the Drive
To prevent data corruption, always unmount your external hard drive before physically disconnecting the USB cable.
- Via GUI: Click the Eject or unmount icon next to the drive’s name in the Files application sidebar.
- Via CLI: Run the
umountcommand followed by the mount point path:
sudo umount /media/external_drive