Find the answer to your Linux question:
Results 1 to 5 of 5
Hai, I have 0 KB as swap space and I want to configure swap space to 2 GB. How should I go with configuring swap space. Thanks Sunil...
  1. #1
    Just Joined!
    Join Date
    Dec 2004
    Posts
    30

    How to configure Swap space



    Hai,

    I have 0 KB as swap space and I want to configure swap space to 2 GB. How should I go with configuring swap space.

    Thanks
    Sunil

  2. #2
    Linux Newbie
    Join Date
    Apr 2004
    Posts
    158
    Hi,

    You need to create a swap partition of 2GB. (with fdisk for example)

    then you need to create the swap filesystem (mkswap /dev/hdaX)

    and finally add a new entry to the /etc/fstab file.


    I don't know how much of this you are comfortable with so let me know if you run into any truble and I'll help you from there...

    Cheers

    Jonas
    --
    in Linux Computing we Trust

  3. #3
    Linux Guru sarumont's Avatar
    Join Date
    Apr 2003
    Location
    /dev/urandom
    Posts
    3,682
    Quote Originally Posted by cjl7
    Hi,

    You need to create a swap partition of 2GB. (with fdisk for example)

    then you need to create the swap filesystem (mkswap /dev/hdaX)

    and finally add a new entry to the /etc/fstab file.


    I don't know how much of this you are comfortable with so let me know if you run into any truble and I'll help you from there...

    Cheers

    Jonas
    Also use the 'swapon' command to set it active without rebooting.

    Code:
    swapon /dev/hdXY
    Oh...and why would you want 2G of swap space...?
    "Time is an illusion. Lunchtime, doubly so."
    ~Douglas Adams, The Hitchhiker's Guide to the Galaxy

  4. #4
    Just Joined!
    Join Date
    Dec 2004
    Posts
    30
    You need to create a swap partition of 2GB. (with fdisk for example)
    Can you please tell me the exact command syntax of fdisk, as I have four partitions and I dont want mess the hda1 which has windows on it. Here is partition table of my system

    Disk /dev/hda: 60.0 GB, 60011642880 bytes
    255 heads, 63 sectors/track, 7296 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes

    Device Boot Start End Blocks Id System
    /dev/hda1 * 1 1941 15591051 7 HPFS/NTFS
    /dev/hda2 1942 7295 43006005 f W95 Ext'd (LBA)
    /dev/hda5 1942 4081 17189518+ c W95 FAT32 (LBA)
    /dev/hda6 4082 5683 12868033+ c W95 FAT32 (LBA)
    /dev/hda7 5684 7295 12948358+ 83 Linux

    I want to create swap partition from /dev/hda6. How should I go from here with fdisk command.
    How much do you I think I should provide for swap space?(1GB or 2GB)

    Thanks
    Sunil

  5. #5
    Linux Newbie
    Join Date
    Apr 2004
    Posts
    158
    Hi,

    In order to configure /dev/hda6 as swap do the following;

    1. run "fdisk /dev/hda"

    type "t" ( as in "toggle"), you will be asked to enter the partition number, type "6" and hit ENTER

    Then you will get a question about hex code, type "82" (linux swap) (type "l" (ell) to view all types available)

    type "w" to write the new partition table and quit.

    2. create the swap space with mkswap /dev/hda6

    3. edit the /etc/fstab file, add the following
    /dev/hda2 none swap sw 0 0
    4. activate the swap space by typing "swapon -a"

    //jonas
    --
    in Linux Computing we Trust

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •