Skip to main content

mount Cheatsheet

By Dejan Panovski Updated on Download PDF

Quick reference for the mount command: mount and unmount filesystems, mount options, UUID and label mounts, network shares, and /etc/fstab entries

The `mount` command attaches a filesystem to a directory in the tree, and `umount` detaches it. This cheatsheet covers basic syntax, listing mounts, common mount options, UUID and label lookups, network and special mounts, unmounting, and persistent `/etc/fstab` entries.

Basic Syntax

Core mount and umount command forms.

CommandDescription
mount DEVICE DIRAttach a device to a mount point
mount -t TYPE DEVICE DIRMount with an explicit filesystem type
mount -o OPTIONS DEVICE DIRMount with a comma-separated option list
mount DIRMount an entry already defined in /etc/fstab
mount -aMount /etc/fstab filesystems except noauto entries
umount DIRDetach the filesystem mounted at DIR

Most mount operations require root privileges, so prefix them with sudo.

List Mounted Filesystems

Inspect what is currently mounted and where.

CommandDescription
mountList all mounts using the legacy display; prefer findmnt
findmntShow mounts as a readable tree
findmnt /dev/sdb1Show where a specific device is mounted
findmnt -t ext4,xfsList only the given filesystem types
findmnt --fstab --verifyCheck /etc/fstab for errors before rebooting
cat /proc/mountsRead active mounts in the current mount namespace
lsblk -fList block devices with type, label, and UUID
df -hTShow mounted filesystems with type and free space

Common Mount Options

Values passed to -o or listed in the fourth /etc/fstab field.

OptionDescription
defaultsCommon defaults are rw,suid,dev,exec,auto,nouser,async; exact defaults vary
ro / rwMount read-only or read-write
noexecBlock execution of binaries on the filesystem
nosuidIgnore setuid and setgid bits
nodevIgnore device files on the filesystem
noatimeSkip access-time updates, which reduces disk writes
sync / asyncWrite synchronously or let the kernel buffer writes
noautoSkip this entry during mount -a and at boot
userAllow a non-root user to mount; implies noexec,nosuid,nodev unless overridden
nofailContinue booting when the device is missing
uid=1000,gid=1000Set owner and group on filesystems without Unix permissions
remountChange options on an already mounted filesystem

Example: sudo mount -o remount,rw / remounts the root filesystem read-write.

Mount by UUID or Label

Device names such as /dev/sdb1 can change between boots, so identify the filesystem instead.

CommandDescription
lsblk -fShow the UUID and label of every filesystem
sudo blkidPrint device type, label, and UUID
sudo blkid /dev/sdb1Print the attributes of one device
sudo mount UUID=1a2b3c4d-... /mnt/dataMount by filesystem UUID
sudo mount LABEL=backup /mnt/backupMount by filesystem label
sudo mount -U 1a2b3c4d-... /mnt/dataShort form of the UUID lookup
sudo mount -L backup /mnt/backupShort form of the label lookup
sudo e2label /dev/sdb1 backupSet a label on an ext2, ext3, or ext4 filesystem

Prefer UUID= or LABEL= for persistent local mounts in /etc/fstab because device names can change.

Filesystem Types

Values for -t and for the third /etc/fstab field.

TypeDescription
ext4Widely used general-purpose Linux filesystem
xfsHigh-performance journaling filesystem, default on RHEL
btrfsCopy-on-write filesystem with snapshots and subvolumes
vfatFAT32, used by USB drives and EFI system partitions
exfatLarge-file FAT variant for USB drives and SD cards
ntfs3In-kernel NTFS driver available on supported kernels
iso9660Optical disc and ISO image filesystem
tmpfsIn-memory filesystem backed by RAM and swap
nfsNetwork File System share
cifsSMB or Windows network share
autoLet mount detect the type

Network and Special Mounts

Mount forms beyond a plain local partition.

CommandDescription
sudo mount -t nfs server:/srv/data /mnt/dataMount an NFS export
sudo mount -t cifs //server/share /mnt/share -o username=userMount a Windows or Samba share
sudo mount -t cifs //server/share /mnt/share -o credentials=/etc/smb-credentialsMount CIFS with a credentials file
sshfs user@host:/remote/dir /mnt/remoteMount a remote directory over SSH
sudo mount -o loop image.iso /mnt/isoMount an ISO image through a loop device
sudo mount --bind /src /dstExpose an existing directory at a second path
sudo mount --rbind /src /dstBind a directory together with its submounts
sudo mount -t tmpfs -o size=512M tmpfs /mnt/ramCreate a 512 MB RAM-backed filesystem

Keep CIFS credentials outside project directories and version control. Protect the file with sudo chmod 600 /etc/smb-credentials.

Unmounting

Detach a filesystem and deal with a busy mount point.

CommandDescription
sudo umount /mnt/dataUnmount by mount point
sudo umount /dev/sdb1Unmount by device (obsolete; use the mount point)
sudo umount -R /mnt/dataUnmount a mount point and everything below it
sudo umount -l /mnt/dataLazy unmount: detach now, release when no longer in use
sudo umount -f /mnt/shareForce an unmount, mainly for unreachable network shares
sudo umount -a -t nfsUnmount every NFS filesystem
lsof +f -- /mnt/dataList open files under the mount point
fuser -mv /mnt/dataShow processes and users holding the mount point
sudo fuser -km /mnt/dataKill every process using the mount point; destructive

Review fuser -mv output before using fuser -km. Use lazy or forced unmounts only when a normal unmount cannot work: -f can lose unwritten data, while -l hides the path before all references are released.

Persistent Mounts in /etc/fstab

Each line has six space-separated fields.

FieldDescription
1. DeviceUUID=, LABEL=, a device path, or a remote share
2. Mount pointExisting directory, or none for swap
3. TypeFilesystem type, such as ext4, nfs, or cifs
4. OptionsComma-separated mount options, or defaults
5. Dump0 in nearly all cases; 1 marks the filesystem for dump
6. PassOrder of fsck at boot: 1 for root, 2 for others, 0 to skip

Example: UUID=1a2b3c4d-... /mnt/data ext4 defaults,nofail 0 2

CommandDescription
sudo findmnt --fstab --verifyValidate the file before rebooting
sudo mount -aApply mountable entries after validating /etc/fstab
sudo systemctl daemon-reloadRegenerate the systemd mount units after an edit
sudo mount /mnt/dataMount one entry using only its mount point

Use nofail only for optional mounts. Add _netdev when a network-backed filesystem is not recognized as network-dependent from its type.

Troubleshooting

Common mount errors and what to check.

ErrorCheck
target is busyFind the holder with fuser -mv DIR or lsof +f -- DIR, then close it
unknown filesystem typeInstall the required helper or driver, such as ntfs-3g, nfs-common or nfs-utils, or cifs-utils; confirm kernel support for exFAT
wrong fs type, bad option, bad superblockConfirm the type with lsblk -f and check dmesg. If repair is needed, unmount it and use the correct filesystem checker
mount point does not existCreate the directory first with sudo mkdir -p DIR
permission denied on CIFSVerify credentials and server share permissions; uid= and gid= only control local ownership
special device does not existRecheck the UUID with blkid; the device name may have changed
Files are hidden after mountingThe mounted filesystem covers existing directory contents; unmount it and inspect the underlying path
Boot drops to emergency modeRemount root with mount -o remount,rw /, fix the bad /etc/fstab line, and validate it; add nofail only if the mount is optional

Use these guides and cheatsheets for complete storage workflows.

GuideDescription
How to Mount and Unmount File Systems in LinuxFull guide to mount and umount with practical examples
Understanding the /etc/fstab File in LinuxField-by-field breakdown of persistent mount entries
How to Mount an NFS Share in LinuxInstall the client, mount a share, and troubleshoot errors
How to Mount a Windows Share on Linux Using CIFSCredentials files, ownership, and permissions for SMB shares
How to Mount ISO File on LinuxLoop devices and the graphical mounting method
How to Use SSHFS to Mount Remote Directories over SSHMount a remote directory and browse it like a local one
df CheatsheetCheck free space on mounted filesystems
fdisk CheatsheetPartition a disk before creating a filesystem