How to Mount and Unmount File Systems in Linux

When you plug in a USB drive, add a new disk, or connect to a network share, its files do not appear anywhere until the device is mounted. In Linux and Unix-like systems, the mount command attaches file systems and removable devices such as USB drives to a mount point in the directory tree. The umount command detaches them when you are done.
This guide explains how to mount and unmount file systems in Linux using the mount and umount commands, including USB drives, ISO files, NFS shares, and persistent /etc/fstab entries.
How to List Mounted File Systems
When used without any argument, the mount command will display all currently attached file systems:
mountBy default, the output will include all file systems including the virtual ones such as cgroup, sysfs, and others. Each line contains information about the device name, the directory to which the device is mounted, the type of the filesystem, and the mount options in the following form:
device_name on directory type filesystem_type (options)To display only certain file systems, use the -t option.
For example, to print only the ext4 partitions you would use:
mount -t ext4The findmnt command prints the same information as a tree. The output is easier to read than the plain mount output, and it shows how the mounts are nested:
findmntTo check a single mount point, pass it as an argument, for example findmnt /home.
Mounting a File System
To mount a file system in a given location (mount point), use the mount command in the following form:
mount [OPTION...] DEVICE_NAME DIRECTORYOnce the file system is attached, the mount point becomes the root directory of the mounted file system.
Before you mount a file system manually, the target directory must already exist. This directory is called the mount point. To create a mount point, use mkdir:
sudo mkdir -p /mnt/mediaFor example, to mount the /dev/sdb1 file system to the /mnt/media directory you would use:
sudo mount /dev/sdb1 /mnt/mediaUsually when mounting a device with a common file system such as ext4 or xfs, the mount command will auto-detect the file system type. However, some file systems are not recognized and need to be explicitly specified.
Use the -t option to specify the file system type:
mount -t TYPE DEVICE_NAME DIRECTORYTo specify additional mount options
, use the -o option:
mount -o OPTIONS DEVICE_NAME DIRECTORYMultiple options can be provided as a comma-separated list (do not insert a space after a comma).
You can get a list of all mount options by typing man mount in your terminal.
Mounting a File System using /etc/fstab
When providing just one parameter (either directory or device) to the mount command, it will read the content of the /etc/fstab configuration file to check whether the specified file system is listed or not.
If the /etc/fstab contains information about the given file system, the mount command uses the value for the other parameter and the mount options specified in the fstab file.
The /etc/fstab file contains a list of entries in the following form:
[File System] [Mount Point] [File System Type] [Options] [Dump] [Pass]Use the mount command in one of the following forms to attach a file system specified in the /etc/fstab file:
mount [OPTION...] DIRECTORY
mount [OPTION...] DEVICE_NAMEFor a full explanation of each field and the available mount options, see our guide on the /etc/fstab file .
Mounting a Drive Permanently
A file system mounted with the mount command stays mounted only until the next reboot. To mount a new disk or partition automatically at boot, add it to /etc/fstab. The steps below use the /dev/sdb1 partition and the /mnt/data mount point as an example.
Find the UUID of the partition with
blkid:Terminalsudo blkid /dev/sdb1output/dev/sdb1: UUID="5a1f3c2e-8b7d-4e6a-9c10-2f4b6d8e0a13" BLOCK_SIZE="4096" TYPE="ext4"Use the UUID in
/etc/fstab, not the device name. Device names such as/dev/sdb1can change when disks are added or removed, but the UUID stays the same. If you are not sure which device the drive uses, runlsblk -fto list all block devices with their file systems and UUIDs.Create the mount point:
Terminalsudo mkdir -p /mnt/dataOpen the
/etc/fstabfile:Terminalsudo nano /etc/fstabAdd the following line at the end of the file, replacing the UUID and the file system type with your own values:
/etc/fstabiniUUID=5a1f3c2e-8b7d-4e6a-9c10-2f4b6d8e0a13 /mnt/data ext4 defaults,nofail 0 2The
nofailoption lets the system boot normally when the drive is not connected. The last field,2, tellsfsckto check the file system after the root partition.Reload the systemd configuration and test the entry:
Terminalsudo systemctl daemon-reload sudo findmnt --verify sudo mount -aThe
findmnt --verifycommand checks/etc/fstabfor parsing errors and verifies whether its entries are usable. Themount -acommand then mounts entries that are not already mounted and do not use thenoautooption; it ignores swap entries. If both commands finish without errors, the system will attempt to mount the drive at every boot.
Systemd generates its mount units from /etc/fstab. If you skip the reload, mount prints a hint telling you that systemd still uses the old version of the file.
/etc/fstab entry can stop the system from booting normally. Validate the file with sudo findmnt --verify before you reboot. For a new unmounted entry that does not use noauto, run sudo mount -a to confirm that it mounts successfully.Mounting USB Drive
On most modern Linux distributions, USB drives will auto-mount when you plug them in, but sometimes you may need to manually mount the drive.
To manually mount a USB device, perform the following steps:
Create the mount point:
Terminalsudo mkdir -p /media/usbTo find the device name and file system type, use
lsblk -f:Terminallsblk -fThe
FSTYPEcolumn shows the file system type. After identifying the partition, you can runsudo blkid DEVICEto confirm its type and UUID.Assuming that the USB drive uses the
/dev/sdd1device, mount it to the/media/usbdirectory:Terminalsudo mount /dev/sdd1 /media/usb
Most current Linux distributions can mount exFAT USB drives without extra drivers. If you need to format or repair an exFAT drive, see the exFAT mount guide
for exfatprogs usage.
Mounting ISO Files
You can mount an ISO file using the loop device, which is a special pseudo-device that makes a file accessible as a block device.
Start by creating the mount point. It can be any location you want:
Terminalsudo mkdir /media/isoMount the ISO file to the mount point by typing the following command:
Terminalsudo mount /path/to/image.iso /media/iso -o loopReplace
/path/to/image.isowith the path to your ISO file.
For instructions on mounting read-only images as a regular user with udisksctl, working with other disk image formats, or extracting an image without mounting it, see the dedicated guide on how to mount an ISO file
.
Mounting NFS
To mount an NFS share , you will need to have the NFS client package installed on your system.
Install NFS client on Ubuntu, Debian, and Derivatives:
Terminalsudo apt install nfs-commonInstall NFS client on Fedora, RHEL, and Derivatives:
Terminalsudo dnf install nfs-utils
Use the steps below to mount a remote NFS directory on your system:
Create a directory to serve as the mount point for the remote filesystem:
Terminalsudo mkdir /media/nfsGenerally, you will want to mount the remote NFS share automatically at boot. To do so, open the
/etc/fstabfile with your text editor :Terminalsudo nano /etc/fstabAdd the following line to the file, replacing
remote.server:/dirwith the NFS server IP address or hostname and the exported directory:/etc/fstabini# <file system> <dir> <type> <options> <dump> <pass> remote.server:/dir /media/nfs nfs defaults 0 0Mount the NFS share by running the following command:
Terminalsudo mount /media/nfs
Mounting a Directory with a Bind Mount
Sometimes you need to make the contents of one directory available at another location without copying any data. A bind mount attaches an existing directory to a second mount point, so both paths show the same files.
Use the --bind option followed by the source and target directories:
sudo mount --bind /source/dir /target/dirBoth directories must already exist. After the bind mount, any change made under one path is visible under the other, because they point to the same data.
To make a bind mount persistent, add an entry to /etc/fstab using the bind option:
/source/dir /target/dir none bind 0 0Remounting a File System
To change the options of a file system that is already mounted, use the remount option. You do not need to unmount the file system first. For example, to remount the root file system in read-write mode:
sudo mount -o remount,rw /This is a common step in recovery mode, where the root file system is mounted read-only. In the same way, -o remount,ro switches a mounted file system to read-only mode.
Unmounting a File System
To detach a mounted file system, use the umount command followed by its mount point. Most unmount operations require root privileges. For example, to unmount /mnt/media, run:
sudo umount /mnt/mediaSpecifying the device name may also work, but that form is obsolete and can fail when the same device is mounted in more than one location. Prefer the mount point path.
If the file system is in use, the umount command will fail to detach it and print a target is busy error. In those situations, you can use the fuser command to find out which processes are accessing the file system:
sudo fuser -vm /mnt/mediaThe verbose output shows the processes and users accessing the mounted file system. Once you determine the processes, you can stop them and retry the unmount.
Lazy Unmount
Use the -l (--lazy) option to detach a busy file system from the directory tree right away. The kernel cleans up the remaining references once the file system is no longer busy:
sudo umount -l /mnt/nfsLazy unmount is intended primarily to prevent hangs caused by an unreachable network share. Existing references remain active until they close, the share cannot be remounted, and a reboot should follow soon. Do not use it as a shortcut for an ordinary target is busy error.
Force Unmount
Use the -f (--force) option to force an unmount. This option is meant for an unreachable NFS system:
sudo umount -f /mnt/nfsAny writes that have not reached the server may be lost. The command can still hang on some NFS mounts. If it does, use a lazy unmount instead.
Recursive Unmount
When other file systems are mounted under a directory, use the -R (--recursive) option to unmount the directory and everything mounted below it:
sudo umount -R /mnt/dataThe recursive unmount works only with a mount point path, not with a device name.
Quick Reference
For a printable quick reference, see the mount cheatsheet .
| Command | Description |
|---|---|
mount | List all mounted file systems |
mount -t ext4 | List mounted file systems of a specific type |
findmnt | Show mounted file systems as a tree |
sudo mount DEVICE DIR | Mount a device to a directory |
sudo mount -t TYPE DEVICE DIR | Mount with an explicit file system type |
sudo mount -o OPTIONS DEVICE DIR | Mount with specific options |
sudo mount DIR | Mount using /etc/fstab entry |
sudo mount -a | Mount unmounted /etc/fstab entries except noauto and swap |
sudo blkid /dev/sdb1 | Show the UUID and file system type of a partition |
sudo mount -o remount,rw / | Remount the root file system read-write |
sudo mount /dev/sdd1 /media/usb | Mount a USB drive |
sudo mount /path/to/image.iso /media/iso -o loop | Mount an ISO file |
sudo mount --bind /source/dir /target/dir | Bind mount one directory to another |
sudo umount DIRECTORY | Unmount by mount point |
sudo umount -l DIRECTORY | Lazy unmount an unreachable network share |
sudo umount -f DIRECTORY | Force unmount an unreachable NFS share |
sudo umount -R DIRECTORY | Unmount a directory and all mounts below it |
sudo fuser -vm DIRECTORY | Show processes and users accessing a mount point |
lsblk -f | List block devices, file system types, and mount points |
Troubleshooting
“must be superuser to use mount”
The mount command requires root privileges. Prefix the command with sudo, or add the device to /etc/fstab with the user option to allow non-root mounts.
“target is busy” when unmounting
A process is still accessing the file system. Run sudo fuser -vm DIRECTORY to identify the processes, then stop them before retrying sudo umount DIRECTORY. A shell whose current directory is inside the mount point also keeps it busy, so cd out of it first.
“wrong fs type, bad option, bad superblock”
The full message ends with “missing codepage or helper program, or other error”. The mount command could not attach the device with the given type or options. Check that the -t value matches the real file system, for example sudo mount -t ext4 /dev/sdb1 /mnt/data, and run lsblk -f to confirm it. If the type is correct, the file system may be damaged. Unmount it and check it with fsck
.
“bad option; for several filesystems (e.g. nfs, cifs)”
This error appears when you mount a network share and the client package is missing. Install nfs-common (Ubuntu, Debian) or nfs-utils (Fedora, RHEL) for NFS shares, and cifs-utils for Windows (SMB) shares
.
Mount does not persist after reboot
Mounts made with mount are not persistent. To mount a file system automatically at boot, add an entry to /etc/fstab as shown in the Mounting a Drive Permanently section.
“can’t read superblock” on a USB drive
The drive may use a file system that is not available on the running system, or the file system may be damaged. For exFAT drives, current distributions usually mount them natively; install exfatprogs if you need repair tools, then retry the mount.
FAQ
What is the difference between mount and umount?mount attaches a file system to a directory in the tree, making its contents accessible at that path. umount detaches it, and the directory shows its original contents again.
Why is the command umount and not unmount?
The command has been spelled umount since early Unix, a historical convention, not a typo.
How do I make a mount persistent across reboots?
Add an entry to /etc/fstab. The format is: DEVICE MOUNTPOINT FSTYPE OPTIONS DUMP PASS. After editing the file, run sudo findmnt --verify to validate it. Use sudo mount -a to try new unmounted entries that do not use noauto without rebooting.
What is a mount point in Linux?
A mount point is a directory where a file system is attached and made accessible. After mounting, the mounted file system appears under that directory path.
How do I find the device name of a connected drive?
Run lsblk -f
to list block devices with their file system types and mount points. After identifying the device, use sudo blkid DEVICE to confirm its type and UUID.
Can I mount a directory to another directory?
Yes, using a bind mount: sudo mount --bind /source/dir /target/dir. This makes the contents of the source directory accessible at the target path without duplicating any data.
Conclusion
The mount command is the primary tool for attaching file systems in Linux, from local partitions and USB drives to ISO images and NFS shares. Use /etc/fstab to make mounts persistent across reboots, and umount to safely detach them when done. For NFS-specific setup, see the NFS mount guide
.
Tags
Linuxize Weekly Newsletter
A quick weekly roundup of new tutorials, news, and tips.
About the authors

Dejan Panovski
Dejan Panovski is the founder of Linuxize, an RHCSA-certified Linux system administrator and DevOps engineer based in Skopje, Macedonia. Author of 1000+ Linux tutorials with 20+ years of experience turning complex Linux tasks into clear, reliable guides.
View author page