What mounting a drive means and why you need to do it

In Linux, a hard drive or USB device exists on your system but is not automatically accessible to you or your programs until you mount it. Mounting is the process of telling Linux where to attach that drive in your file system — essentially creating a pathway so you can read and write files to it. Without mounting, the drive is physically connected but invisible to your operating system.

Think of it like plugging in a external hard drive to Windows or Mac: the device shows up on your desktop or in a file manager. Linux requires an explicit step to make that happen. Once mounted, the drive appears as a folder (called a mount point) that you can navigate into and use like any other directory on your computer.

Key Takeaways

  • Linux requires you to mount a drive before you can access it, which means assigning it a location in your file system.
  • You can find the name of your drive using lsblk or fdisk -l, which list all connected storage devices.
  • The mount command syntax is sudo mount /dev/sdX# /mount/point, where sdX# is your drive and /mount/point is where it appears in your file system.
  • You can create a permanent mount by editing your /etc/fstab file so the drive mounts automatically when you restart.
  • Unmounting with sudo umount /mount/point is necessary before unplugging a drive to prevent data loss.

Identifying your drive before mounting

Before you can mount anything, you need to know what Linux calls your drive. Open a terminal and run lsblk (list block devices). This command shows all storage devices connected to your system, their sizes, and their device names. Your internal hard drive is usually sda, and additional drives or USB devices are sdb, sdc, and so on. If your drive is partitioned, you will see numbers after the letter — sda1, sda2 — representing individual partitions.

If lsblk does not show your drive, try sudo fdisk -l, which lists all disks and partitions with more detail. Look for the device name (like /dev/sdb1) and note the size to confirm you have found the right one. Do not mount the wrong device — mounting the wrong partition can overwrite data on your system drive.

Creating a mount point and mounting the drive

A mount point is straightforward a folder where the drive will appear. You can create this folder anywhere, but the standard location is under /mnt or /media. Open a terminal and create a folder with a name that describes the drive — for example, sudo mkdir /mnt/external creates a folder called external under /mnt.

Once the folder exists, mount the drive using the mount command. The syntax is sudo mount /dev/sdX# /mnt/external, replacing sdX# with your actual device name from the previous step. For example, if your drive is sdb1, the command is sudo mount /dev/sdb1 /mnt/external. Press Enter, and if the command returns no error, the drive is now mounted. You can navigate to /mnt/external in your file manager or terminal and access your files.

Checking the file system type and mounting with options

Linux can read and write to several file system types — ext4, NTFS, FAT32, exFAT — but some require additional software or mounting options. If your drive is formatted as NTFS (common on Windows drives), you may need to install the ntfs-3g package first. On Ubuntu or Debian, run sudo apt install ntfs-3g. For FAT32 or exFAT, most Linux distributions include support by default.

To check what file system your drive uses, run lsblk -f, which shows the file system type in the FSTYPE column. If you need to mount with specific options — for example, to make the drive readable and writable by a regular user instead of only root — add the -o flag: sudo mount -o uid=1000,gid=1000 /dev/sdb1 /mnt/external. The numbers 1000 and 1000 are the user and group IDs; you can find your own by running id in the terminal.

Making the mount permanent with /etc/fstab

The mount command works until you restart your computer, after which the drive is no longer mounted. To mount automatically every time you boot, you need to edit the /etc/fstab file (file system table). Open it with sudo nano /etc/fstab or your preferred text editor. At the end of the file, add a new line with the format: /dev/sdb1 /mnt/external ext4 defaults 0 2. Replace sdb1 with your device, /mnt/external with your mount point, and ext4 with your file system type.

The last two numbers are options: the first (0) tells Linux whether to back up the drive, and the second (2) sets the order for checking the drive at boot. For external drives, use 0 for both. Save the file and restart your computer to test. If the drive mounts without errors, the configuration is correct. If something goes wrong and your system will not boot, restart in recovery mode and remove the line you added.

Unmounting a drive safely

Before unplugging a drive, you must unmount it. This ensures all pending write operations finish and prevents data loss. Use the command sudo umount /mnt/external, replacing the path with your actual mount point. If the command returns an error saying the device is busy, something is still using it — close any open files or programs accessing the drive and try again.

Once unmounted, the folder still exists but is empty. You can now safely unplug the drive. If you want to remove the mount point folder itself, use sudo rmdir /mnt/external. If you added the drive to /etc/fstab and no longer want it to mount automatically, open the file again and delete the line you added.

Troubleshooting common mounting problems

If you see a "permission denied" error when trying to mount, you likely need to use sudo. If the mount command says "unknown filesystem type", the drive is formatted in a file system your Linux distribution does not recognize, or the drive is corrupted. Try sudo fsck /dev/sdb1 to check for errors (this works on ext4 drives; other file systems have different tools).

If a drive mounts but you cannot write to it, the file system may be mounted as read-only. Unmount it and remount with sudo mount -o remount,rw /mnt/external. If the drive does not appear in lsblk at all, check that it is properly connected and powered on. Some BIOS settings can hide drives; restart your computer and check the BIOS to confirm the drive is visible there. If it is not, the drive may be failing or the connection is loose.

Frequently Asked Questions

Can I mount a drive to a folder that already has files in it?

Yes, but the original files become hidden while the drive is mounted. Once you unmount, they reappear. To avoid confusion, mount to empty folders or folders you create specifically for that drive.

What is the difference between /mnt and /media?

/mnt is traditionally for manually mounted drives, while /media is for automatically mounted removable media like USB drives. Either works, but using /mnt for drives you mount yourself is clearer.

Do I have to unmount before shutting down the computer?

No, Linux will unmount all drives automatically during shutdown. However, unmounting before unplugging a drive is still necessary to prevent data loss if you remove it while the system is running.

Can I mount a drive to multiple locations at once?

Yes. You can mount the same drive to different folders using separate mount commands. This is useful if different programs need to access the same drive from different paths.

What happens if I mount a drive that is already mounted?

Linux will not allow it. If you try, you will get an error. Unmount the drive first, then mount it to the new location.