Multiple swap partitions?

When I shut down my system, I see, in the shutdown splash, a list of several swap partitions being unmounted, while my fstab really has only a single one defined.

Furthermore, they appear to be partitions that all reside in /dev, and with UUID’s that I am pretty certain to not exist on my system.

Why does Manjaro do that, and may it somehow be related to my hard disks responding with 10 secs timeouts before starting the job given?

Hi @Arikania,

To get a list of all your UUIDs, run:

blkid

That will provide you with a list of UUIDs and for which partitions they are.

To get a list of active swap files/partitions, run:

swapon --show

:bangbang: Tip :bangbang:

When posting terminal output, copy the output and paste it here, wrapped in three (3) backticks, before AND after the pasted text. Like this:

```
pasted text
```

Or three (3) tilde signs, like this:

~~~
pasted text
~~~

This will just cause it to be rendered like this:

Sed
sollicitudin dolor
eget nisl elit id
condimentum
arcu erat varius
cursus sem quis eros.

Instead of like this:

Sed sollicitudin dolor eget nisl elit id condimentum arcu erat varius cursus sem quis eros.

Alternatively, paste the text you wish to format as terminal output, select all pasted text, and click the </> button on the taskbar. This will indent the whole pasted section with one TAB, causing it to render the same way as described above.

Thereby increasing legibility thus making it easier for those trying to provide assistance.

For more information, please see:


:bangbang::bangbang: Additionally

If your language isn’t English, please prepend any and all terminal commands with LC_ALL=C. For example:

LC_ALL=C bluetoothctl

This will just cause the terminal output to be in English, making it easier to understand and debug.

1 Like

swapon --show shows only the one from my fstab:

NAME      TYPE       SIZE USED PRIO
/dev/sdd1 partition 50.4G   0B   -2

(pro tip: if you run blkid as root, so with sudo, it gives a lot of extra information)

Sure as heck doesn’t look that way to me:

$ sudo blkid
/dev/nvme0n1p3: UUID="9a26c8d0-43f4-44ad-a7d3-861d6f6cdbfa" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="b84f55b3-2488-a14c-9c4a-6acd385f2db6"
/dev/nvme0n1p1: UUID="D563-DAB7" BLOCK_SIZE="512" TYPE="vfat" PARTUUID="0653a05b-0f22-f64c-a283-7cc0dcb83551"
/dev/nvme0n1p2: UUID="1b3f894f-5481-4241-ace5-c129a0cdb412" TYPE="swap" PARTUUID="30f1cded-fe63-be47-9fe7-e2bdf635f38f"
/dev/sdb1: LABEL="5TB" UUID="953836d8-e355-4c6d-ac1a-0914b8414f50" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="7a05b57a-5368-c647-baa3-410f462004a6"
/dev/sda1: LABEL="4TB" UUID="c47c5a52-db30-4aef-bcbc-af35b7b021fd" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="32f8a311-a601-ed4c-96d3-0d4cf6e6bd04"
$  blkid
/dev/nvme0n1p3: UUID="9a26c8d0-43f4-44ad-a7d3-861d6f6cdbfa" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="b84f55b3-2488-a14c-9c4a-6acd385f2db6"
/dev/nvme0n1p1: UUID="D563-DAB7" BLOCK_SIZE="512" TYPE="vfat" PARTUUID="0653a05b-0f22-f64c-a283-7cc0dcb83551"
/dev/nvme0n1p2: UUID="1b3f894f-5481-4241-ace5-c129a0cdb412" TYPE="swap" PARTUUID="30f1cded-fe63-be47-9fe7-e2bdf635f38f"
/dev/sdb1: LABEL="5TB" UUID="953836d8-e355-4c6d-ac1a-0914b8414f50" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="7a05b57a-5368-c647-baa3-410f462004a6"
/dev/sda1: LABEL="4TB" UUID="c47c5a52-db30-4aef-bcbc-af35b7b021fd" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="32f8a311-a601-ed4c-96d3-0d4cf6e6bd04"
$ diff --brief --side-by-side <(blkid) <(sudo blkid)
$

For me, it doesn’t show the UUID’s when I omit sudo.

Strange, because:

$ alias blkid
$ 

When using GUID partition layout - the default - all partitions defined will have a partition type guid assigned.

Swap partitions always have the same partition type guid but with a different UUID.

systemd will recognized and use all partitions with the swap type GUID and assign them to as swap and that happens whether the entry is listed in fstab or not.

Discoverable Partitions Specification | UAPI Group Specifications
The Wondrous World of Discoverable GPT Disk Images

In fact - it is possible - if properly configured - to run a modern Linux system without any entries in /etc/fstab

It is indeed installed on my system, and now I wonder if it’s the cause of all issues I have with my hard disks, since I have these 18 TB disks in my computer.

Do I need this DPS thing (given that my fstab contains all necessarry info)?, and can I somehow disable or uninstall it?

You cannot disable or remove - it is how it is.

What you can do is change the redundant swap partitions to something else.

Actually, you can disable the extra swap partitions by adding them to /etc/fstab as commented-out entries. systemd will then refrain from using them. :wink:

The problem is that they aren’t in my fstab :frowning:

That is why you need to add them to /etc/fstab, but commented-out — i.e. with a “#” in front of them.

Are you sure ?

That kind’a defeats the purpose of comments - right?

If the partition has the partition type guid for a swap partition - then the partition will be used as swap.

To my knowledgede - the only way of disabling the behaviour is to change the partition type.

INHO That is the exact same behaviour as the normal fstab file, so no.

1 Like

I think you just read the last part of the conversation - you miss the important part.

The part where all partitions with partition type guid 0657fd6d-a4ab-43c4-84e5-0933c84b4f4f will be used as swap.

where can I read the jobs listed when the system shuts down? I need that to list all swap partitions that get unmounted at that point.

And, instead of adding them commented out, can’t I just add them with the noauto mount option? That would make more sense to me.

I’ve read the whole thread. And this:

Still sounds like the exact same behaviour as a standard, plain-text, no-special fstab file.

1 Like

So I am thinking XY problem here - you have several partitions assigned as swap but you want to prevent the system from using them.

Perhaps - I don’t know - what I do know is that systemd looks at the partition type guid and will use the partitions as swap - whether defined in fstab or not.

It does not make sense to have multiple partitions marked as swap if you are not using them.

Then it makes more sense to assign and use them as generic linux file systems e.g. 0x8300 instead of 0x8200. (cgdisk notation)

journalctl | grep -i uuid | grep -e 'Deactivated swap'

Run:

journalctl -b -1 --no-pager | grep -i unmount

or

journalctl -b -1 --no-pager | grep -i swap

would not simply
swapon
return every swap space in use at the time,
whether defined in /etc/fstab or not?

I know that I only have one swap file defined in fstab
but then I also have zram/zswap
(the zramswap AUR solution)
and the result is:

LANG=C swapon 
NAME       TYPE      SIZE USED PRIO
/swapfile  file        4G   0B   -2
/dev/zram0 partition 1.9G   0B  100
1 Like