Linux mount Command: Mount USB, ISO, NFS & Filesystems

mount attaches a filesystem (block device, loop file, NFS export, or ISO image) to a directory tree. umount detaches it. fstab lists mounts applied at boot with mount -a.

Published

Updated

Read time 8 min read

Reviewed byDeepak Prasad

Linux mount Command: Mount USB, ISO, NFS & Filesystems
About mount attaches a filesystem (block device, loop file, NFS export, or ISO image) to a directory tree. umount detaches it. fstab lists mounts applied at boot with mount -a.
Tested on Ubuntu 25.04 (Plucky Puffin); mount from util-linux 2.40.2; kernel 7.0.0-27-generic
Package mount (apt/deb) · util-linux (dnf/rpm)
Man page mount(8)
Privilege root / sudo for most mounts
Distros

All Linux distros (util-linux mount).

NFS mounts also need nfs-common client packages.

Related guide

mount — quick reference

Basic mount and list

When to use Command
Mount a device when type is auto-detected sudo mount /dev/sdX1 /mnt
Mount with explicit filesystem type sudo mount -t ext4 /dev/sdX1 /mnt
Mount all entries in /etc/fstab sudo mount -a
Dry-run fstab mounts (no kernel call) sudo mount -a -f
List mounted filesystems mount -l
Show what is mounted at a path findmnt /mnt
Show mounts that fstab would apply findmnt --fstab
Show filesystem labels in mount list mount -l (with -l on supported setups)

Loop and image files

When to use Command
Mount a disk image file as a block device sudo mount -o loop image.img /mnt
Mount an ISO 9660 image read-only sudo mount -o loop,ro file.iso /mnt
Specify type for ISO images sudo mount -t iso9660 -o loop,ro file.iso /mnt

Common mount options (-o)

When to use Command
Read-only remount of a live mount sudo mount -o remount,ro /mnt
Read-write remount sudo mount -o remount,rw /mnt
Do not update /etc/mtab (rare) sudo mount -n /dev/sdX1 /mnt
Create mount point if missing sudo mount -m /dev/sdX1 /mnt
Skip mount.<type> helper sudo mount -i /dev/sdX1 /mnt

Block device discovery

When to use Command
List block devices and mountpoints lsblk
Show UUID, TYPE, and LABEL sudo blkid /dev/sdX1
List SCSI/USB disks lsscsi
List USB devices lsusb

Network filesystems

When to use Command
Mount NFSv4 export sudo mount -t nfs -o vers=4 server:/export /mnt
Mount NFSv3 export sudo mount -t nfs -o vers=3 server:/export /mnt
fstab line for NFS server:/export /mnt nfs defaults 0 0

Unmount

When to use Command
Unmount by mount point sudo umount /mnt
Unmount by device sudo umount /dev/sdX1
Lazy unmount (detach when idle) sudo umount -l /mnt
Force unmount (use carefully) sudo umount -f /mnt

Help

When to use Command
Show util-linux mount usage mount --help
Show mount version mount -V

mount — command syntax

Synopsis from mount --help on Ubuntu 25.04 (util-linux 2.40.2):

text
mount [-lhV]
mount -a [options]
mount [options] [--source] <source> | [--target] <directory>
mount [options] <source> <directory>

mount updates the kernel mount table; on many systems /etc/fstab defines boot-time mounts and findmnt reads the live tree. Use umount to detach. Most examples need sudo.


mount — command examples

Essential Mount an ext4 disk image with a loop device

Use a loop mount when you have a file-backed filesystem (backups, lab images) without a spare partition.

Run the commands:

bash
mkdir -p /tmp/mount-lab/ext4mnt
dd if=/dev/zero of=/tmp/mount-lab/ext4.img bs=1M count=32 status=none
mkfs.ext4 /tmp/mount-lab/ext4.img
sudo mount -o loop /tmp/mount-lab/ext4.img /tmp/mount-lab/ext4mnt
echo hello > /tmp/mount-lab/ext4mnt/hello.txt
findmnt /tmp/mount-lab/ext4mnt

Sample output:

text
TARGET                 SOURCE      FSTYPE OPTIONS
/tmp/mount-lab/ext4mnt /dev/loop26 ext4   rw,relatime

Clean up when finished: sudo umount /tmp/mount-lab/ext4mnt and rm -rf /tmp/mount-lab.

Essential Mount an ISO image read-only

ISO files are mounted read-only with the loop driver and the iso9660 type (or auto-detect).

Run the commands:

bash
mkdir -p /tmp/mount-lab/{iso,isomnt}
echo 'readme content' > /tmp/mount-lab/iso/readme.txt
xorriso -as mkisofs -o /tmp/mount-lab/test.iso /tmp/mount-lab/iso
sudo mount -o loop,ro /tmp/mount-lab/test.iso /tmp/mount-lab/isomnt
cat /tmp/mount-lab/isomnt/readme.txt
sudo umount /tmp/mount-lab/isomnt

Sample output:

text
readme content

Create the ISO with genisoimage or mkisofs if xorriso is not installed. Virtual CD devices (/dev/sr0) mount the same way: sudo mount -o ro /dev/sr0 /mnt.

Common Mount a vfat image as a USB stand-in

vfat (FAT32) is common on USB sticks. The kernel vfat module is built in on Ubuntu — no extra driver package for a basic mount.

Run the commands:

bash
mkdir -p /tmp/mount-lab/usbmnt
dd if=/dev/zero of=/tmp/mount-lab/usb.img bs=1M count=16 status=none
mkfs.vfat /tmp/mount-lab/usb.img
sudo mount -o loop /tmp/mount-lab/usb.img /tmp/mount-lab/usbmnt
echo usbdata | sudo tee /tmp/mount-lab/usbmnt/file.txt
sudo blkid /tmp/mount-lab/usb.img
findmnt /tmp/mount-lab/usbmnt
sudo umount /tmp/mount-lab/usbmnt

Sample output:

text
/tmp/mount-lab/usb.img: SEC_TYPE="msdos" UUID="317E-C915" BLOCK_SIZE="512" TYPE="vfat"
TARGET                SOURCE      FSTYPE OPTIONS
/tmp/mount-lab/usbmnt /dev/loop27 vfat   rw,relatime,...

For NTFS sticks install ntfs-3g and use sudo mount -t ntfs-3g /dev/sdX1 /mnt.

Common Find UUID and type for /etc/fstab

Permanent mounts should use UUID or LABEL so device names (/dev/sdb1) do not shift after reboot.

Run the commands:

bash
sudo blkid /tmp/mount-lab/ext4.img

Sample output (UUID varies):

text
/tmp/mount-lab/ext4.img: UUID="a1b2c3d4-..." BLOCK_SIZE="4096" TYPE="ext4"

Example fstab line:

text
UUID=a1b2c3d4-...  /mydata  ext4  defaults  0  2

Test before reboot: sudo mount -a (applies fstab) or sudo mount -a -f (dry run only).

Common Remount a filesystem read-only without unmounting

Handy before snapshotting or when you need to stop writes but keep the tree visible.

Run the commands:

bash
sudo mount -o remount,ro /tmp/mount-lab/ext4mnt
findmnt /tmp/mount-lab/ext4mnt -o TARGET,OPTIONS

Sample output:

text
TARGET                 OPTIONS
/tmp/mount-lab/ext4mnt ro,relatime

Return to read-write with sudo mount -o remount,rw /path.

Common Lazy umount when target is busy

If umount /mnt says target is busy, -l detaches the mount point and completes unmount when nothing uses the directory.

Run the commands:

bash
sudo mount -o loop /tmp/mount-lab/ext4.img /tmp/mount-lab/ext4mnt
cd /tmp/mount-lab/ext4mnt
sudo umount -l /tmp/mount-lab/ext4mnt
cd /
sleep 1
findmnt /tmp/mount-lab/ext4mnt || echo 'unmounted'

Sample output:

text
unmounted

Find processes still using the path with sudo lsof +f -- /mnt before forcing with umount -f.

Advanced Mount an NFS export (client syntax)

NFS mounts need the server export path, a local mount point, and matching NFS version options.

Run the commands:

bash
sudo mkdir -p /mnt/nfs-share
sudo mount -t nfs -o vers=4 server.example.com:/export /mnt/nfs-share
findmnt /mnt/nfs-share

Replace server.example.com:/export with your server. Install nfs-common on Ubuntu clients. Add the same line to /etc/fstab only after a successful manual mount.

Advanced Compare live mounts with fstab

Use findmnt instead of parsing /proc/mounts by hand.

Run the commands:

bash
findmnt --fstab | head -5
mount -a -f 2>&1 | head -3

findmnt --fstab shows what fstab describes; mount -a -f simulates applying it. Fix fstab errors before running mount -a on production hosts.


mount — when to use / when not

Use mount when Use something else when
  • You need a filesystem visible under a directory now
  • You are attaching USB, ISO, loop images, or NFS exports
  • You are testing an /etc/fstab line before reboot
  • You want a temporary mount that does not require editing fstab
  • Desktop auto-mount of removable media → udisks / file manager (often under /media/$USER)
  • systemd-managed mounts at boot → /etc/fstab plus systemctl daemon-reload or unit files
  • NetworkManager-controlled shares → NM tools, not raw mount
  • Containers and namespaces → bind mounts inside the container runtime
  • Permanent NFS with automount maps → autofs

mount vs fstab-only boot mounts

mount command /etc/fstab entry
Lifetime Until umount or reboot (unless fstab) Applied at boot with mount -a
Best for Tests, removable media, one-off NFS Production disks, always-on exports
Identity Device path or UUID in the command UUID/LABEL recommended
Risk Low for manual tests Typo can drop you to emergency shell at boot

Always validate fstab with sudo mount -a from a root shell before rebooting.


Command One line
mount Attach a filesystem (this page)
Show NFS shares NFS client mount workflows

Browse the full index in our Linux commands reference.


mount — interview corner

What does the mount command do in Linux?

mount connects a filesystem (on a partition, loop file, NFS server, etc.) to a directory in the single Linux directory tree. Until you mount, the kernel does not expose that filesystem's files under your chosen path.

The command records source, target, type, and options in the mount table (findmnt shows the live view). umount reverses the step.

A strong answer is:

"mount attaches a filesystem to a mount point in the unified directory tree; umount detaches it — the mount table tracks what's active."

How do you mount an ISO or disk image file?

Use the loop driver so a regular file acts like a block device:

bash
sudo mount -o loop,ro image.iso /mnt

For ext4 images inside a file, sudo mount -o loop disk.img /mnt works after the image contains a formatted filesystem. ISOs are usually read-only (ro).

A strong answer is:

"Use -o loop (and usually ro for ISOs) so the file is backed by /dev/loopN — same idea as mounting /dev/sr0 for a physical CD."

What are the six fields in /etc/fstab?

Classic fstab rows have six columns:

  1. Device — UUID, LABEL, or path (UUID=…, 192.168.1.10:/export)
  2. Mount point — directory (/mnt, /home)
  3. Typeext4, xfs, vfat, nfs, iso9660, …
  4. Optionsdefaults, ro, noauto, NFS vers=4, …
  5. dump — legacy backup flag (usually 0)
  6. fsck pass — boot check order (0 = skip, 1 = root, 2 = other local fs)

A strong answer is:

"Device, mount point, type, options, dump, fsck pass — I use UUID in field one and test with mount -a before reboot."

What if umount says target is busy?

Something -mount point is still in use — a shell's current directory, open file, or process holds a reference.

Steps:

  1. Leave the directory (cd /)
  2. sudo lsof +f -- /mnt or sudo fuser -vm /mnt to find users
  3. Stop those processes or use sudo umount -l /mnt (lazy) to detach when idle

Avoid umount -f on production unless you understand the data risk.

A strong answer is:

"Something still has the mount busy — cd out, find PIDs with lsof/fuser, or lazy umount -l; force is last resort."

Why use UUID instead of /dev/sdX1 in fstab?

Device names follow discovery order. A USB disk that was /dev/sdb1 yesterday may become /dev/sdc1 after reboot. UUID and LABEL stay with the filesystem.

Use blkid or lsblk -f to read UUIDs, then UUID=… in fstab.

A strong answer is:

"sdX names shift when disks are rescanned; UUID or LABEL in fstab survives reordering — blkid gives the value."


Troubleshooting

Symptom Likely cause Fix
unknown filesystem type 'ntfs' NTFS driver missing Install ntfs-3g; use -t ntfs-3g
mount: /mnt: wrong fs type Bad -t or corrupt superblock blkid; run fsck if needed
can't find in /etc/fstab mount /mnt with no fstab row Give source and target: mount /dev/sdX1 /mnt
target is busy on umount Process using mount point cd /; lsof +f -- /mnt; umount -l
NFS access denied Export permissions or root_squash Fix /etc/exports on server; match vers=
Loop mount fails No loop module or bad image losetup -f; recreate image; check dmesg

References

Deepak Prasad

R&D Engineer

Founder of GoLinuxCloud with more than 15 years of expertise in Linux, Python, Go, Laravel, DevOps, Kubernetes, Git, Shell scripting, OpenShift, AWS, Networking, and Security. With extensive …