Summary: Quick plug in swap space? - PART 3 of 4

From: Daniel_V._D'Errico.RochXES@xerox.com
Date: Mon Jul 17 1995 - 11:34:30 CDT


From: Ric Anderson <ric@rtd.com>
Find a drive with adequate free space: lets assume the drive with
enough free space for the swap file is mounted on /export/home7.

        cd /export/home7
        mkdir swap
        cd swap
        mkfile crazysteve 64m
That will create a 64 megabyte swap file named crazysteve. Nothing
magic about naming the directory "swap" either. Just my personal
choice.

For SunOS 4.1.x, in /etc/fstab you can add a line
        /export/home7/swap/crazysteve swap swap rw 0 0
then issue the command
        swapon -a
and you should have an additional 64mb swap file.

For Solaris, you add a ine to /etc/vfstab that looks like
        /export/home7/swap/crazysteve - - swap - no -
and then run the command
        swap -a /export/home7/swap/crazysteve

At boot time, /usr/sbin/swapadd should find the vfstab entry
and process it.

Most of this is from memory, so approach with caution.
--------------------------------------------------------------
From: mshon@sunrock.east.sun.com (Michael J. Shon {*Prof Services} Sun
Rochester)
You haven't been at this long enough.
You still leap into action instead of saying
        "so don't do that."

Make him read the man pages for 'ulimit' .
You may be able to prevent the problem from recurring while he gets
the bugs fixed.

Adding more swap will just make it take a little bit
longer before 'ls' fails again.
The program is consuming all available resources. Don't give it any more.

| in the next section, just after
|the micromap to the nearest MegaBurger ( local fast food joint ) is the ultra
|nifty plans to boost swap space on a diskless box simply by adding a
file!!!!!!
|
|Is there a way of doing this on Crazy Steve, who is not a diskless
|workstation?

Yes. Further reading should have show that this applies
to all systems.

See the man page for "mkfile" .

But don't do it. Use ulimit and make him fix it.
--------------------------------------------------------------From:
dsteiner@ispa.uni-osnabrueck.de (David Steiner)
Yes! Been there, done that....

Essentially the same process:

1. Make a swap file of the desired size (in our example 32MB):

    mkfile 32m /some/dir/filename

   (The Trusty Manual says to use the -n switch with mkfile but I have a
    hand-scrawled note that says not to on a standalone. Can't remember why.)

2. Add entry in /etc/fstab

    /some/dir/filename swap swap ro 0 0

3. Run swapon:

    swapon -a

   (This should be in /etc/rc to take effect on reboot)

There ya go! Works fine for us.
--------------------------------------------------------------From: John
Rosenberg <jcr@bgumby.bwh.harvard.edu>
Yeah, find a free partition, and add something like this to your /etc/fstab
(assuming BSD UNIX):

    /dev/sd2h /swap2 swap rw 0 0

cf the man pages for fstab(5) and swapon(8).
-------------------------------------------------------------
From: Rick Niziak <rniziak@fmr.com>
Here's how you do it:
        # mkfile some_swap_file_name 100M
        # swapon some_swap_file_name

Thats it !!!
-------------------------------------------------------------
From: Steve Lee <steve@opensys.com>
cd /somewhere/with/disk/space

mkfile 50m swap50 # This makes a 50MB swap file named swap50

swapon /somewhere/with/disk/space/swap50 # SunOS 4.1.X

swap -a /somewhere/with/disk/space/swap50 # Solaris 2.X

Add the appropriate line in /etc/fstab or /etc/vfstab for the swap file:

/somewhere/with/disk/space - swap swap - - -
(vfstab)

/somewhere/with/disk/space swap swap rw 0 0 (fstab)
-------------------------------------------------------------
From: greg.harrison@analog.com (greg harrison)
        Try this on the sparc 20. Find a partition where you have the space
that
you would like to create a swap file. I.E. if you want a 50 Mb swap file, it
needs 50 megs free. Then do the following..

# mkfile 50m /home/auxswap (replace 50 with the desired size in
MB)
# vi /etc/fstab
        /home/auxswap swap swap rw 0 0 ( add it to the fstab file)
# swapon -a (activae the swap file)
ps. The above works well on a Sparc 20 running sunOs 4.1.x
    I have several of them with a naturaly 200 MB swap partition and then
    an extra 300MB swap file created this way. Works great.

p.p.s. A hint. Place the auxswap file and then make sure you arent backing it
       up during backups...thats a real waste. I place it directly under
        /home and then I only backup from /home/machine_name.
--------------------------------------------------------------
From: jwelfeld@dasw.com (Joe Welfeld)
                   And the answer is .. check out the unix commands:
mkfile and swapon
--------------------------------------------------------------From:
ssuryava@farm2.cv.com (Sandeep Suryavanshi)
You missed to mention one small thing.. which version of SunOS are
you running.

Well, since I have done this countless times on Solaris 2.3, that's what
I am giving below. If you use some other SunOS, let me know, I'll see if
I can help.

Step 1. make a file of the appropriate size on the disk. (You can see
      references to this way of adding swap as Adding Filesystem Swap in
      answer books/manuals).

   # mkfile 100m /dir/filename (same for SunOS 4.x)

   Makes a file of 100Mb in <dir> directory named <filename>.

Step 2. Add entry in to /etc/vfstab file (/etc/fstab on SunOS 4.x)

/dir/filename - - swap - no -

Step 3. Add this file as filesystem swap in the config.

  # swap -a /dir/filename

    Adds 100Mb of swap to your machine.

Step 4. Confirm that swap is added.
  # swap -s
        Summary listing of swap.

  # swap -l
        Long listing giving each swap componant. Your swap should now
        show 2 componants. First, as /dev/dsk/... and second as
        /dir/filename.

--------------------------------------------------------------
From: Ross Leask <ril@ecr.mu.oz.au>

man swap
man mkfile

Just create yourself a big file (mkfile should do the job), and use
"% swap -a bigfile"

probably best that "bigfile" is on a local file system (swapping over a network
might be a tad ugly).
--------------------------------------------------------------From: Gregory
Bond <gnb@bby.com.au>

Yup, will work on any machine:
        mkfile 32m /big/partition/swap
        swapon /big/partition/swap
--------------------------------------------------------------From:
nobroin@esoc.esa.de (Niall O Broin x 3619)
swapon -a filename
where filename is a file that you've previously created on a local disk with
mkfile
Further info, man swapon and man mkfile
--------------------------------------------------------------



This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:10:29 CDT