Linux Swap partition

By MattG
Sep 8, 2003
Topic Status:
Not open for further replies.
  1. Hey guys, i realized today after class that during my install i NEVER formatted my Swap parition.

    My teacher said that this means im running with out one now, even though i have the partition made.

    Is there a way with out having to reinstall to format this swap to make it functional?

    Thanks.
  2. Phantasm66

    Phantasm66 Newcomer, in training Posts: 6,504

    you created a swap partition but never formatted it?

    try issuing this command:

    free

    you should see memory useage stats... if you don't see any mention of Swap: then you have no swap file running.

    [root@fishbone root]# free
    total used free shared buffers cached
    Mem: 127440 120876 6564 0 54492 10912
    -/+ buffers/cache: 55472 71968
    Swap: 1052248 43084 1009164


    If this is so, post back and we will tell you how format it.
  3. Phantasm66

    Phantasm66 Newcomer, in training Posts: 6,504

    oh, is the partition mentioned in /etc/fstab??

    ie:

    [root@fishbone root]# more /etc/fstab
    LABEL=/ / ext3 defaults 1 1
    none /dev/pts devpts gid=5,mode=620 0 0
    LABEL=/html /html ext3 defaults 1 2
    none /proc proc defaults 0 0
    none /dev/shm tmpfs defaults 0 0
    /dev/hda2 swap swap defaults 0 0
    /dev/cdrom /mnt/cdrom iso9660 noauto,owner,kudzu,ro 0 0
    /dev/fd0 /mnt/floppy auto noauto,owner,kudzu 0 0
  4. MattG

    MattG Newcomer, in training Topic Starter Posts: 147

    total used free shared buffers cached
    Mem: 515612 201592 314020 0 16652 100200
    -/+ buffers/cache: 84740 430872
    Swap: 0 0 0

    it mentions it...but its all 0's
  5. MattG

    MattG Newcomer, in training Topic Starter Posts: 147

    infy@inferno-linux:~$ more /etc/fstab
    /dev/hdb1 / reiserfs defaults 1 1
    /dev/cdrom /mnt/cdrom iso9660 noauto,owner,ro 0 0
    /dev/fd0 /mnt/floppy auto noauto,owner 0 0
    devpts /dev/pts devpts gid=5,mode=620 0 0
    proc /proc proc defaults 0 0
  6. Phantasm66

    Phantasm66 Newcomer, in training Posts: 6,504

  7. Phantasm66

    Phantasm66 Newcomer, in training Posts: 6,504

    ...and yes, it looks like you have not got an initialised swap partition.

    This probably doesn't matter too much if you have like 1 GB or so of RAM, but I would add one just anyway. Linux kernel is very good about not using swap file or partition unless it has to, unlike Windows which can be garbage in that regard.
  8. MattG

    MattG Newcomer, in training Topic Starter Posts: 147

    infy@inferno-linux:~$ free
    total used free shared buffers cached
    Mem: 515612 168112 347500 0 14712 80716
    -/+ buffers/cache: 72684 442928
    Swap: 2097136 0 2097136


    Ive got swap now.

    Thanks again.
  9. Phantasm66

    Phantasm66 Newcomer, in training Posts: 6,504

Topic Status:
Not open for further replies.


Add New Comment

TechSpot Members
Login or sign up for free,
it takes about 30 seconds.
You may also...


Get complete access to the TechSpot community. Join thousands of technology enthusiasts that contribute and share knowledge in our forum. Get a private inbox, upload your own photo gallery and more.