Inactive swap partition

9 replies [Last post]
neon
Offline
Joined: 06/24/2015

Hello. I have recently installed Trisquel, spending days configuring and tweaking.

When i used gparted for first time, the swap partition appeared corrupted (?) so i cleared it and created a new one. Now it not mounting automatically, and i have to manually do it every time i boot. How do i configure it?

alonsogonzalez
Offline
Joined: 10/29/2014

First off, on your Trisquel installation (not the USB stick) go into GParted, right click the partition, go to information, and then obtain the UUID. (You can install it by going into Add/Remove Software.)

Then, do "sudo nano /etc/fstab" in a terminal window, and look for a line that looks similar to this:
UUID=(insert_here) none swap sw 0 0

Make sure the line you are working on is swap, not ext4. Replace whatever UUID is in there with that of the new swap partition. If there is no swap partition configured in fstab, then insert and modify the line above. Press CTRL+X to exit Nano, and hit Y to save.

I would also suggest running "sudo update-initramfs -u" to update the fstab configurations for the initial ramdisks as well.

neon
Offline
Joined: 06/24/2015

Ok thanks, its working

Magic Banana

I am a member!

I am a translator!

Offline
Joined: 07/24/2010

First off, on your Trisquel installation (not the USB stick) go into GParted, right click the partition, go to information, and then obtain the UUID.

For lazy people, like me, you can simply specify the device in the first column. I have that line in my /etc/fstab:
/dev/sda1 none swap sw 0 0

marioxcc
Offline
Joined: 08/13/2014

That will cause problems if devices are renumbered, which may happen if one adds or removes hard disks.

alonsogonzalez
Offline
Joined: 10/29/2014

I used to have my fstab file like that, and assume the boot device was on /dev/sda, until the boot device became sdb somehow and the system would not boot. I forgot what caused that, however as a result, nowadays I only ever use the UUID.

SuperTramp83

I am a translator!

Offline
Joined: 10/31/2014

I bet you have the /home partition encrypted!
This happened to me and onpon (if I recall correctly, which then pointed to a link, explaining that it was a know bug) and we both had the /home encrypted.
I used the same fix provided by alonso.

onpon4
Offline
Joined: 05/30/2012

This is the topic you're referring to:

https://trisquel.info/en/forum/swap-not-turning-default

SuperTramp83

I am a translator!

Offline
Joined: 10/31/2014

yes! that one it is.