> >> gained some more knowledge of the swap, I now realized that maybe > >> the best way is the other way around -- mounting /tmp in swap, > >> 'cause I can make swap grow in some critical circumstances when the > >> /tmp grows too big. > >> So, how should I mount /tmp in swap? Detailed instruction is very > >> much appreciated. Thanks. > > swap space doesn't have a normal filesystem. > > It's not even in the root tree of the FS.(unless you make a swapfile, then > > ofcourse the *file* is, the swapspace still isn't)
>Hmm, yeah, that was my first impression. And it is also the reason >that I went the other way. But... let me show you it is doable in >Solaris: > >$ mount >/tmp on swap read/write
>See the last line "/tmp on swap"? Heeheehee, guys, got to think about >it, 'cause Linux shouldn't be too much different from Unix. well, >hopefully it is not, :-)
AIX is Unix, according to IBM, and you know the old joke about AIX, Unix, and space aliens, right?
Anyway, as I'm understanding it, you want to make sure that /tmp won't fill up. There are several ways to do this under Linux, in order of increasing complexity:
IIRC Solaris has a filesystem called "tmpfs" that's meant specifically for /tmp, and it implements some stuff that's not in ext2. The ability to mount /tmp on a swap device could be one of these things.
Matt G
>See the last line "/tmp on swap"? Heeheehee, guys, got to think about >it, 'cause Linux shouldn't be too much different from Unix. well, >hopefully it is not, :-)
There is some way to do that in FreeBSD too, but I do not recall the details. I believe you actually create a ramdisk for /tmp and that is only swapped out of RAM if the RAM is needed for something else more urgent. In practice you are not likely to notice a speed difference using a ramdisk in Linux, but it does minimize interruptions of other disk access. So it is that reason that I use a ramdisk for SETI@home processing (which typically only saves its state every 2 minutes and I backup to hard drive every 2 hrs).
David Efflandt
>See the last line "/tmp on swap"?
It is at kernel level and especially in fs type places as well ;) tmpfs is the filesystem Solaris operates by default. If you actually look at yuor /etc/vfstab (equiv of /etc/fstab under Linux) you'll see something along the lines of swap - /tmp tmpfs …
swap being the device, it's not fschk'd and /tmp being the mountpoint. The Fs-type is tmpfs which isn't available under Linux. I know there have been discussions in these newsgroups before and kernel-dev list IIRC about specialized filesystems for temporary storage, but nothing as yet has developed for Linux. There are plus's and minus's for it, you're saving space, but you can't get parallel activity on swap and /tmp, leaving you with less than adequate performances when the system is under a heavy load, compared with a system with a "real" /tmp filesystem.
Phil.
documented on: 2000.12.22 Fri