Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 23

Thread: How to add a swap file to Ubuntu

  1. #11
    Join Date
    Nov 2009
    Location
    London
    Beans
    92
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: How to add a swap file to Ubuntu

    Quote Originally Posted by mickObrian View Post
    Didn't you say you have two swap partitions? How did you manage that when you said you couldn't shrink the NTFS partition? Here's what mine looks like. I also just realized my swap space is way to big.
    Sorry, I think I may have confused you... I've attached screen shots of the /media folder and GParted
    Attached Images Attached Images

  2. #12
    Join Date
    Nov 2009
    Location
    London
    Beans
    92
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: How to add a swap file to Ubuntu

    Quote Originally Posted by uRock View Post
    Did you do a full install or did you use Wubi?
    I did a full install, I used Wubi before, but I wouldn't trust windows with my Ubuntu install

  3. #13
    Join Date
    Feb 2010
    Location
    In My Food Forest
    Beans
    9,318

    Re: How to add a swap file to Ubuntu

    Quote Originally Posted by lsk3993 View Post
    Sorry, I think I may have confused you... I've attached screen shots of the /media folder and GParted
    Ubuntu doesn't use swap files. It has to be in a separate partition. As you know you will not be able to create another partition outside of your Extended partition. You will have to create it within your Extended partition. By first shrinking the 288GB partition by 4GB.
    Cheers & Beers, uRock
    [SIGPIC][/SIGPIC]

  4. #14
    Join Date
    Nov 2009
    Location
    London
    Beans
    92
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: How to add a swap file to Ubuntu

    Quote Originally Posted by uRock View Post
    Ubuntu doesn't use swap files. It has to be in a separate partition. As you know you will not be able to create another partition outside of your Extended partition. You will have to create it within your Extended partition. By first shrinking the 288GB partition by 4GB.
    Ok, I guess I read this wrong then: https://help.ubuntu.com/community/Sw...20more%20swap?
    From what I understood, it says I can make a swap file
    Ok, I'll make a swap partition then, and just delete the two files it left me in /media then?

  5. #15
    Join Date
    Feb 2007
    Location
    Romania
    Beans
    Hidden!

    Re: How to add a swap file to Ubuntu

    The NTFS partition is mounted under /media/Shared. You have to edit the command accordingly:
    Code:
    sudo dd if=/dev/zero of=/media/Shared/4096Mb.swap bs=1M count=4096
    The command is silent & it may take some time to complete. Be patient.

    and you have to mount the NTFS partition at boot time:
    http://psychocats.net/ubuntu/mountwindows

    & finally add this line to the fstab file:
    Code:
    /media/Shared/4096Mb.swap    none    swap    sw    0    0

  6. #16
    Join Date
    Nov 2009
    Location
    London
    Beans
    92
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: How to add a swap file to Ubuntu

    Quote Originally Posted by sisco311 View Post
    The NTFS partition is mounted under /media/Shared. You have to edit the command accordingly:
    Code:
    sudo dd if=/dev/zero of=/media/Shared/4096Mb.swap bs=1M count=4096
    The command is silent & it may take some time to complete. Be patient.

    and you have to mount the NTFS partition at boot time:
    http://psychocats.net/ubuntu/mountwindows

    & finally add this line to the fstab file:
    Code:
    /media/Shared/4096Mb.swap    none    swap    sw    0    0
    Thank you, I wasn't really expecting the silent command- being used to windows and its stupid loading menus and fancy hourglasses

    Also, what is an fstab file?

  7. #17
    Join Date
    Feb 2010
    Location
    In My Food Forest
    Beans
    9,318

    Re: How to add a swap file to Ubuntu

    Quote Originally Posted by lsk3993 View Post
    Ok, I guess I read this wrong then: https://help.ubuntu.com/community/Sw...20more%20swap?
    From what I understood, it says I can make a swap file
    Ok, I'll make a swap partition then, and just delete the two files it left me in /media then?
    I stand corrected. I had never heard of people doing that.

    It looks like the files was created, so I am guessing you need to do the next command in the line while making the line changes that you made for the system to look in the shared partition.
    Cheers & Beers, uRock
    [SIGPIC][/SIGPIC]

  8. #18
    Join Date
    Feb 2007
    Location
    Romania
    Beans
    Hidden!

    Re: How to add a swap file to Ubuntu

    Quote Originally Posted by lsk3993 View Post
    Thank you, I wasn't really expecting the silent command- being used to windows and its stupid loading menus and fancy hourglasses

    Also, what is an fstab file?
    After the swap file is created you have to format it:
    Code:
    sudo mkswap /media/Shared/4096Mb.swap
    and create an entry for it in the /etc/fstab file. To edit the file run:
    Code:
    gksudo gedit /etc/fstab
    and copy/paste this
    Code:
    /media/Shared/4096Mb.swap    none    swap    sw    0    0
    at the end of the file.

  9. #19
    Join Date
    Nov 2009
    Location
    London
    Beans
    92
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: How to add a swap file to Ubuntu

    Quote Originally Posted by sisco311 View Post
    After the swap file is created you have to format it:
    Code:
    sudo mkswap /media/Shared/4096Mb.swap
    and create an entry for it in the /etc/fstab file. To edit the file run:
    Code:
    gksudo gedit /etc/fstab
    and copy/paste this
    Code:
    /media/Shared/4096Mb.swap    none    swap    sw    0    0
    at the end of the file.
    Thank you again, I am currently in a LiveCD session trying to find those two incorrectly made swap files that I need to delete but I can't seem to find them as /media appears to be empty.
    How do I get to them from the Live CD?

  10. #20
    Join Date
    Feb 2007
    Location
    Romania
    Beans
    Hidden!

    Re: How to add a swap file to Ubuntu

    You don't need the Live CD to delete the files. Boot your Ubuntu installation use the rm command to delete the files:
    Code:
    sudo rm -i /mnt/512Mb.swap
    and
    Code:
    sudo rm -i /media/shared4096Mb.swap
    Be careful, the rm command is dangerous, make sure that you delete the files you want.

Page 2 of 3 FirstFirst 123 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

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