Linux CLI 27 🐧 mount and umount commands
mount
mount -t ext4
mount -t btrfs
sudo fdisk -l
The mount command attaches a filesystem or device to a directory (the mount point) so its contents become accessible. The umount command detaches it.
Key point: A device must be mounted before you can read or write to its files. Linux treats everything as a file — including devices and filesystems.
a – mount options
mount allows you to control how filesystems are mounted/remounted on the system.
| Command | Description |
|---|---|
mount | Lists the file systems |
mount -t ext4 | Lists the ext4 file systems |
mount -t btrfs | Lists the btrfs file systems |
mount -a | Mounts all currently configured file systems (/etc/fstab) |
mount -h | Shows the help |
mount -l | Lists all the mounted file systems with detailed information |
sudo mount -l | Lists all the mounted file systems with detailed information |
sudo fdisk -l | Better way to see the devices |
Examples:
# List all mounted filesystems
$ mount
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
udev on /dev type devtmpfs (rw,nosuid,relatime,size=8123456k,nr_inodes=2030614,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,nodev,noexec,relatime,size=1629216k,mode=755)
/dev/sda2 on / type ext4 (rw,relatime,errors=remount-ro)
/dev/sda1 on /boot/efi type vfat (rw,relatime,fmask=0077,dmask=0077,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
/dev/sdb1 on /home type ext4 (rw,relatime)
/dev/sdc1 on /media/usbA type vfat (rw,nosuid,nodev,relatime,uid=1000,gid=1000,fmask=0022,dmask=0022,codepage=437)
# List only ext4 filesystems
$ mount -t ext4
/dev/sda2 on / type ext4 (rw,relatime,errors=remount-ro)
/dev/sdb1 on /home type ext4 (rw,relatime)
# List only btrfs filesystems
$ mount -t btrfs
/dev/sdd1 on /mnt/data type btrfs (rw,relatime,space_cache,subvolid=5,subvol=/)
# Mount all filesystems in /etc/fstab
$ sudo mount -a
# Show help
$ mount -h
# List with detailed info
$ sudo mount -l
/dev/sda2 on / type ext4 (rw,relatime,errors=remount-ro) [root]
/dev/sdb1 on /home type ext4 (rw,relatime) [home]
/dev/sdc1 on /media/usbA type vfat (rw,nosuid,nodev,relatime) [USB-A]
# Better way to see the devices
$ sudo fdisk -l
Disk /dev/sda: 238.47 GiB, 256060514304 bytes, 500118192 sectors
Disk model: Samsung SSD 860
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 12345678-ABCD-EF00-1234-56789ABCDEF0
Device Start End Sectors Size Type
/dev/sda1 2048 1050623 1048576 512M EFI System
/dev/sda2 1050624 500118158 499067535 237.9G Linux filesystem
Disk /dev/sdb: 931.51 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: WDC WD10EZEX
...
Device Boot Start End Sectors Size Id Type
/dev/sdb1 2048 1953521663 1953519616 931.5G 83 Linux
Disk /dev/sdc: 14.9 GiB, 16008609792 bytes, 31266816 sectors
Disk model: USB Flash Drive
...
Device Boot Start End Sectors Size Id Type
/dev/sdc1 2048 31266815 31264768 14.9G c W95 FAT32 (LBA)
b – mount a device
To mount a device/drive:
- Create a mount point — where you want it to be mounted
- Find the device with
fdisk -l - Mount the device to the mount point
| Command | Description |
|---|---|
mkdir /media/usbA | Creates a mount point |
sudo fdisk -l | Finds the device |
sudo mount /dev/sdc1 /media/usbA | Mounts the sdc1 device to the mount point /media/usbA |
Examples:
# Step 1: Create a mount point
$ sudo mkdir /media/usbA
# Step 2: Find the device
$ sudo fdisk -l
...
Disk /dev/sdc: 14.9 GiB, 16008609792 bytes, 31266816 sectors
Device Boot Start End Sectors Size Id Type
/dev/sdc1 2048 31266815 31264768 14.9G c W95 FAT32 (LBA)
# Step 3: Mount the device
$ sudo mount /dev/sdc1 /media/usbA
# Verify
$ mount | grep usbA
/dev/sdc1 on /media/usbA type vfat (rw,nosuid,nodev,relatime,...)
$ ls /media/usbA
file1.txt file2.txt photos/
Mount an ISO file:
# Create a mount point
$ sudo mkdir /media/testISO
# Mount the ISO using a loop device
$ sudo mount /testFile.iso /media/testISO -o loop
# Verify
$ mount | grep testISO
/testFile.iso on /media/testISO type iso9660 (ro,relatime)
$ ls /media/testISO
autorun.inf setup.exe ...
-o loopmounts the ISO’s data into a loop device — a pseudo-device that makes a file look like a block device.
Common mount options (-o):
| Option | Description |
|---|---|
loop | Mount a file as a block device (ISO) |
ro | Mount read-only |
rw | Mount read-write |
noexec | Prevent execution of binaries |
nosuid | Ignore SUID/SGID bits |
uid=1000 | Set owner of files |
gid=1000 | Set group of files |
remount | Remount with new options |
c – move a mount and unmount
Move a mount point:
# Move /media/usbA to /media/usbB
$ sudo mount --move /media/usbA /media/usbB
# Verify
$ mount | grep usbB
/dev/sdc1 on /media/usbB type vfat (rw,...)
Unmount a device:
umount is used to unmount a previously mounted file system/device.
| Command | Description |
|---|---|
umount -a | Unmounts all filesystems/devices |
umount -f | Forces the unmount |
sudo umount /media/usbA | Unmounts what is mounted at /media/usbA |
Examples:
# Unmount a device by mount point
$ sudo umount /media/usbA
# Unmount by device
$ sudo umount /dev/sdc1
# Force unmount (busy device)
$ sudo umount -f /media/usbA
# Unmount all
$ sudo umount -a
# Verify it's gone
$ mount | grep usbA
# (no output — unmounted)
Note:
umount(notunmount) is the actual command name. It’s easy to mistype.
Complete Example Session
# ============================================
# PART 1: LIST MOUNTED FILESYSTEMS
# ============================================
$ mount
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
/dev/sda2 on / type ext4 (rw,relatime,errors=remount-ro)
/dev/sdb1 on /home type ext4 (rw,relatime)
...
# Only ext4
$ mount -t ext4
/dev/sda2 on / type ext4 (rw,relatime,errors=remount-ro)
/dev/sdb1 on /home type ext4 (rw,relatime)
# Only btrfs
$ mount -t btrfs
/dev/sdd1 on /mnt/data type btrfs (rw,relatime,...)
# With labels
$ sudo mount -l
/dev/sda2 on / type ext4 (rw,relatime) [root]
/dev/sdb1 on /home type ext4 (rw,relatime) [home]
# ============================================
# PART 2: FIND DEVICES
# ============================================
$ sudo fdisk -l
Disk /dev/sda: 238.47 GiB ...
Device Start End Sectors Size Type
/dev/sda1 2048 1050623 1048576 512M EFI System
/dev/sda2 1050624 500118158 499067535 237.9G Linux filesystem
Disk /dev/sdc: 14.9 GiB ...
Device Boot Start End Sectors Size Id Type
/dev/sdc1 2048 31266815 31264768 14.9G c W95 FAT32 (LBA)
# ============================================
# PART 3: MOUNT A USB DRIVE
# ============================================
$ sudo mkdir /media/usbA
$ sudo mount /dev/sdc1 /media/usbA
$ mount | grep usbA
/dev/sdc1 on /media/usbA type vfat (rw,nosuid,nodev,relatime,...)
$ ls /media/usbA
file1.txt file2.txt photos/
# ============================================
# PART 4: MOUNT AN ISO
# ============================================
$ sudo mkdir /media/testISO
$ sudo mount /testFile.iso /media/testISO -o loop
$ mount | grep testISO
/testFile.iso on /media/testISO type iso9660 (ro,relatime)
$ ls /media/testISO
autorun.inf setup.exe ...
# ============================================
# PART 5: MOVE A MOUNT POINT
# ============================================
$ sudo mount --move /media/usbA /media/usbB
$ mount | grep usbB
/dev/sdc1 on /media/usbB type vfat (rw,...)
# ============================================
# PART 6: UNMOUNT
# ============================================
$ sudo umount /media/usbB
$ mount | grep usbB
# (no output)
# Force unmount if busy
$ sudo umount -f /media/usbA
# Unmount all
$ sudo umount -a
# ============================================
# PART 7: REMOUNT WITH NEW OPTIONS
# ============================================
# Remount read-only
$ sudo mount -o remount,ro /media/usbA
# Verify
$ mount | grep usbA
/dev/sdc1 on /media/usbA type vfat (ro,...)
# Remount read-write
$ sudo mount -o remount,rw /media/usbA
Quick Reference
Listing
| Command | Purpose |
|---|---|
mount | List all mounted filesystems |
mount -t TYPE | List filesystems of a type |
mount -l | List with labels |
sudo fdisk -l | List all disks and partitions |
Mounting
| Command | Purpose |
|---|---|
mkdir /mnt/point | Create a mount point |
sudo mount /dev/sdX /mnt/point | Mount a device |
sudo mount /path/file.iso /mnt/point -o loop | Mount an ISO |
sudo mount -a | Mount all from /etc/fstab |
sudo mount -o remount,rw /mnt/point | Remount with new options |
sudo mount --move /old /new | Move a mount point |
Unmounting
| Command | Purpose |
|---|---|
sudo umount /mnt/point | Unmount by mount point |
sudo umount /dev/sdX | Unmount by device |
sudo umount -f /mnt/point | Force unmount |
sudo umount -a | Unmount all |
Common -o Options
| Option | Meaning |
|---|---|
loop | Mount a file as a block device |
ro | Read-only |
rw | Read-write |
noexec | No execution |
nosuid | Ignore SUID/SGID |
uid=1000 | Set owner |
gid=1000 | Set group |
remount | Remount with new options |
Best Practices
✅ Do This:
# Always create the mount point first
sudo mkdir -p /media/usbA # ✅
sudo mount /dev/sdc1 /media/usbA
# Use fdisk -l to find the right device
sudo fdisk -l # ✅
# Unmount before removing a USB drive
sudo umount /media/usbA # ✅
# Use -o loop for ISO files
sudo mount file.iso /mnt -o loop # ✅
# Verify after mounting
mount | grep usbA # ✅
# Use -f only when necessary
sudo umount -f /media/usbA # ✅ (busy device)
❌ Don’t Do This:
# Don't mount without a mount point
sudo mount /dev/sdc1 # ❌ no target
# Don't pull a USB without unmounting
# (can cause data loss) # ❌
# Don't mistype the command name
sudo unmount /media/usbA # ❌ it's umount!
# Don't mount over a non-empty directory
sudo mount /dev/sdc1 /home # ❌ hides your files
# Don't forget sudo
mount /dev/sdc1 /media/usbA # ❌ permission denied
Common Pitfalls
| Pitfall | Problem | Solution |
|---|---|---|
unmount typo | Command not found | Use umount |
| Mount point missing | Mount fails | mkdir first |
| Device busy | Cannot unmount | umount -f or close files |
| Wrong device | Data loss risk | Verify with fdisk -l |
No sudo | Permission denied | Prefix with sudo |
| ISO not mounting | Missing -o loop | Add -o loop |
| Mount over non-empty dir | Hidden files | Mount to empty dir |
| Forgot to unmount USB | Data corruption | Always umount first |
Real-World Examples
1. Mount a USB Drive
$ sudo fdisk -l
...
Disk /dev/sdc: 14.9 GiB ...
Device Boot Start End Sectors Size Id Type
/dev/sdc1 2048 31266815 31264768 14.9G c W95 FAT32 (LBA)
$ sudo mkdir /media/usbA
$ sudo mount /dev/sdc1 /media/usbA
$ ls /media/usbA
$ sudo umount /media/usbA
2. Mount an ISO File
$ sudo mkdir /media/testISO
$ sudo mount /home/kronos/ubuntu.iso /media/testISO -o loop
$ ls /media/testISO
$ sudo umount /media/testISO
3. Mount a Second Hard Drive
$ sudo mkdir /mnt/data
$ sudo mount /dev/sdb1 /mnt/data
$ df -h /mnt/data
Filesystem Size Used Avail Use% Mounted on
/dev/sdb1 916G 120G 750G 14% /mnt/data
$ sudo umount /mnt/data
4. Remount Root Read-Only (Recovery)
$ sudo mount -o remount,ro /
$ mount | grep ' / '
/dev/sda2 on / type ext4 (ro,relatime)
5. Mount All from /etc/fstab
$ sudo mount -a
# Mounts everything listed in /etc/fstab that isn't already mounted
6. Move a Mount Point
$ sudo mount --move /media/usbA /media/usbB
$ mount | grep usbB
/dev/sdc1 on /media/usbB type vfat (rw,...)
7. Force Unmount a Busy Device
$ sudo umount /media/usbA
umount: /media/usbA: target is busy.
$ sudo umount -f /media/usbA
# Forced unmount
8. Check Filesystem Type Before Mounting
$ lsblk -f
NAME FSTYPE LABEL UUID MOUNTPOINT
sda
├─sda1 vfat 1234-ABCD /boot/efi
└─sda2 ext4 5678-EFGH /
sdb
└─sdb1 ext4 90AB-CDEF /home
sdc
└─sdc1 vfat USB-A 3456-GHIJ
Visual: Mounting a Device
┌──────────────────────────────────────────────┐
│ Before Mount │
│ │
│ /dev/sdc1 ← device (not accessible) │
│ /media/usbA ← empty directory │
│ │
└─────────────────┬────────────────────────────┘
│
│ sudo mount /dev/sdc1 /media/usbA
▼
┌──────────────────────────────────────────────┐
│ After Mount │
│ │
│ /dev/sdc1 ←──────┐ │
│ │ │
│ /media/usbA ←────┘ (contents accessible) │
│ │
│ $ ls /media/usbA → file1.txt file2.txt │
│ │
└─────────────────┬────────────────────────────┘
│
│ sudo umount /media/usbA
▼
┌──────────────────────────────────────────────┐
│ After Unmount │
│ │
│ /dev/sdc1 ← detached │
│ /media/usbA ← empty again │
│ │
└──────────────────────────────────────────────┘
Summary
| Command | Purpose | Example |
|---|---|---|
mount | List mounted filesystems | mount |
mount -t ext4 | List ext4 filesystems | mount -t ext4 |
mount -t btrfs | List btrfs filesystems | mount -t btrfs |
mount -a | Mount all from /etc/fstab | sudo mount -a |
mount -l | List with labels | sudo mount -l |
fdisk -l | List devices | sudo fdisk -l |
mount /dev/sdX /mnt | Mount a device | sudo mount /dev/sdc1 /media/usbA |
mount file.iso /mnt -o loop | Mount an ISO | sudo mount /x.iso /mnt -o loop |
mount --move /old /new | Move mount point | sudo mount --move /a /b |
umount /mnt | Unmount | sudo umount /media/usbA |
umount -f | Force unmount | sudo umount -f /media/usbA |
umount -a | Unmount all | sudo umount -a |
Key takeaways:
mountattaches a filesystem/device to a directory (the mount point)umount(notunmount!) detaches it- Use
sudo fdisk -lto find devices — better thanmountfor this - Always create the mount point with
mkdirbefore mounting - Use
-o loopto mount ISO files - Use
mount --moveto relocate a mount point - Use
umount -fto force unmount a busy device - Always unmount before removing a USB drive to avoid data loss
- Use
mount -o remount,rwto change options on a mounted filesystem
Remember: mount makes a device’s contents available at a directory. umount detaches it. Use fdisk -l to find devices, mkdir to create mount points, and -o loop for ISOs. The most common mistake is typing unmount instead of umount. Always unmount USB drives before pulling them out. Verify with mount | grep after mounting. Master mount and umount, and you control how storage appears on your system.
Stop using slow, ad-bloated tool sites! 🤮
🔎 Search “KandZ Tools” on Google to use many professional utilities for free.
KandZ.me is the ultimate minimalist hub for:
✅ Finance (Mortgage, Interest, Inflation)
✅ Tech (Base64, JSON, Dev Suite, IP)
✅ Health (BMI, BMR, TDEE)
✅ Productivity (Timer, Workspace, QR)
⚡️ Fast & Private
🔒 No data leaves your device
💎 100% Free
🔗 Use it now: https://tools.kandz.me
🔖 Bookmark it—you’ll need it later!