Re: Making a swap partition
im pretty sure that if you have 2g ram you need at least 2g swap partition
i can tell ya how to create the partition - use gparted
but i dont really know how to make ubuntu use it as swap after you installed it (i did that before installation)
Re: Making a swap partition
1GiB is a nice size, but I'd recommend, as Kinnza does too, at least the same ammount as your physical memory.
Boot up your ubuntu CD, it has gparted installed in the live-session. Use it to add a swap partition. When it's added, boot back to your normal system and run in a terminal. Identify your new swap partition in the output of that command, it should have an UUID="....".
Edit /etc/fstab (gksu gedit /etc/fstab) and add a line like this:
Code:
UUID=1234abcd-.... none swap sw 0 0
(replacing 1234abcd-.... with the correct UUID of course)
Then run
Code:
sudo swapon -a
free
The first command will mount all swap partitions listed in /etc/fstab, the second command should list the current memory usage (and how much swap is available)
Re: Making a swap partition
I did what you said except i had to change the fstab entry a little bit... when I go to swapon it says i gave it an invalid argument even though it sees the swap and automatically puts its information in.
any suggestion? and my swap is appearing in the places menu and when i click it, it says i dont have permission to mount.
edit: oh yeah
Code:
rex@rex-desktop:~$ free
total used free shared buffers cached
Mem: 2073892 673852 1400040 0 32552 351500
-/+ buffers/cache: 289800 1784092
Swap: 0 0 0
Re: Making a swap partition
It sounds like you've made an ext3 partition instead of a swap partition (a swap partition should not appear in the places menu). When you create the partition, you need to set "Filesystem" to "linux-swap" (I should've mentioned this earlier, but I forgot). If you boot back into the liveCD and run gparted again, you should be able to right click the partition you created earlier and select "Format to"->"linux-swap". This will give it a new blkid, so you'll need to edit /etc/fstab again.
Re: Making a swap partition
Here is a good document to explain Swap. You can choose either Swap Partition or Swap File
https://help.ubuntu.com/community/SwapFaq
Re: Making a swap partition
Quote:
Originally Posted by
geirha
It sounds like you've made an ext3 partition instead of a swap partition (a swap partition should not appear in the places menu). When you create the partition, you need to set "Filesystem" to "linux-swap" (I should've mentioned this earlier, but I forgot). If you boot back into the liveCD and run gparted again, you should be able to right click the partition you created earlier and select "Format to"->"linux-swap". This will give it a new blkid, so you'll need to edit /etc/fstab again.
thanks after i made that change and edited again it worked.. and i changed the fstab entry to
Code:
UUID=12213d25-ce33-4b16-9bdb-b6dbb142294e swap swap sw 0 0
i know /dev/sda2 could've been in the UUID places part i was just wondering why you do it by UUID instead but i guess that can be answered later.
It works now and thanks for your help.
Re: Making a swap partition
Quote:
Originally Posted by
Silpheed2K
thanks after i made that change and edited again it worked.. and i changed the fstab entry to
Code:
UUID=12213d25-ce33-4b16-9bdb-b6dbb142294e swap swap sw 0 0
i know /dev/sda2 could've been in the UUID places part i was just wondering why you do it by UUID instead but i guess that can be answered later.
It works now and thanks for your help.
It saves you some hassle later on. If you add a new hard drive for instance, /dev/sda may suddenly be called /dev/sdb. Then all entries like /dev/sda1 and /dev/sda2 must be changed to /dev/sdb1 and /dev/sdb2 in /etc/fstab. Their UUID will stay the same, so if you use the UUID instead of the device nodes, you don't need to change anything, it will just work as if nothing happened.