possible to create swap partition after install?

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
Level 1
Level 1
Posts: 9
Joined: Fri Jun 06, 2008 7:50 am
Location: United Kingdom, Bromley

possible to create swap partition after install?

Postby kate273 » Wed May 27, 2009 4:54 am

I set up Linux Mint to dual boot on someone's PC but didn't set up a swap partition as I wasn't sure what they wanted to do with their XP system (that wouldn't load because of virus/trojan).
I can now set a swap partition up, but was wondering if I can do that without doing a re-install?

User avatar
Level 6
Level 6
Posts: 1234
Joined: Thu Dec 04, 2008 6:47 am
Location: Carmel, Midwest USA at /var/www

Re: possible to create swap partition after install?

Postby DataMan » Wed May 27, 2009 5:32 am

I've never done it post-install but it should be achievable. Here's the basics:

1. Create the swap partition using a partition editor (GParted Live is my perferred).
2. Make a backup copy and then edit your /etc/fstab file and identify the swap, here's a copy of my swap entry for the fstab:

# /dev/sda5
UUID=f421f351-xxxxxxxxxxxxxxxxxxxx none swap sw 0 0

3. Save the fstab file and re-boot.

If you're going to use the uuid method for identifying the swap partition, run the following from a terminal to get the uuid for the swap partition (use cut and paste):

Code: Select all

ls /dev/disk/by-uuid -lh

Hope this helps,

Linux'd since 2005 Linux ID 422356 Ubuntu ID 15015

Return to “Newbie Questions”