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

David Stearns stearns at dhyw.com
Sun May 2 11:22:56 MDT 2010


On Mon, 2010-05-03 at 00:44 +0800, Chan Kar Heng wrote:
> hi,
> 
> 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?

Hmm, only potential issue I see is if you ever have large files being
created in /tmp.  I've seen a couple 10+ gig files in tmp before, I'm
not sure how that would be handled.

> 
> 2) how could i mount a plain binary file as a read/write filesystem?
> that's assuming that one can do an mkfs on a plain file too.
> context is that, i might backup an entire filesystem to a plain file 
> (eg: cat /dev/sda0 > /home/myhome/myfsbackup;
> so now I wanna do a mount /home/myhome/myfsbackup /mymountpoint and be 
> able to access things backed up.)

You should be able to 
`mount -oloop -t<fstype> /home/myhome/myfsbackup /mymountpoint`

That should do what you need.

Regards
-David Stearns




More information about the LUG mailing list