[systemd-devel] /media as tmpfs

Lennart Poettering lennart at poettering.net
Tue Mar 27 07:57:37 PDT 2012


On Tue, 27.03.12 15:36, Tollef Fog Heen (tfheen at err.no) wrote:

> 
> Hi,
> 
> why is /media a tmpfs?  I think that violates user expectations that
> /media will be persistent across reboots, in particular any directories
> created and such.

/media is where deaemons such as udisks dynamically mount file systems
from usb sticks and cds and suchlike. Mount points in it are dynamic,
are not listed in /etc/fstab, and hence make sense to be cleaned up at
boot. 

This is in contrast to /mnt which is admin territory, where mount points
often are listed in /etc/fstab, and hence should not be cleaned up in
order not to muck with the admin's configuration

Directories in /media are usually named after the disk label of the
media that is mounted. That means that not having automatic clean-up at
boot means you'd collect tons and tons of directories in there that are
never cleaned up if the machine is turned off at the wrong time. Also,
for moutning an USB stick we should not require write disk access to the
root disk, and we should keep our delta to read-only/stateless systems
as minimal as possible.

Anyway, udisks2 recently obseleted the use of /media, replacing it by
per-user directories in /run. Due to that I am about to remove /media
from the default units of systemd. It's probably a good idea for distros
to remove the mount point entirely.

Hope that makes some sense,

Lennart

-- 
Lennart Poettering - Red Hat, Inc.


More information about the systemd-devel mailing list