Swap doesn't stay activated

Hi !

I have 4 computers, all Dell, running Manjaro Linux.
One is a desktop, and the other three are laptops.
After start up (re-boot) the swap partition is de-activated in two of the laptops, always.
In the desktop and one of the laptops, the swap stays activated.
I.e. I always have to start GParted and activate the swap in two of the laptops.
Why doesn’t the swap stay activated ?

/ Hans Gatu

please post the output of

cat /etc/fstab

are the swap-partitions filled in ?
more details are here:

1 Like

One of the laptops (Latitude E4300):

cat /etc/fstab
# /etc/fstab: static file system information.
# Use 'blkid' to print the universally unique identifier for a device; this may
# be used with UUID= as a more robust way to name devices that works even if
# disks are added and removed. See fstab(5).
# <file system>             <mount point>  <type>  <options>  <dump>  <pass>
UUID=32de3eaf-8910-4fab-acbc-d2feb1de2f28 /              ext4    defaults,noatime 0 1

/ Hans Gatu

There’s the issue. No swap in fstab.

yep, the swap is missing. you can generate a swap-partition or use a swap-file. nowadays the use of a swap-file is the modern and recommended use because it is more flexible. please refer to the wiki-link from my former post and search the wiki and internet for creating swap.

But there is a swap partition. It has been there all the time.
It does not stay activated, though.
In GEparted, after start up:

And then I have to activate it:

/ Hans Gatu

the given link already explains what to do !

To set up a partition as Linux swap area, the mkswap(8) command is used. For example:

mkswap /dev/sdxy

Warning: All data on the specified partition will be lost.

To enable the device for paging:

swapon /dev/sdxy

To enable this swap partition on boot, add an entry to /etc/fstab:

UUID=device_UUID none swap defaults 0 0

where the device_UUID is the UUID of the swap space.

See fstab for the file syntax.

The Arch wiki is great but I think the Manjaro wiki also sufficiently covers this topic.

1 Like

Now I have added it to fstab, with this command:

sudo bash -c “echo /dev/sda5 none swap defaults 0 0 >> /etc/fstab”

and it works.
So, it is the Calamares installer that has failed, then? Since the swap was set up already at the installation of Manjaro, in all 4 computers, but it had failed in 2 of them.

/ Hans Gatu

1 Like

That was my explanation to the problem too from first moment. But we cannot tell what went wrong trough installation. It shouldn’t happen.

For whatever reason, I had a similar issue as @_HG , I also had to manually add swap to fstab two years ago when I reinstalled manjaro. Maybe it was because I selected manual partitioning? I wanted to re-use the exact same partition setup as before so I didn’t actually recreate a swap partition so it seems the installer didn’t see/use the existing swap.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.