No swap partition!

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post please read how to get help
Level 1
Level 1
Posts: 27
Joined: Sat Nov 28, 2009 5:16 pm

No swap partition!

Postby SamuelFigueroa » Thu Feb 04, 2010 4:34 am

I would appreciate people's opinion about this. My home computer has 8 GB of memory and no swap partition.

What happened was that I ordered a brand new $60 chassis so I could put my very old computer in it. When I received it, I found it already had a motherboard and a power supply. At work, I found a dual core 1.8 GHz Pentium, memory, and a video card that nobody needed. I happened to have an extra 120 GB drive apparently from my previous work. I ordered an extra 1 TB drive to back up some of the other computers I have at home. I installed Windows XP Pro on over half the 120 GB drive and copied the data from my old computer.

I then proceeded to install Linux Mint x64 on the remaining free space. (I read a post in which Linus Torvalds recommends using a 64-bit kernel if you have over 2 GB of memory.) I was presented the choice to reduce the NTFS partition size on my 1 TB drive, or use the entire 1 TB drive, or partition manually. Since I wanted to install on the 120 GB drive, I chose manual. I was thinking perhaps I could have a swap partition on the 1 TB drive along with /tmp, neither of which would be backed up. (The 1 TB drive is strictly for backups, so it should not contain data that needs to be backed up.) However, I did not find an obvious way to safely split the 1 TB partition, which was already in use.

To make my long story short, I decided to forgo having a swap partition on the grounds that if I had 4 GB of memory, my swap partition would probably only be 4 GB in size, so 8 GB of memory would be enough to not require a swap partition. I did use the memory test program to verify the entire amount of memory is working fine. I don't think I'm using memory-heavy apps - just web browsing, e-mail, listening to music (I have an external D/A converter and a very nice vacuum tube amp and speakers connected to my home computer), and Windows XP running in VMware Player (which I configured to actually use the physical partition on my 120 GB drive, the same one that I can boot directly into). I may create a couple other virtual machines, but they will be even smaller than Windows XP. I don't envision working with videos - I'll use one of several Macs we have in the house for that. I may copy a few photos, but not hundreds like my kids have on their Macs.

So do I actually need a swap partition? If so, how would I go about creating one without reinstalling Linux Mint?

User avatar
Level 6
Level 6
Posts: 1491
Joined: Fri Sep 25, 2009 2:47 am

Re: No swap partition!

Postby mick55 » Thu Feb 04, 2010 5:18 am

So do I actually need a swap partition?

No. Unless you wish to use the "suspend to disk" or "resume from disk" features (hibernation)
Obviously you will be able to "suspend to RAM" :mrgreen:

If so, how would I go about creating one without reinstalling Linux Mint?

You can shrink an existing partition, create a new partition in the unallocated space,
format as type 82 (swap) and add an entry for it in fstab as below

Code: Select all

/dev/hda?       none            swap    sw              0       0

Or you could create a swap file with the "dd" command and enable it
with the "mkswap" command as below.

Create the swap file : ( 8GB )

Code: Select all

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

Setup the swap file:

Code: Select all

mkswap /swapfile

To enable the swap file:

Code: Select all

swapon /swapfile

To enable it at boot time, edit: "/etc/fstab" (sudo gedit /etc/fstab)to include:

Code: Select all

/swapfile swap swap defaults 0 0

The next time the system boots, it enables the new swap file.
Verify it's enabled by running one of these commands:

Code: Select all

cat /proc/swaps


Code: Select all

free -m

hope this helps
Things are more like they are now than they ever were before.

Dwight D. Eisenhower (1890 - 1969)

Return to “Installation & Boot”

Who is online

Users browsing this forum: LateJunction and 7 guests