possible to create swap partition after install?

Quick to answer questions about finding your way around Linux Mint as a new user.
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. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
kate273

possible to create swap partition after install?

Post by kate273 »

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?
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.
DataMan

Re: possible to create swap partition after install?

Post by DataMan »

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,

DataMan
Locked

Return to “Beginner Questions”