---
title: "Learn The Many Ways How to Mount a Drive in Ubuntu"
description: "Learn how to mount a drive in Ubuntu and make sure you can access everything you need. Learn the many ways in this ATA Learning tutorial!"
canonical: "https://adamtheautomator.com/mount-a-drive-in-ubuntu/"
---

# Learn The Many Ways How to Mount a Drive in Ubuntu

> Learn how to mount a drive in Ubuntu and make sure you can access everything you need. Learn the many ways in this ATA Learning tutorial!

Source: https://adamtheautomator.com/mount-a-drive-in-ubuntu/

---

ATA Learning

Tap to hide

[

ATA Learning

](/)

*   [Home](/)
*   [Tutorials](/tutorials/)
*   [Instructors](/author/)
*   [Advertising](/advertising/)
*   [Recommended Resources](/resources/)
*   [About Adam](/about-adam/)

Search for:  

*   [](https://twitter.com/adbertram)
*   [](https://github.com/Adam-the-Automator)
*   [](https://www.linkedin.com/company/adam-the-automator-llc)
*   [](/feed/)

![Learn The Many Ways How to Mount a Drive in Ubuntu](https://adamtheautomator.com/wp-content/uploads/2023/02/mount-a-drive-in-ubuntu.jpg)

# Learn The Many Ways How to Mount a Drive in Ubuntu

[![](https://secure.gravatar.com/avatar/1bc5e1d52466fc3739f550c8d78be310684747bf1466a98d698320627ea243e2?s=192&d=mm&r=g)Michael Nguyen Tu](https://adamtheautomator.com/author/michael-nguyen-tu/)21 February 20237 min. read

Categories: [IT Ops](/category/it-ops/)

Tags:[Ubuntu Linux](/tag/ubuntu-linux/)

Table of Contents

*   [Prerequisites](#prerequisites)
*   [Mounting a Drive in Ubuntu via the GUI](#mounting-a-drive-in-ubuntu-via-the-gui)
*   [Mounting Drives via the CLI in Ubuntu](#mounting-drives-via-the-cli-in-ubuntu)
*   [Mounting the Partition](#mounting-the-partition)
*   [Configuring Auto-Mounting Partitions](#configuring-auto-mounting-partitions)
*   [Creating a Partition](#creating-a-partition)
*   [Conclusion](#conclusion)

Mounting drives in Ubuntu is essential for anyone using Ubuntu, as it is one of the most common tasks for managing data and applications. But if you struggle to mount a drive in Ubuntu, worry not! This tutorial has got you covered.

Learn, step-by-step, how to mount drives in Ubuntu in many ways to save time and effort when working with your system.

Keep reading and start mounting drives like a boss!

## Prerequisites

This tutorial involves hands-on demonstrations. To follow along, be sure you have an Ubuntu system with an external drive or partition to mount. This tutorial uses Ubuntu 20.04, but other distributions will work, while the steps may vary.

Related:[How to Install Ubuntu 20.04 \[Step-by-Step\]](https://adamtheautomator.com/install-ubuntu/)

## Mounting a Drive in Ubuntu via the GUI

The process of mounting drives in Ubuntu can be frustrating, but Ubuntu’s GUI will alleviate your frustrations. The quickest way to mount a drive (if not the easiest) in Ubuntu is by taking advantage of its GUI, allowing users to interact with the system via a user-friendly interface.

To mount a drive in Ubuntu via the GUI, follow these steps:

1\. Plug in the external drive you wish to mount to your machine.

2\. Once plugged in, open the file manager application (**Files**) in Ubuntu.

![Opening the file manager](https://adamtheautomator.com/wp-content/uploads/2023/02/image-158.png)

Opening the file manager

Related:[The Many Ways On Ubuntu to Find Files](https://adamtheautomator.com/ubuntu-to-find-files/)

3\. Locate the drive or partition you wish to mount in the list of devices shown in the file manager. The drive may be listed under _Other_ or _Computer_.

> 💡 _If the drive is not showing up, it may not have been properly detected by the system. Try unplugging and re-plugging the drive, or check for any hardware issues with the drive itself._

4\. Now, right-click on the drive, and select **Mount** from the context menu to mount the drive to your system.

Mounting a drive denotes attaching it to your OS’s file system, which makes it accessible for reading and writing.

![Mounting a drive via GUI (file manager)](https://adamtheautomator.com/wp-content/uploads/2023/02/image-159.png)

Mounting a drive via GUI (file manager)

5\. Once mounted, navigate to the drive, and you will have access to the contents, as shown below.

You can now read from and write to the drive just like on any other drive on your system.

![Viewing and accessing the content of the mounted drive.](https://adamtheautomator.com/wp-content/uploads/2023/02/image-160.png)

Viewing and accessing the content of the mounted drive.

6\. Now, click the icon next to the mounted drive’s name, and select **Unmount** to unmount the drive from your system.

Unmounting the drive first severs the connection between the drive and the OS. Doing so allows you to remove the drive without data loss or damage safely.

> 💡 _While a drive is mounted, the OS treats it as an active storage device and may access it to read or write data at any time. If you simply unplug the drive, you could disrupt ongoing read or write operations, causing data loss or corruption._

![Unmounting a drive](https://adamtheautomator.com/wp-content/uploads/2023/02/image-161.png)

Unmounting a drive

## **Mounting Drives via the CLI in Ubuntu**

If you work mainly in the terminal, mounting drives using the CLI in Ubuntu is within your expertise. Using the CLI can be more efficient for some tasks, particularly for experienced users who are comfortable with running commands and navigating directories using a terminal.

Below are some reasons, but are not limited to, for using the CLI to mount a drive in Ubuntu:

*   Mounting drives via the CLI is helpful if you do not have a graphical desktop environment installed or running a server with no GUI.
*   The CLI allows you to automate tasks and write scripts in CI/CD pipelines that can mount drives automatically. Mounting drives via the CLI can be useful for administrators who manage multiple servers or perform frequent mount/unmount operations.

Related:[How to Create a Jenkins CI CD Pipeline](https://adamtheautomator.com/jenkins-ci-cd/)

*   The CLI allows you to perform more advanced tasks, such as specifying mount options or editing the file system table (`fstab`) to configure automatic mounting.

Whatever the reason, mounting drives via the CLI in Ubuntu truly comes in handy. So read on and see how to mount drives via the CLI.

### Mounting the Partition

Assuming that your USB drive is already partitioned, which divides the drive into separate sections that can be treated as independent storage volumes, you will mount the USB drive to the system.

1\. Run the below `fdisk` command to list (`-l`) the current partitions of all the drives attached to your system.

```bash
sudo fdisk -l
```

Drives are typically referred to by their device names, such as _**/dev/sda,**_ _**/dev/sdb,**_ _**/dev/sdc**, etc._ These device names refer to the physical disks attached to the system, with **`sda`** being the first disk, **`sdb`** being the second, and so on.

Identify the partitions you wish to mount in the list below. This tutorial’s choice is the _**/dev/sdc**_ disk, but your case may differ.

![Listing all partitions and identifying one to mount](https://adamtheautomator.com/wp-content/uploads/2023/02/image-162.png)

Listing all partitions and identifying one to mount

2\. Now that you have identified the device to mount, you must create a mount directory to link the device to. Run the `mkdir` command below, which does not provide output but creates a mount point directory called `/mnt/sdc`.

```bash
sudo mkdir /mnt/sdc
```

3\. Next, run the below `mount` command to mount the partition to your mount point directory (`mnt/sdc`). No output is printed with this command, but you will later check all mounted partitions in your file system.

When you mount a device or partition to a mount point, the partition becomes accessible like any other directory in the file system.

```bash
sudo mount /dev/sdc /mnt/sdc
```

4\. Once mounted, run the [`df`](https://www.geeksforgeeks.org/df-command-linux-examples/) command below to view all the mounted file systems in human-readable form (`-h`).

```bash
df -h
```

Below, you can verify the partition has been successfully mounted.

![Verifying the partition has been successfully mounted](https://adamtheautomator.com/wp-content/uploads/2023/02/image-163.png)

Verifying the partition has been successfully mounted

5\. After verifying the mounted partition, run the below `ls` command to print a long-list format of all (`-la`) contents of the mounted partition (`/mnt/sdc`).

```bash
ls -la /mnt/sdc
```

If everything has been set up correctly, you will see the contents of the mounted partition, as shown below.

![Listing all contents of the mounted partition](https://adamtheautomator.com/wp-content/uploads/2023/02/image-164.png)

Listing all contents of the mounted partition

6\. Now, run the following `umount` command, which does not provide output, but unmounts the drive (`/mnt/sdc`). Unmounting drives is good practice to avoid accidentally making changes to their contents.

```bash
sudo umount /mnt/sdc
```

## Configuring Auto-Mounting Partitions

Mounting partitions to your system manually each time you access them can be frustrating. Save yourself the frustration by configuring auto-mount for your partitions. By configuring the partition to auto-mount, you gain access to the files on the partition each time you start up your system.

Additionally, the persistence of the partition across reboots can be helpful when setting up a server or an automated system.

To configure a partition to mount automatically, you must add an entry to the _/etc/fstab_ file. This configuration file contains a list of the file systems set to auto-mount at boot time.

1\. Open the `/etc/fstab` configuration file with a text editor of your choice.

```bash
sudo nano /etc/fstab
```

2\. Next, add the following entry at the end of the _/etc/fstab_ file, save the changes, and close the file. This entry tells the system to perform the following:

*   Mount the partition `/dev/sdc` to the `/mnt/sdc` mount point at boot time.Specifies the file system type as `ext4`, the default mount point (`defaults`).Sets the dump and pass values (`0 0`), which specify the order in which the file systems are backed up and checked by the `fsck` utility.

```bash
/dev/sdc /mnt/sdc ext4 defaults 0 0
```

![Configuring auto-mount for partitions](https://adamtheautomator.com/wp-content/uploads/2023/02/image-165.png)

Configuring auto-mount for partitions

3\. Finally, reboot your system; the partition will be automatically mounted when your system starts up.

### Creating a Partition

Although the drives you have mounted up to this point are already partitioned, perhaps you have a USB drive that is not. This process is typically done when setting up a new drive or repartitioning an existing one.

To create a partition on a drive, you can use a utility such as [`gparted`](https://gparted.org/display-doc.php?name=man-page) and [`fdisk`](https://www.geeksforgeeks.org/fdisk-command-in-linux-with-examples/). These utilities allow you to view the current partition layout of the drive and create, delete, or resize partitions as needed.

Related:[How To Manage Storage With GParted Linux](https://adamtheautomator.com/gparted-linux/)

1\. Run the below `fdisk` command to list (`-l`) the current partitions of all the drives attached to your system.

```bash
sudo fdisk -l
```

Drives are typically referred to by their device names, such as _**/dev/sda,**_ _**/dev/sdb,**_ _**/dev/sdc**, and so on._ These device names refer to the physical disks attached to the system, with **`sda`** being the first disk, **`sdb`** being the second, and so on.

In the list of partitions below, identify the one you wish to mount. This tutorial’s choice is the _**/dev/sdc**_ disk, but your case may differ.

![Listing all partitions and identifying one to mount](https://adamtheautomator.com/wp-content/uploads/2023/02/image-162.png)

Listing all partitions and identifying one to mount

2\. Next, run the following [`parted`](https://man7.org/linux/man-pages/man8/parted.8.html) command to open the parted utility for a specific drive. Replace `/dev/sdc` with the actual device name of the external drive.

> 💡 _Note that modifying the partition table on a drive can be risky, as it can potentially cause data loss or corruption. Be cautious when using the **`parted`** utility, and ensure you have backed up any critical data before proceeding._

```bash
sudo parted /dev/sdc
```

You will now be in the parted interactive shell, as shown below. An interactive shell is a CLI that allows you to enter commands and interact with the program in real time.

![mount a drive in ubuntu - Opening the parted shell](https://adamtheautomator.com/wp-content/uploads/2023/02/image-167.png)

Opening the parted shell

3\. Run the `mklabel` command below on the parted shell to create a new `gpt` partition table. For modern systems, GPT is the recommended partition table. [GPT](https://adamtheautomator.com/mbr-or-gpt/) is more flexible and supports larger drives than traditional MBR partition tables.

Related:[MBR or GPT? Which Partition Style to Use?](https://adamtheautomator.com/mbr-or-gpt/)

```bash
mklabel gpt
```

Type **Yes**, and press Enter to confirm creating the GPT partition table.

![Creating a new gpt partition table](https://adamtheautomator.com/wp-content/uploads/2023/02/image-168.png)

Creating a new `gpt` partition table

4\. Now, run the below `mkpart` command to create a new `primary` partition on the selected drive, starting at the beginning of the drive (`0GB`) and ending at `4GB`. Primary partitions are the basic building blocks for any drive.

This command does not produce output, but the new partition will be formatted with the default file system (typically ext2, ext3, or ext4). Moreover, the partition will be given the next available partition number.

```bash
mkpart primary 0GB 4GB
```

5\. Once the partition is formatted, run the below `quit` command to exit the parted shell.

```bash
quit
```

![Exiting the parted shell](https://adamtheautomator.com/wp-content/uploads/2023/02/image-169.png)

Exiting the parted shell

6\. Lastly, run the following `mkfs.ext4` command format the partition (`/dev/sdc`) with the ext4 file system, a popular file system for Linux systems.

This step is necessary to make the drive accessible from Ubuntu.

```bash
sudo mkfs.ext4 /dev/sdc
```

Type **Y** and press Enter when prompted to confirm formatting the partition.

![Formatting the partition](https://adamtheautomator.com/wp-content/uploads/2023/02/image-170.png)

Formatting the partition

## Conclusion

Whether you are storing important files, transferring data between systems, or creating backups, mounting drives on your system is a crucial skill. And in this tutorial, you learned ample ways to manually mount a drive in Ubuntu, including an auto-mount configuration.

Now, why not expand your drive mounting knowledge? Perhaps delve into [attaching and mounting an EBS volume to your Ubuntu EC2 Linux Instance](https://devopscube.com/mount-ebs-volume-ec2-instance/)?

Share this article

[Share on X](https://twitter.com/intent/tweet?url=https%3A%2F%2Fadamtheautomator.com%2Fmount-a-drive-in-ubuntu%2F&text=Learn%20The%20Many%20Ways%20How%20to%20Mount%20a%20Drive%20in%20Ubuntu)[Share on Facebook](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fadamtheautomator.com%2Fmount-a-drive-in-ubuntu%2F)[Share on LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fadamtheautomator.com%2Fmount-a-drive-in-ubuntu%2F)

## Related Posts

![](https://adamtheautomator.com/wp-content/uploads/2024/03/openldap-4.jpg)

### [How to Install and Configure an OpenLDAP Ubuntu Server](/openldap/)

Unlock the power of OpenLDAP on Ubuntu for centralized user authentication, seamless access control management, and enhanced directory services!

![](https://adamtheautomator.com/wp-content/uploads/2024/03/ubuntu-ntp.jpg)

### [How to Setup Ubuntu NTP Server](/ubuntu-ntp/)

Learn to configure an Ubuntu NTP server for precise time synchronization across your network. Ensure seamless operations with accurate timekeeping!

![](https://adamtheautomator.com/wp-content/uploads/2022/04/How-to-Install-Apache-on-Ubuntu.jpg)

### [Install Apache on Ubuntu and Master Website Traffic Management](/install-apache-on-ubuntu/)

Ready to optimize your website for high traffic? Install Apache on Ubuntu with this step-by-step guide and ensure smooth performance under heavy loads.

## Categories

*   [IT Ops](/category/it-ops/)
*   [Cloud](/category/cloud/)
*   [DevOps](/category/devops/)
*   [Home Ops](/category/home-ops/)
*   [Information Security](/category/infosec/)
*   [Software Development](/category/software-development/)

## Site

*   [Home](/)
*   [Tutorials](/tutorials/)
*   [Instructors](/author/)
*   [Advertising](/advertising/)
*   [Recommended Resources](/resources/)
*   [About Adam](/about-adam/)

Copyright 2026© ATA Learning | [Privacy Policy](/privacy/)
