KarmicTmpAsTmpFs
Launchpad Entry: server-karmic-tmp-as-tmpfs
Created: 2009-06-15
Contributors: ScottJamesRemnant, DustinKirkland
Packages affected: swapd
Summary
This specification proposes mounting a tmpfs onto /tmp instead of leaving the contents on the root filesystem and cleaning them after every reboot.
Release Note
/tmp on newly installed Ubuntu systems is now a temporary filesystem.
Rationale
The contents of /tmp are not expected to survive a reboot, and in fact we spend time during boot cleaning them out. Switching to a tmpfs for /tmp gives a boot speed advantage.
There is also a security advantage, since temporary data is no longer available after the system is powered down. Combined with encrypted swap, this goes a long way to improving system security.
Assumptions
This assumes that software does not expect data in /tmp to last after a reboot, and uses the FHS /var/tmp directory for such data. Since Ubuntu cleans up /tmp after a reboot, this should be true.
The design assumes that the work has been done to switch to udev-based filesystem mounting, the fallback plan for this will be to defer the work rather than attempt to augment the current initscripts.
We also assume that there is an adequate tool for growing virtual memory as the contents of /tmp grow.
Design
We will add an entry to /etc/fstab that mounts a temporary filesystem (tmpfs) onto /tmp.
If this entry is not present, the filesystem mounting tool will instead clean up /tmp as the current initscripts do.
The default limit for a tmpfs is half of the available RAM; to allow larger files to exist in /tmp we will set no limit and use a daemon such as swapd to dynamically manage virtual memory.
This is not dependant on migration to swap files, since the swap partition is also available for use; and swapd can add swap files afterwards.
Migration
No migration will be made on upgrades, instead a wiki page will document the steps that existing users may take.
Test/Demo Plan
Test plan should include downloading a file in Firefox (which uses /tmp) and checking the output of mount.
FoundationsTeam/Specs/KarmicTmpAsTmpFs (last edited 2009-06-15 11:06:38 by quest)