If you’ve ever connected a USB drive or SD card to a Linux system, you’ve likely seen it appear automatically under the /media directory. But what exactly is /media , and how is it different from /mnt ? In this post, we’ll explore the purpose of the /media directory, how it works, and why it’s a critical part of Linux’s filesystem structure for removable storage devices. 📁 What is /media in Linux? The /media directory is used by Linux to automatically mount removable media like: USB flash drives CD/DVDs External hard disks SD cards Smartphones (via MTP or PTP) Whenever you insert such a device, your Linux system typically mounts it under /media/<username>/device_name . Example: /media/noc/USB_DRIVE This automatic mounting makes it easy for users to access removable devices without needing manual mount commands. 🧩 Understanding the Filesystem Hierarchy Here’s how /media fits into the Linux Filesystem Hierarchy (FHS): Directory Purpose / Root ...
Cracking Shells to Sharpen the Skill