Last modified: June 06, 2026
This article is written in: πΊπΈ
In Linux, mounting is the process of making a filesystem available somewhere inside the main directory tree.
This can feel unusual if you come from Windows. In Windows, storage devices usually appear as separate drive letters, such as:
C:\
D:\
E:\
Linux works differently. Linux has one main directory tree that starts at:
/
Storage devices, partitions, USB drives, ISO files, and network shares are attached somewhere inside that tree.
For example, a USB drive might be mounted at:
/mnt/external
or:
/media/user/USB_DRIVE
Once mounted, the device looks like an ordinary directory. You can use commands such as cd, ls, cp, mv, and rm to work with its files.
Many different things can be mounted in Linux.
Common examples include:
Network filesystems can also be mounted, such as:
NFS common on Unix/Linux networks
SMB/CIFS common for Windows file shares
Linux also mounts special pseudo-filesystems that do not represent normal storage devices. These include:
/proc
/sys
/dev
/run
These provide information about processes, hardware, devices, and runtime system state.
Some filesystems are required for the system to work.
For example:
/ root filesystem
/proc process and kernel information
/sys hardware and kernel information
/dev device files
These are usually mounted automatically during boot.
Other filesystems are optional. These include USB drives, extra partitions, external disks, ISO images, and network shares.
Optional filesystems may be mounted manually by the user or automatically by the desktop environment.
On desktop distributions such as Ubuntu, Fedora, or Linux Mint, removable devices are often mounted automatically.
For example, when you plug in a USB drive, the file manager may automatically mount it under something like:
/media/username/USB_NAME
This is convenient for normal desktop use.
Manual mounting is still useful when:
Mounting attaches a filesystem to a directory.
That directory is called a mount point.
Before mounting, the directory is just an ordinary directory. After mounting, the contents of the mounted filesystem appear there.
Linux Directory Tree Before Mounting:
/
βββ bin
βββ etc
βββ home
β βββ user
βββ mnt
βββ usr
βββ var
Now suppose a USB drive partition is available as:
/dev/sdb1
and we mount it at:
/mnt/external
After mounting, the tree may look like this:
Linux Directory Tree After Mounting /dev/sdb1 at /mnt/external:
/
βββ bin
βββ etc
βββ home
β βββ user
βββ mnt
β βββ external <-- Mounted device /dev/sdb1
β βββ documents
β βββ photos
β βββ videos
βββ usr
βββ var
The files are physically stored on /dev/sdb1, but they are accessed through /mnt/external.
A simple way to remember this is:
Device or filesystem + mount point = accessible files
Mounting does not copy files into the mount point.
It simply makes the filesystem visible at that location.
For example:
sudo mount /dev/sdb1 /mnt/external
does not copy the USB drive into /mnt/external.
It attaches the filesystem on /dev/sdb1 so that its contents can be accessed through /mnt/external.
A mount point is a directory where a filesystem is attached.
Common mount point locations include:
/mnt traditional temporary mount location
/media common location for removable media
/backup custom mount point for backup drives
/data custom mount point for data disks
For example:
/mnt/external
/mnt/iso
/media/usb
/data
/backup
A mount point should usually be empty before mounting.
If the directory already contains files, those files are not deleted, but they become hidden while another filesystem is mounted on top of that directory.
Example:
Before mounting:
/mnt/external contains oldfile.txt
After mounting /dev/sdb1 at /mnt/external:
/mnt/external shows the USB drive contents
After unmounting:
/mnt/external shows oldfile.txt again
This can confuse beginners, so it is best to use an empty directory as the mount point.
Linux represents storage devices using files under:
/dev
Examples:
/dev/sda first disk
/dev/sda1 first partition on first disk
/dev/sdb second disk
/dev/sdb1 first partition on second disk
/dev/nvme0n1 NVMe disk
/dev/nvme0n1p1 first partition on NVMe disk
A USB drive might appear as:
/dev/sdb
and its first partition might appear as:
/dev/sdb1
However, device names can change after rebooting or reconnecting hardware. For persistent configuration, it is usually better to use a UUID instead of a device name.
Before mounting a device, first check whether Linux can see it.
Useful commands include:
lsblk
sudo fdisk -l
blkid
The lsblk command is often the easiest for beginners.
Example:
lsblk
Example output:
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
sda 8:0 0 256.0G 0 disk
ββsda1 8:1 0 512M 0 part /boot
ββsda2 8:2 0 255.5G 0 part /
sdb 8:16 1 32.0G 0 disk
ββsdb1 8:17 1 32.0G 0 part
This shows that /dev/sdb1 exists but is not currently mounted.
The fdisk -l command gives more detailed partition information:
sudo fdisk -l
Example output:
Disk /dev/sdb: 32 GB
Device Boot Start End Sectors Size Id Type
/dev/sdb1 2048 62521343 62519296 29.8G 83 Linux
This means:
/dev/sdb is the disk
/dev/sdb1 is a partition on that disk
29.8G is the partition size
Linux is the partition type
The partition is usually what you mount, not the whole disk.
So you usually mount:
/dev/sdb1
not:
/dev/sdb
mount CommandThe mount command attaches a filesystem to a mount point.
Basic syntax:
mount [OPTIONS] DEVICE MOUNT_POINT
Example:
sudo mount /dev/sdb1 /mnt/external
This means:
Mount the filesystem on /dev/sdb1 at /mnt/external.
The general workflow is:
Find the device
|
v
Create a mount point
|
v
Mount the device
|
v
Access files through the mount point
Suppose a USB drive partition is available as:
/dev/sdb1
and you want to access it at:
/mnt/external
First, create the mount point:
sudo mkdir -p /mnt/external
Then mount the device:
sudo mount /dev/sdb1 /mnt/external
Now list the files:
ls /mnt/external
You can also move into the mounted filesystem:
cd /mnt/external
To see mounted filesystems, you can run:
mount
However, the output can be long.
A cleaner command is:
findmnt
To check one mount point:
findmnt /mnt/external
Example output:
TARGET SOURCE FSTYPE OPTIONS
/mnt/external /dev/sdb1 ext4 rw,relatime
This means:
| Description | |
| TARGET | Where it is mounted |
| SOURCE | Device being mounted |
| FSTYPE | Filesystem type |
| OPTIONS | Mount options |
You can also use:
df -h
This shows mounted filesystems and available space in a human-readable format.
A mount entry might look like this:
/dev/sdb1 on /mnt/external type ext4 (rw,relatime)
Breaking it down:
/dev/sdb1 device
/mnt/external mount point
ext4 filesystem type
rw read-write
relatime access-time update behavior
The rw option means the filesystem is mounted read-write.
A read-only mount would show:
ro
A filesystem type describes how data is organized on the device.
Common filesystem types include:
| Filesystem | Description |
| ext4 | Common Linux filesystem |
| xfs | Common on servers |
| btrfs | Modern Linux filesystem with advanced features |
| vfat | FAT32, common for USB drives |
| exfat | Common for large USB drives and SD cards |
| ntfs | Common Windows filesystem |
| iso9660 | CD/DVD ISO filesystem |
| nfs | Network File System |
| cifs | Windows/Samba network share |
Usually Linux can detect the filesystem automatically.
If needed, you can specify it manually with -t.
Example:
sudo mount -t ext4 /dev/sdb1 /mnt/external
For an NTFS drive:
sudo mount -t ntfs3 /dev/sdb1 /mnt/external
On some systems, especially older ones, NTFS support may use ntfs-3g:
sudo mount -t ntfs-3g /dev/sdb1 /mnt/external
If you get an error about an unknown filesystem type, you may need to install support for that filesystem.
Mount options control how the filesystem is mounted.
Options are passed with -o.
Example:
sudo mount -o ro /dev/sdb1 /mnt/external
This mounts the filesystem as read-only.
Common options include:
| Option | Description |
| ro | Read-only |
| rw | Read-write |
| noexec | Do not allow execution of programs from the filesystem |
| nosuid | Ignore set-user-ID and set-group-ID bits |
| nodev | Do not interpret device files |
| uid=1000 | Set file owner for filesystems without Unix ownership |
| gid=1000 | Set group owner |
| defaults | Use default options |
Examples:
sudo mount -o ro /dev/sdb1 /mnt/external
sudo mount -o noexec,nosuid,nodev /dev/sdb1 /mnt/external
Read-only mounting is useful when you want to inspect a disk without accidentally changing it.
Unmounting detaches a mounted filesystem from the directory tree.
The command is:
umount
Notice the spelling:
umount
not:
unmount
To unmount a filesystem, use either the mount point or the device.
Example using the mount point:
sudo umount /mnt/external
Example using the device:
sudo umount /dev/sdb1
After unmounting, the files from the device are no longer visible at the mount point.
You should unmount removable storage before physically removing it.
Linux often caches writes. This means that when you copy a file to a USB drive, the command may finish before all data has actually been written to the physical device.
Unmounting makes sure pending writes are completed.
The safe workflow is:
Copy files
|
v
Unmount the device
|
v
Wait for command to finish
|
v
Physically remove the device
If you unplug a device without unmounting it, you may cause:
sync CommandThe sync command asks Linux to flush cached writes to storage.
sync
This can be useful before unmounting removable media.
However, sync is not a replacement for umount.
A safer sequence is:
sync
sudo umount /mnt/external
Sometimes unmounting fails with an error like:
umount: /mnt/external: target is busy
This means something is still using the mounted filesystem.
Common causes include:
For example, if your terminal is currently in:
/mnt/external
then unmounting may fail.
Move out of the directory:
cd ~
Then try again:
sudo umount /mnt/external
To see which processes are using a mount point, use lsof:
sudo lsof +f -- /mnt/external
Example output:
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
bash 1234 user cwd DIR 8,17 4096 2 /mnt/external
This means a Bash process with PID 1234 has its current working directory inside /mnt/external.
The most important fields are:
| Field | Description |
| COMMAND | Process name |
| PID | Process ID |
| USER | User running the process |
| FD | File descriptor |
| NAME | File or directory being used |
Another useful command is:
sudo fuser -vm /mnt/external
To close the issue, first try to close the application or move the terminal out of the directory.
If needed, terminate the process:
sudo kill 1234
Use kill carefully. Terminating a process that is writing data may cause data loss.
The umount command has advanced options.
Lazy unmount:
sudo umount -l /mnt/external
The -l option detaches the filesystem now and cleans it up after it is no longer busy.
Forced unmount:
sudo umount -f /mnt/external
The -f option forces the unmount.
Forced unmounts should be used carefully, especially for local disks, because they can risk data corruption.
A good rule is:
Sometimes Linux does not automatically detect the filesystem type, or you want to be explicit.
Example for ext4:
sudo mount -t ext4 /dev/sdb1 /mnt/external
Example for NTFS:
sudo mount -t ntfs3 /dev/sdb1 /mnt/external
Example for FAT32:
sudo mount -t vfat /dev/sdb1 /mnt/external
Example for exFAT:
sudo mount -t exfat /dev/sdb1 /mnt/external
If mounting fails, check the filesystem type with:
lsblk -f
or:
sudo blkid /dev/sdb1
Example:
/dev/sdb1: UUID="ABCD-1234" TYPE="exfat" LABEL="MYUSB"
An ISO image is a file that contains the contents of a CD, DVD, or installation image.
For example:
ubuntu.iso
You can mount an ISO file without burning it to a disc.
First create a mount point:
sudo mkdir -p /mnt/iso
Then mount the ISO:
sudo mount -o loop ubuntu.iso /mnt/iso
The loop option lets Linux treat a regular file as if it were a block device.
After mounting, view the files:
ls /mnt/iso
When finished, unmount it:
sudo umount /mnt/iso
The workflow looks like this:
ubuntu.iso file
|
v
loop device
|
v
mounted at /mnt/iso
|
v
contents become accessible
Network shares can also be mounted.
Two common types are:
NFS common between Linux/Unix systems
CIFS used for Windows/Samba shares
Example NFS mount:
sudo mount -t nfs server:/export/data /mnt/data
Example CIFS mount:
sudo mount -t cifs //server/share /mnt/share -o username=myuser
Network mounts are common for shared storage, home directories, backups, and file servers.
For persistent network mounts, /etc/fstab or systemd mount units are often used.
/etc/fstabManual mounts disappear after reboot.
To mount a filesystem automatically at boot, configure it in:
/etc/fstab
The file contains one filesystem per line.
Example:
/dev/sdb1 /mnt/external ext4 defaults 0 2
The fields are:
| Field | Value |
| Device | /dev/sdb1 |
| Mount point | /mnt/external |
| Filesystem | ext4 |
| Options | defaults |
| Dump | 0 |
| fsck pass | 2 |
The last two fields are older but still important:
0 do not use dump backup
2 check this filesystem after the root filesystem
The root filesystem usually has pass value 1.
Other local Linux filesystems often use 2.
Filesystems that should not be checked at boot often use 0.
/etc/fstabDevice names such as /dev/sdb1 can change.
For example, today a USB drive may be:
/dev/sdb1
but after reboot it may become:
/dev/sdc1
To avoid this problem, use a UUID.
Find the UUID:
sudo blkid /dev/sdb1
Example:
/dev/sdb1: UUID="1234-ABCD" TYPE="ext4"
Then use the UUID in /etc/fstab:
UUID=1234-ABCD /mnt/external ext4 defaults 0 2
This is more reliable than using /dev/sdb1.
/etc/fstabAfter editing /etc/fstab, do not reboot immediately.
First test it with:
sudo mount -a
This attempts to mount everything listed in /etc/fstab.
If there is an error, fix it before rebooting.
A bad /etc/fstab entry can cause boot problems, especially if it refers to an unavailable device without safe options.
For removable or optional drives, consider options such as:
nofail
x-systemd.automount
Example:
UUID=1234-ABCD /mnt/external ext4 defaults,nofail 0 2
The nofail option allows the system to continue booting even if the device is not present.
Before mounting:
/
βββ bin
βββ etc
βββ home
β βββ user
βββ mnt
βββ usr
βββ var
After mounting /dev/sdb1 at /mnt/external:
/
βββ bin
βββ etc
βββ home
β βββ user
βββ mnt
β βββ external
β βββ data
β βββ projects
βββ usr
βββ var
The mounted filesystem becomes part of the normal directory tree.
You do not access it through a separate drive letter. You access it through the mount point.
A safe manual mounting workflow looks like this:
Commands:
lsblk -f
sudo mkdir -p /mnt/external
sudo mount /dev/sdb1 /mnt/external
ls /mnt/external
sudo umount /mnt/external
Always unmount removable filesystems before unplugging them.
This matters because Linux may delay writes for performance.
For example, copying a file may appear to finish quickly, but some data may still be waiting in memory.
Unmounting ensures that:
This reduces the chance of corruption or data loss.
Many desktop systems already automount removable drives.
For servers or custom setups, there are several ways to automate mounting:
For most users, /etc/fstab is the best starting point.
For advanced users, udev can run actions when hardware appears or disappears.
udevudev manages device events in Linux.
It can detect when a USB drive is connected and run a command or script.
However, using udev directly for mounting can be tricky. Long commands with shell features such as && may not work as expected unless run through a script or shell.
A cleaner approach is to have a udev rule call a script.
First, identify the device UUID:
sudo blkid /dev/sdX1
Example:
/dev/sdX1: UUID="1234-ABCD" TYPE="ext4"
Create a script:
sudo nano /usr/local/sbin/mount-my-usb.sh
Example script:
#!/bin/sh
mkdir -p /media/my_usb
mount UUID=1234-ABCD /media/my_usb
Make it executable:
sudo chmod +x /usr/local/sbin/mount-my-usb.sh
Then create a udev rule:
sudo nano /etc/udev/rules.d/99-usb-mount.rules
Example rule:
ACTION=="add", SUBSYSTEM=="block", ENV{ID_FS_UUID}=="1234-ABCD", RUN+="/usr/local/sbin/mount-my-usb.sh"
Reload rules:
sudo udevadm control --reload-rules
sudo udevadm trigger
Then unplug and reconnect the device to test.
For many real systems, systemd automounts or desktop automounting are easier and more reliable than custom udev mounting rules.
Example:
mount: permission denied
Possible causes:
Try:
sudo mount /dev/sdb1 /mnt/external
If the mount succeeds but your user cannot write to the mounted filesystem, check ownership and permissions.
For Linux filesystems such as ext4, use:
ls -ld /mnt/external
For FAT, exFAT, or NTFS filesystems, ownership may need to be controlled with mount options such as uid and gid.
Example:
sudo mount -o uid=1000,gid=1000 /dev/sdb1 /mnt/external
Example:
mount: unknown filesystem type 'exfat'
Possible causes:
Check the type:
lsblk -f
or:
sudo blkid /dev/sdb1
Then install the needed support package if necessary.
For example, NTFS or exFAT support may require additional packages on some systems.
Example:
umount: /mnt/external: target is busy
Find processes using it:
sudo lsof +f -- /mnt/external
or:
sudo fuser -vm /mnt/external
Then close the program, move out of the directory, or stop the process.
Common fix:
cd ~
sudo umount /mnt/external
Example:
mount: /dev/sdb1 does not exist
Check devices:
lsblk
Possible causes:
Check recent kernel messages:
dmesg | tail
/etc/fstab EntryIf mount -a fails, inspect /etc/fstab.
Common mistakes include:
Create the mount point if missing:
sudo mkdir -p /mnt/external
Then test again:
sudo mount -a
lsblk and fdisk -l to identify the device name and partition details. Discuss how device names are assigned and explain the difference between physical devices and partitions./mnt or /media, and mount your USB drive to this directory using the mount command. Describe the purpose of mount points and how they provide access to external storage devices on Linux.dd command, specifying its size and location. Discuss how virtual disk files can simulate actual disks and their potential uses in testing and development.ext4 filesystem using mkfs.ext4. Explain the significance of different filesystem types and why choosing an appropriate filesystem is important for specific use cases./mnt, just as you would a physical device. Discuss the concept of loopback devices and how they allow files to be mounted as if they were physical disks./etc/fstab. Explain how persistent mounts work and the benefits of configuring automatic mounts for commonly used devices.udev rules for automation. Explain how udev helps manage device events in Linux and the advantages of automated mounting for frequently used external devices.