/media
removable media/media is where removable devices show up. Plug in a USB stick on a desktop system, and it is mounted here automatically, under your user name. It does the same job as /mnt, but the system does the mounting rather than you.
/mnt is mounted by hand. /media is mounted for you.
Why it exists
Every directory at the top of the tree is there for a reason. This is the problem /media solves.
A desktop user should not need root or a mount command to read a USB stick. The system mounts it under /media on their behalf.
Automatic mounts come and go on their own. Keeping them out of /mnt means they never collide with what an administrator has mounted there.
What you find inside
Not everything, but the entries worth recognising. Each is marked as a directory, a file, a link or a device.
- userdirectoryA directory per logged-in user, holding their mounted devices.
- user/USB-DRIVEdirectoryA USB stick, named after its volume label.
- user/3A7F-12C4directoryA device with no label, named by its filesystem id.
- cdromdirectoryAn optical drive, on systems that have one.
At the terminal
Four commands that show what this directory is doing on a real machine.
ls /media/$USERList the removable devices mounted for you.
lsblk -fList every disk with its filesystem, label and mount point.
udisksctl unmount -b /dev/sdb1Unmount a removable device without sudo.
df -h /media/$USER/*Show the size and free space of each mounted device.
Handle with care
What goes wrong here, and what someone securing or attacking the machine looks at.
As with any mount, writes may still be pending. Use the eject button or unmount from the terminal before pulling the device out.
A device that looks like storage may act as a keyboard and type commands, and files on it may be malicious. Servers often disable automatic mounting altogether.