Linux /mnt vs /media: How External Devices Are Mounted
Learn how Linux uses /mnt for manual mounts and /media for removable media, where udisks2 auto-mounts USB drives, and how to use mount and fstab safely.
In Linux, /mnt is a general mount point for filesystems an administrator mounts temporarily by hand, such as a recovery disk or network share. /media holds mount points for removable media like USB drives and DVDs. On modern desktops, udisks2 mounts removable devices automatically under /run/media/$USER (Fedora, RHEL) or /media/$USER (Debian, Ubuntu).
This guide explains what the Filesystem Hierarchy Standard says about each directory, how desktop and server systems actually behave, and the commands to mount, unmount and persist external storage safely. It builds on the Linux filesystem hierarchy overview and the RHEL 10 setup guide.
Key takeaways
- FHS 3.0 defines /mnt for temporarily mounted filesystems and /media for removable media mount points.
- Desktop environments use udisks2 to auto-mount devices. Fedora and RHEL use /run/media/username; Debian and Ubuntu use /media/username.
- On servers, nothing is mounted automatically. You mount with
mount, persist with/etc/fstab, and identify devices by UUID, not by/dev/sdXnames. - Use
nofailfor external disks in fstab so a missing drive does not stop the boot. - Mount untrusted removable media with
nosuid,nodev,noexecand always unmount before unplugging.
/mnt vs /media at a glance
| Aspect | /mnt | /media |
|---|---|---|
| FHS purpose | Temporarily mounted filesystems | Mount points for removable media |
| Who mounts | The system administrator, by hand | Desktop tools (udisks2) or the admin |
| Typical contents | Recovery disk, ISO image, NFS share during maintenance | USB stick, external HDD, SD card, optical disc |
| Subdirectories | Created by the admin as needed | Per device (for example /media/cdrom) or per user (/media/alice/USB) |
| Persistence | Usually temporary; permanent mounts belong elsewhere | Usually for the session the device is plugged in |
| Auto-mounting | No | On Debian and Ubuntu desktops, yes |
What the Filesystem Hierarchy Standard says
The Filesystem Hierarchy Standard 3.0, published by the Linux Foundation, describes /mnt as a place where the system administrator may temporarily mount a filesystem as needed. It says the content of /mnt is a local issue and should not affect how programs run. Installation programs should not rely on it.
The standard describes /media as the directory containing subdirectories used as mount points for removable media such as floppy disks, CD-ROMs and Zip disks. The device examples are dated, but the purpose still applies to USB drives and SD cards. FHS 2.3 added /media to separate removable media from the admin's temporary mounts in /mnt.
FHS 3.0 also defines /run for runtime data that is cleared at boot, which is why some distributions place automatic mounts under /run/media.
How modern desktops auto-mount: udisks2
When you plug in a USB drive on a GNOME or KDE desktop, the kernel creates a device node, udev records its properties, and udisks2 mounts it on behalf of the logged-in user. The mount location depends on the distribution:
| Distribution family | Default auto-mount path |
|---|---|
| Fedora, RHEL, CentOS Stream, Arch | /run/media/<username>/<label> |
| Debian, Ubuntu, Linux Mint | /media/<username>/<label> |
The per-user subdirectory keeps one user's device private from other users on the same machine. You can mount and unmount from the command line through udisks2 too, without root, if your session is allowed by polkit:
udisksctl mount -b /dev/sdb1
udisksctl unmount -b /dev/sdb1
udisksctl power-off -b /dev/sdb # spin down before unplugging
Servers: manual mounting step by step
Servers usually have no desktop session, so nothing mounts automatically. This is where /mnt is used most.
1. Identify the device
lsblk -f # devices, filesystems, labels, UUIDs, mount points
sudo blkid /dev/sdb1
dmesg | tail # kernel messages after plugging in
Device names such as /dev/sdb can change between boots or when another disk is attached. Use the UUID or label for anything persistent.
2. Create a mount point and mount
sudo mkdir -p /mnt/backup
sudo mount /dev/sdb1 /mnt/backup
findmnt /mnt/backup # confirm source, type and options
For removable media you can mount under /media in the same way, for example sudo mount /dev/sr0 /media/cdrom. An ISO image mounts through a loop device:
sudo mkdir -p /mnt/iso
sudo mount -o loop,ro rhel-10.0-x86_64-dvd.iso /mnt/iso
3. Unmount cleanly
sync
sudo umount /mnt/backup
# "target is busy"? find what is using it:
sudo fuser -vm /mnt/backup
sudo lsof +f -- /mnt/backup
Unplugging without unmounting can lose data that was still in the write cache.
Persistent mounts with /etc/fstab
For a disk that should be mounted at every boot, add a line to /etc/fstab. FHS treats /mnt as temporary, so for permanent data mounts many admins prefer a dedicated path such as /srv/data or /data, though /mnt subdirectories are also common in practice.
# <device> <mount point> <type> <options> <dump> <pass>
UUID=3f1c2a7e-8b9d-4c1e-a2f0-5d6e7f8a9b0c /data xfs defaults,nofail 0 2
UUID=7A3B-1C2D /media/usbbak vfat noauto,nofail,uid=1000,gid=1000,umask=022 0 0
nofail: boot continues if the device is absent. Important for external disks.noauto: not mounted at boot; mount later withsudo mount /media/usbbak.x-systemd.automount: systemd mounts the filesystem on first access, useful for drives and network shares that are not always available.
After editing, test before rebooting. A bad fstab line can drop the system into emergency mode.
sudo findmnt --verify # checks fstab syntax and targets
sudo systemctl daemon-reload
sudo mount -a
On systemd systems, each fstab line becomes a mount unit. You can also write .mount and .automount units directly, as described in the systemd.mount manual.
Network shares under /mnt
NFS and SMB shares are often mounted under /mnt for maintenance tasks or under a dedicated path for permanent use.
# NFS (needs nfs-utils or nfs-common)
sudo mkdir -p /mnt/nfs
sudo mount -t nfs4 fileserver.example.com:/exports/projects /mnt/nfs
# SMB/CIFS (needs cifs-utils); keep credentials in a root-only file
sudo mount -t cifs //fileserver/share /mnt/share \
-o credentials=/root/.smbcred,uid=1000,gid=1000
Set the credentials file to mode 600 so other users cannot read the password. For fstab entries on network shares, add _netdev so systemd waits for the network.
Security for removable media
A USB drive from an unknown source can carry setuid binaries or device files. Mount options limit what it can do:
| Option | Effect |
|---|---|
| nosuid | Ignores setuid and setgid bits on files |
| nodev | Ignores device files on the filesystem |
| noexec | Prevents running binaries directly from it |
| ro | Mounts read-only, useful for forensic copies and installers |
sudo mount -o ro,nosuid,nodev,noexec /dev/sdb1 /media/usb
udisks2 already applies nosuid and nodev to the removable devices it mounts. On hardened servers, admins sometimes block USB storage entirely, for example by blacklisting the usb-storage kernel module, or allow only approved devices with USBGuard, which is packaged in RHEL. SELinux contexts also apply; on RHEL, use the context= mount option if a service must read a mounted filesystem. Read more in SELinux in RHEL 10 explained.
Practical uses in DevOps and admin work
- Backups: mount an external disk at /mnt/backup, run
rsync -aAX, then unmount. See automating backups with rsync and cron. - Recovery: boot a rescue image, mount the broken root filesystem at /mnt/sysroot, and chroot into it to repair the bootloader or fstab.
- Installing from media: mount a RHEL DVD ISO at /mnt/iso and use it as a local repository. Steps are in configuring RHEL 10 repositories.
- New disks: after partitioning and creating a filesystem, mount it temporarily under /mnt to copy data before moving it to its final place. See partitioning and formatting a new disk.
- Containers: a host path under /mnt is often bind-mounted into containers, such as
docker run -v /mnt/data:/data. Check SELinux labels (:Zor:z) on RHEL hosts.
Common problems and fixes
| Problem | Likely cause | Fix |
|---|---|---|
| mount: wrong fs type, bad option | Filesystem driver missing (exFAT, NTFS) or wrong type | Check lsblk -f, install the driver package, specify -t |
| target is busy on umount | A shell or process is using the mount | fuser -vm or lsof, then cd out and retry |
| System stops in emergency mode at boot | fstab entry for a missing device without nofail | Fix fstab from the emergency shell, add nofail |
| Files owned by root on a FAT drive | FAT has no Unix ownership | Mount with uid=, gid=, umask= |
| Device name changed after reboot | Kernel enumeration order | Use UUID= or LABEL= in fstab |
Practise in a lab
Mounting, fstab and storage management are core tasks in the RHCSA exam. The RHCSA training and the Linux admin training cover them hands-on, in Kharadi, Pune or live online.
Frequently asked questions
What is the difference between /mnt and /media in Linux?
Under the Filesystem Hierarchy Standard, /mnt is for filesystems an administrator mounts temporarily by hand, while /media holds mount points for removable media such as USB drives and optical discs.
Where does Linux mount USB drives automatically?
Desktop systems use udisks2. Fedora, RHEL and Arch mount under /run/media/username, while Debian and Ubuntu use /media/username. Servers without a desktop do not auto-mount.
Can I use /mnt for permanent mounts?
You can, and many systems do, but FHS describes /mnt as temporary. For permanent data, a dedicated path such as /data or /srv is clearer. Use UUID and nofail in /etc/fstab either way.
How do I mount a USB drive from the command line?
Find it with lsblk -f, create a mount point such as /media/usb, and run sudo mount /dev/sdb1 /media/usb. As a normal desktop user you can run udisksctl mount -b /dev/sdb1 instead.
How do I safely remove an external drive in Linux?
Run sync, then sudo umount on the mount point, or udisksctl unmount and power-off. If umount says the target is busy, find the process with fuser -vm or lsof.
Why does my system fail to boot after adding an external disk to fstab?
If the disk is missing at boot and the entry lacks nofail, systemd waits and then drops to emergency mode. Add nofail, use UUID instead of /dev/sdX, and test with findmnt --verify and mount -a.
Which mount options make removable media safer?
nosuid, nodev and noexec stop setuid binaries, device files and direct execution. Add ro for read-only access to untrusted media.
References
What's Your Reaction?
Like
0
Dislike
0
Love
0
Funny
0
Angry
0
Sad
0
Wow
0