swap partition and SSD drive [solved]

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
Liamdale
Level 1
Level 1
Posts: 27
Joined: Sat Nov 18, 2017 9:31 pm
Location: Quebec, Canada

swap partition and SSD drive [solved]

Post by Liamdale »

I've recently had a new computer built using kubuntu 17.10. When kubuntu was installed it had no swap partition. All the documentation were on the same page, stating that a swap partition is not recommended for a ssd. Also new to me is the UEFI boot process since my last computer built in 2005 had no UEFI. So when I decided to change from Kubuntu to Mint 18.2 KDE, I had to deal with these two aspects, Swap partition and UEFI. Research on the web established that using the dd utility to setup my bootable flash drive would correctly incorporate the UEFI. I could not find definitive data on how to handle the Swap partition, that is, to use a swap file instead of a swap partition.

I installed Mint 18.2 kde and as expected a swap partition was created. I configured my version of mint using SSD: how to optimize your Solid State Drive for Linux Mint 18.x, Ubuntu 16.04 and Debian from https://sites.google.com/site/easylinuxtipsproject/ssd.

My question, can I remove the swap partition and create a swap file instead? if yes, how?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
kukamuumuka

Re: swap partition and SSD drive

Post by kukamuumuka »

Liamdale wrote: My question, can I remove the swap partition and create a swap file instead? if yes, how?
Yes. The creation goes like:

Code: Select all

sudo -i
dd if=/dev/zero of=/swap bs=1024 count=262144  ## about 250 MB file
mkswap /swap
swapon /swap
... add swap-file to/etc/fstab file.

Code: Select all

/swap swap swap defaults 0 0
http://puolanka.info/goto/swap-file/
Liamdale
Level 1
Level 1
Posts: 27
Joined: Sat Nov 18, 2017 9:31 pm
Location: Quebec, Canada

Re: swap partition and SSD drive

Post by Liamdale »

Thanks for the Info.
mr_raider
Level 7
Level 7
Posts: 1897
Joined: Sun Jun 20, 2010 9:50 am
Location: Montreal, QC

Re: swap partition and SSD drive [solved]

Post by mr_raider »

Just to clarify Ubuntu did create a swap file. As of 17.04 the installer no longer creates a swap partition by default just a swap file under /
Image
Liamdale
Level 1
Level 1
Posts: 27
Joined: Sat Nov 18, 2017 9:31 pm
Location: Quebec, Canada

Re: swap partition and SSD drive [solved]

Post by Liamdale »

You are right. This new computer was first installed with kubuntu 17.04 and a swap file was automatically installed (no swap partition) but I reinstalled mint 18.2 (KDE) because of the Kubuntu had some bugs which I didn't want to live with. Mint 18.2 installed a 16G partition for the swap. Mint 18.2 is based on ubuntu 16.04LTS.

One last question... With a swap file installed can I eliminate the swap partition without problems?
User avatar
Pierre
Level 21
Level 21
Posts: 13215
Joined: Fri Sep 05, 2008 5:33 am
Location: Perth, AU.

Re: swap partition and SSD drive [solved]

Post by Pierre »

the idea of a swap file is still fairly new,
but you should be able to lose the swap partition without any issues.
Image
Please edit your original post title to include [SOLVED] - when your problem is solved!
and DO LOOK at those Unanswered Topics - - you may be able to answer some!.
Liamdale
Level 1
Level 1
Posts: 27
Joined: Sat Nov 18, 2017 9:31 pm
Location: Quebec, Canada

Re: swap partition and SSD drive [solved]

Post by Liamdale »

Thanks for the input. Plan on eliminating the swap partition. We'll see what happens.
Locked

Return to “Installation & Boot”