How to create swap partition

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
arjot

How to create swap partition

Post by arjot »

Hey guys
I just installed linux mint 11 yesterday to solve my graphics chipset problem.
But I forgot to create a swap partition. So my question is how can I create swap partition without reinstalling linux mint?
Also I have 4GB ram on my laptop and I don't use hibernation function on my laptop so do I really need swap?
The space I reserved for swap partition is 4GB & it is shown as unusable space in partition s/w.
Thanks in advance.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
minitrucker

Re: How to create swap partition

Post by minitrucker »

I'm fairly new, but if I understand right you can live boot and unmount the OS off the hard drive if it comes to that. Do you have gParted? That should make it easy to do anything with unused space on your HDD. As far as if you actually need or not.... no idea sorry
remoulder
Level 17
Level 17
Posts: 7621
Joined: Fri May 09, 2008 1:14 pm

Re: How to create swap partition

Post by remoulder »

arjot wrote:I have 4GB ram on my laptop and I don't use hibernation function on my laptop so do I really need swap?
If your system runs ok then no you don't need swap. Unless you do very memory intensive stuff such as video, your system will likely never need it. In any case 4GB would be far too much unless you wanted to hibernate, in which case it might be slightly too little. If you are sure you aren't going to hibernate then I would create a swap of say 512MB as a precaution and re-use the remainder by re-sizing the adjacent partition. To create and resize the partitions you will need to boot from the live disc and run gparted from the menu there. See http://ubuntuforums.org/showthread.php?t=1262862 for basic instructions.
[Edit] your original post and add [SOLVED] once your question is resolved.

“The people are my God” stressing the factor determining man’s destiny lies within man not in anything outside man, and thereby defining man as the dominator and remoulder of the world.
arjot

Re: How to create swap partition

Post by arjot »

Thanks guys.
proxima_centauri

Re: How to create swap partition

Post by proxima_centauri »

I would just use this guide to create a SWAP file instead of a partition.
Much easier.
wyrdoak

Re: How to create swap partition

Post by wyrdoak »

proxima_centauri wrote:I would just use this guide to create a SWAP file instead of a partition.
Much easier.
Swap file works. Another way to create a swap file would be:

sudo apt-get install dphys-swapfile
The installation process with automatically create the swap file. Then just enable it with:
sudo swapon -a
Viola, a fully function swap file that is not on a separate partition.
proxima_centauri

Re: How to create swap partition

Post by proxima_centauri »

I guess I didn't read the OP's question very carefully.
arjot wrote:The space I reserved for swap partition is 4GB & it is shown as unusable space in partition s/w.
If you have 4GB unused SPACE already partitioned, but not used as SWAP; install (if not already available) gparted and run it. Format the space to SWAP.
Edit /etc/fstab and add

Code: Select all

/dev/sda*/  swap    swap    defaults   0  0
/dev/sda* refers to the correct partition SWAP is, for example, /dev/sda2
Locked

Return to “Installation & Boot”