Re: swap

From: Tony Walton (tony.walton_at_s-u-n.com)
Date: 07/29/03


Date: Tue, 29 Jul 2003 10:07:32 +0100

newbie wrote:
>
> I am currently confused on how Solaris is able to map the swap device to
> the swap mount point.
>
> Of course, swap -a lets you specify that the device / slice is for swap.
>
> But in /etc/vfstab:
>
> swap - /tmp tmpfs - yes -
>
>
> You do not actually say that /tmp will use /dev/dsk/c0t0d0s1.
> Where is the mapping of /dev/dsk/c0t0d0s1 <----> /tmp stored ?

You've completely misunderstood the effect of that line. The line that
sets up your swap is

/dev/dsk/c0t0d0s1 - - swap - no -

or similar. A swapfile (as opposed to a partition) would read something
like:

/export/swap - - swap - no -

What tells the startup scripts that this partition or file is to be used
as swap is the word "swap" in field 4. The script
/etc/init.d/standardmounts calls /sbin/swapadd (also a script, take a
look and see what it does) to parse /etc/vfstab and add swap
files/partitions if they're tagged as "swap" in field 4 of vfstab.

What the line you quote

> swap - /tmp tmpfs - yes -

does is different, and has absolutely nothing at all to do with adding
swap. It says "mount /tmp as a tmpfs". This means that /tmp will be
mounted in such a way that it uses swap (or more precisely uses
available VM) rather than a physical partition. See the manpages for
tmpfs, mount_tmpfs(1m) and tmpfs(7fs) to see what tmpfs is all about.

HTH

-- 
Tony


Relevant Pages

  • Re: swap
    ... > I am currently confused on how Solaris is able to map the swap device to ... > the swap mount point. ...
    (comp.sys.sun.admin)
  • Re: Idea about a disc backed ram filesystem
    ... swapping when not in use by tmpfs. ... to one device (or not swap at all) and a tmpfs mount to swap to ... When you run out of RAM, or the RAM can be put to better use than keeping ...
    (Linux-Kernel)
  • Re: swap and /tmp
    ... I use tmpfs for /tmp on all of my machines and have so far not found ... although there was still a lot of swap available. ... because the encrypt/decrypt ... partition serving both purposes, and can change the size of the ...
    (Debian-User)
  • Re: Idea about a disc backed ram filesystem
    ... Giving tmpfs a dedicated swap space is dumb, ... If something gets to use that much ram, ...
    (Linux-Kernel)
  • Re: Strange situation while writing CDR from iso file on tmpfs
    ... > First I grabbed the iso image to a file in /tmp, ... > I insered another disk and repeated write attempt. ... I'm pretty sure tmpfs ... So large parts of the file in tmpfs actually resided in swap. ...
    (Linux-Kernel)