Linux mount Guide - ryzendew/Linux-Tips-and-Tricks GitHub Wiki
Linux mount Guide
Complete beginner-friendly guide to mount on Linux, covering Arch Linux, CachyOS, and other distributions including mounting filesystems, fstab configuration, and device management.
Table of Contents
Understanding mount
What is mount?
mount attaches filesystems to directory tree.
Uses:
- Mount disks: Attach storage devices
- Mount network shares: Access remote filesystems
- Mount ISO files: Access disk images
- Temporary mounts: Mount for specific tasks
Why it matters:
- Access files: Use files on devices
- Organize storage: Manage multiple disks
- Network access: Access remote storage
Basic Mounting
List Mounts
View mounted filesystems:
# List all mounts
mount
# List specific device
mount | grep /dev/sdb
# Or use findmnt
findmnt
Mount Device
Basic mount:
# Mount device
sudo mount /dev/sdb1 /mnt
# Mount with filesystem type
sudo mount -t ext4 /dev/sdb1 /mnt
Mount Options
Common Options
Mount with options:
# Read-only
sudo mount -o ro /dev/sdb1 /mnt
# Read-write
sudo mount -o rw /dev/sdb1 /mnt
# No execution
sudo mount -o noexec /dev/sdb1 /mnt
# Multiple options
sudo mount -o rw,noexec,nosuid /dev/sdb1 /mnt
Filesystem Options
Filesystem-specific:
# ext4 options
sudo mount -o defaults,noatime /dev/sdb1 /mnt
# NTFS options
sudo mount -t ntfs-3g -o defaults /dev/sdb1 /mnt
fstab Configuration
Edit fstab
Configure auto-mount:
# Edit fstab
sudo vim /etc/fstab
fstab Format
Entry format:
UUID=xxxx-xxxx /mnt ext4 defaults 0 2
Fields:
- Device: UUID or device path
- Mount point: Directory
- Filesystem: Type
- Options: Mount options
- Dump: Backup flag
- Pass: fsck order
Unmounting
Unmount Device
Unmount:
# Unmount
sudo umount /mnt
# Or by device
sudo umount /dev/sdb1
# Force unmount
sudo umount -f /mnt
# Lazy unmount
sudo umount -l /mnt
Troubleshooting
Mount Errors
Check device:
# List devices
lsblk
# Check filesystem
sudo fsck /dev/sdb1
# Check mount point
ls -la /mnt
Device Busy
Fix busy device:
# Check what's using it
lsof /mnt
# Or
fuser -m /mnt
# Force unmount
sudo umount -f /mnt
Summary
This guide covered mount usage, fstab configuration, and filesystem management for Arch Linux, CachyOS, and other distributions.
Next Steps
- Filesystem Management - Filesystem setup
- Automount Disks Guide - Auto-mounting
- mount Documentation:
man mount
This guide covers Arch Linux, CachyOS, and other Linux distributions. For distribution-specific details, refer to your distribution's documentation.