SUMMARY: Expanding the Swap Partition

From: Mark `Hex' Hershberger (
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

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

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

Thanks to the following who offered their help quickly.

From: (Peter Schauss x 2014)
From: Matthew Stier - BSG Corporation <>
From: (Ron Loftin)
From: (Marc S. Gibian)
From: Manish Doshi <>
From: (Aline H. Runde - MicroModule Systems)
From: Ric Anderson <>
From: Ugur Ayfer <>
From: AO <>
From: (Syed Zaeem Hosain)

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