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.

Jul 31, 2025 - 21:53
Nov 10, 2026 - 05:19
 0  195
TOPICDevOps BasicsPractical guide
Linux /mnt vs /media: How External Devices Are Mounted

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/sdX names.
  • Use nofail for external disks in fstab so a missing drive does not stop the boot.
  • Mount untrusted removable media with nosuid,nodev,noexec and always unmount before unplugging.

/mnt vs /media at a glance

Aspect/mnt/media
FHS purposeTemporarily mounted filesystemsMount points for removable media
Who mountsThe system administrator, by handDesktop tools (udisks2) or the admin
Typical contentsRecovery disk, ISO image, NFS share during maintenanceUSB stick, external HDD, SD card, optical disc
SubdirectoriesCreated by the admin as neededPer device (for example /media/cdrom) or per user (/media/alice/USB)
PersistenceUsually temporary; permanent mounts belong elsewhereUsually for the session the device is plugged in
Auto-mountingNoOn 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 familyDefault 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 with sudo 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:

OptionEffect
nosuidIgnores setuid and setgid bits on files
nodevIgnores device files on the filesystem
noexecPrevents running binaries directly from it
roMounts 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 (:Z or :z) on RHEL hosts.

Common problems and fixes

ProblemLikely causeFix
mount: wrong fs type, bad optionFilesystem driver missing (exFAT, NTFS) or wrong typeCheck lsblk -f, install the driver package, specify -t
target is busy on umountA shell or process is using the mountfuser -vm or lsof, then cd out and retry
System stops in emergency mode at bootfstab entry for a missing device without nofailFix fstab from the emergency shell, add nofail
Files owned by root on a FAT driveFAT has no Unix ownershipMount with uid=, gid=, umask=
Device name changed after rebootKernel enumeration orderUse 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

Interested in learning more?Get a callback from our training advisors.

What's Your Reaction?

Like Like 0
Dislike Dislike 0
Love Love 0
Funny Funny 0
Angry Angry 0
Sad Sad 0
Wow Wow 0
Mridul I am a passionate technology enthusiast with a strong focus on DevOps, Cloud Computing, and Cybersecurity. Through my blogs at DevOps Training Institute, I aim to simplify complex concepts and share practical insights for learners and professionals. My goal is to empower readers with knowledge, hands-on tips, and industry best practices to stay ahead in the ever-evolving world of DevOps.