SUMMARY: Expanding the Swap Partition

From: Mark `Hex' Hershberger (mah@eecs.tulane.edu)
Date: Mon Sep 16 1996 - 09:56:48 CDT


I'm re-sending this because I'm still getting a lot of responses to my
original posting. (I forgot to add anything after "SUMMARY:" in my
original summary -- which is probably when the confusion comes from.)

My original post:

> I've accidently installed some machines with the default swap size (32M).
> Is there any way to expand that without completely re-installing the OS?
>
> What I've tried:
>
> I used format to expand the swap partition and then rebooted so that fsck
> would be run on the disk. This seemed to work fine. Is there anything
> that I should be worried about?

(I keep forgetting to tell you all that I'm installing Solaris 2.5.)

It turned out that I must have missed some error message somewhere. When
I checked what format saw in the permission table, it saw my old
partitions.

To *really* modify the partition table, I had to boot from the
installation CD and run format from there. After I did that (Shrinking
the root fs to make room for the larger swap space), my machine wouldn't
boot properly. That surprised me because I assumed that it would use the
space at the beginning of the partition first -- that the back-end of the
partition would be free.

Anyway, unless there is a shrinkfs utility somewhere (to shrink my root
partition), then I'm outa luck.

(The reason I didn't want to use swap: I manage 30+ systems here. It
makes thing much simpler if they are all set up in a similar manner.
Having 2-3 systems with a strange vfstab file would really confuse
things.)

Here are some things that people suggested:

        1. Create a file and use "swap -a" or "swapon -a" to make it a
           second swap space.

  # cd /home/swap2 <- cd to a bigger filesystem
  # /usr/etc/mkfile 50M swapfile <- makes a 50 Mbyte file or more
  # emacs /etc/fstab
    /home/swap2/swapfile swap swap rw 0 0 <- add this line to fstab
  # swapon -a

        2. Back up my other partitions, change the partition sizes, and
           then restore the other partitions. (Might have to re-write the
           bootblk.)

Thanks to the following who offered their help quickly.

From: ps4330@okc01.rb.jccbi.gov (Peter Schauss x 2014)
From: Matthew Stier - BSG Corporation <matthew.stier@imonics.com>
From: rloftin@engsys.mc.xerox.com (Ron Loftin)
From: gibian@stars1.hanscom.af.mil (Marc S. Gibian)
From: Manish Doshi <mdoshi@guanine.bchs.uh.edu>
From: runde@mlode.mms.com (Aline H. Runde - MicroModule Systems)
From: Ric Anderson <ric@rtd.com>
From: Ugur Ayfer <ugur@best.com.tr>
From: AO <cherub@lava.net>
From: szh@zcon.com (Syed Zaeem Hosain)



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