[lug] q: ramdisk /tmp & mount plain files

David Ahern dsahern at gmail.com
Sun May 2 14:27:58 MDT 2010



On 05/02/2010 11:28 AM, David Morris wrote:
> On Sun, May 2, 2010 at 10:44, Chan Kar Heng <chankarheng at gmail.com> wrote:
>> 1) wanted to ask some opinion on creating a ramdisk & using it as /tmp.
>> that way, /tmp always starts off empty on a fresh boot.
>> it's always fast to access /tmp too.
>> since /tmp isn't meant to really keep things, it could be kept small?
>> these days, most machines have tons of memory to spare anyway.
>> isn't it a good idea?
>> why isn't it common place?
> 
> What you are looking for is tmpfs.  Automatically creates a ram-disk
> at the specified mount point.  Add this to your /etc/fstab:
> 
> tmpfs /tmp tmpfs defaults 0 2

tmpfs has an option to limit consumption (e.g., add size=16M option to
mount or "defaults,size=16M" to fstab).

David





More information about the LUG mailing list