MISSING ... Swap Partition


Results 1 to 6 of 6

Thread: MISSING ... Swap Partition

  1. #1
    Join Date
    May 2008
    Location
    Manila, Philippines
    Posts
    75

    Exclamation MISSING ... Swap Partition

    i did a sudo fdisk -l on my office issued laptop and here is the output :

    Disk /dev/sda: 40.0 GB, 40007761920 bytes
    255 heads, 63 sectors/track, 4864 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Disk identifier: 0xeb36eb36

    Device Boot Start End Blocks Id System
    /dev/sda1 * 1 2432 19535008+ 7 HPFS/NTFS
    Partition 1 does not end on cylinder boundary.
    /dev/sda2 2433 4864 19535040 f W95 Ext'd (LBA)
    /dev/sda5 2433 3648 9759928+ 7 HPFS/NTFS
    /dev/sda6 3649 4864 9767488+ 83 Linux


    okay, seems that somebody in my tech support dept messed up bigtime and did not install swap ... since it doesnt show up (or is it invisible ?)

    the box is using windows xp and ubuntu 8.04 ...

    if swap is indeed missing, is there a way i can install swap without reformatting or reinstalling ?

    thanks in advance.
    BASED FROM YOUR POSTS, I HAVE EXAMINED YOUR BEHAVIORAL PATTERN AND I SAW YOUR BRAIN'S TWO SIDES : LEFT & RIGHT, AND I SAW THAT ON THE LEFT SIDE THERE'S NOTHING RIGHT WHILE ON THE RIGHT SIDE THERE'S NOTHING LEFT

  2. #2
    Join Date
    Sep 1999
    Posts
    3,203
    Yup, you can use a file instead of a partition

    Boot to Linux
    Log in as root
    Go somewhere convienent - I put mine on the root directory - and create a file with all 0s in it

    dd if=/dev/zero of=/swapfile bs=1024 count=500000

    This creates a 500mb file.

    Then make it a swapfile -

    mkswap /swapfile

    Then enable it
    swapon /swapfile

    Then you'll want an entry in /etc/fstab for it as well... same as a regular swap partition, but instead of a /dev/... device just put the path to the swapfile.
    -----
    This space for rent

  3. #3
    Join Date
    May 2008
    Location
    Manila, Philippines
    Posts
    75
    this is my output ...

    Code:
    500000+0 records in
    500000+0 records out
    512000000 bytes (512 MB) copied, 59.3131 s, 8.6 MB/s
    root@bandido-laptop:~# mkswap /swapfile
    Setting up swapspace version 1, size = 511995 kB
    no label, UUID=8f37e2f8-052d-4920-8b3d-82fd9bae7453
    Then you'll want an entry in /etc/fstab for it as well... same as a regular swap partition, but instead of a /dev/... device just put the path to the swapfile
    how do i do this ?

    this is the contents of my fstab ...

    Code:
    # /etc/fstab: static file system information.
    #
    # <file system> <mount point>   <type>  <options>       <dump>  <pass>
    proc            /proc           proc    defaults        0       0
    # /dev/sda6
    UUID=1e31cd41-b817-4f95-a1f5-8216f78447b2 /               ext3    defaults,errors=remount-ro 0       1
    # /dev/sda1
    UUID=9CE01874E01856BC /media/sda1     ntfs    defaults,umask=007,gid=46 0       1
    # /dev/sda5
    UUID=5060751A607507CC /media/sda5     ntfs    defaults,umask=007,gid=46 0       1
    /dev/scd0       /media/cdrom0   udf,iso9660 user,noauto,exec 0       0
    Last edited by jamesbandido; 06-27-2008 at 02:01 PM.
    BASED FROM YOUR POSTS, I HAVE EXAMINED YOUR BEHAVIORAL PATTERN AND I SAW YOUR BRAIN'S TWO SIDES : LEFT & RIGHT, AND I SAW THAT ON THE LEFT SIDE THERE'S NOTHING RIGHT WHILE ON THE RIGHT SIDE THERE'S NOTHING LEFT

  4. #4
    Join Date
    May 2008
    Location
    Manila, Philippines
    Posts
    75
    i added the following to my fstab ...

    Code:
    /swapfile       none    swap    sw      0       0
    i hope its correct ...
    BASED FROM YOUR POSTS, I HAVE EXAMINED YOUR BEHAVIORAL PATTERN AND I SAW YOUR BRAIN'S TWO SIDES : LEFT & RIGHT, AND I SAW THAT ON THE LEFT SIDE THERE'S NOTHING RIGHT WHILE ON THE RIGHT SIDE THERE'S NOTHING LEFT

  5. #5
    Join Date
    Sep 1999
    Posts
    3,203
    looks proper to me. just be sure it is *after* your root partition, since htey will both load on hte first pass, you want / mounted before you try to activate /swapfile
    -----
    This space for rent

  6. #6
    Join Date
    May 2008
    Location
    Manila, Philippines
    Posts
    75
    @ph34r, thanks very much !!!

    consider this thread as case closed

    have a nice weekend !!!
    BASED FROM YOUR POSTS, I HAVE EXAMINED YOUR BEHAVIORAL PATTERN AND I SAW YOUR BRAIN'S TWO SIDES : LEFT & RIGHT, AND I SAW THAT ON THE LEFT SIDE THERE'S NOTHING RIGHT WHILE ON THE RIGHT SIDE THERE'S NOTHING LEFT

Posting Permissions

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