[3146] in linux-net channel archive

home help back first fref pref prev next nref lref last post

Re: Repartition swap space and linux native fs

daemon@ATHENA.MIT.EDU (Bruce Thompson)
Sat Jun 8 11:57:43 1996

Date: 	Sat, 8 Jun 1996 08:49:23 -0700
To: linux-net@vger.rutgers.edu
From: bruce@otherother.com (Bruce Thompson)

At 11:59 06/08/96, Neville B Dastur wrote:
>On Sat, 8 Jun 1996, Muhammad Luqman Hakim wrote:
>
>> Hai all!
>>
>> I had install linux and run httpd on it, my system has 8 mags of RAM and
>> I had setup 11088 blocks for Linux swap.
>>
>> can  i change Linux swap to bigger size without effect any data?
>>
>> thanks in advance
>> hakim
>
>Of course. But remember to turn off swapping, umount that partition
>first then go ahead and use fdisk to give it a new size (assuming you
>have space availaable on your drive. If you want to change the native
>partition size as well thats a different matter!

Hi.
    If you've allocated all the space on your drive to various partitions
then resizing your swap partition is easier said than done. Any partitions
that you'd be changing would need to be re-built from the ground up.

    There is however an alternative (at the price of a bit of performance):
swap file(s). Assuming that you've got some unused space on one of your
filesystems, do the following:

        # dd if=/dev/zero of=/<swapfile> bs=1024 count=<numblocks>
        # mkswap /<swapfile>
        # swapon /<swapfile>

    Add a line to your rc.local file to do the swapon at boot time and
you're all set.

    Swapping to a file takes a performance hit because it goes through a
filesystem. The advantage is that swap space can be added at any time
without the need to re-partition your disks.

        Cheers,
        Bruce.

--
--------------------------------------------------------------------------
Bruce Thompson                  | "Rumors of our death have been greatly
Developer Technical Support     |  exaggerated."
Newton Systems Group            |      - Employees of Apple Computer, Inc.
Apple Computer, Inc.            |
bruce@newton.apple.com          | "Don't believe half of what you hear,
bthompson@applelink.apple.com   |  and most of what you read in the papers"
bruce@otherother.com            |      - Me
                                |

        I don't speak for Apple, my opinions are strictly my own.




home help back first fref pref prev next nref lref last post