Swap detected as normal partition

I partitioned my drive as ext4 with flag swap (sda4). but somehow I can mount it normally as if it is a normal partition, I don’t think this is normal.

$free
total used free shared buff/cache available
Mem: 3797 1493 181 439 2122 1602
Swap: 0 0 0

$lsblk -f
NAME FSTYPE FSVER LABEL UUID FSAVAIL FSUSE% MOUNTPOINTS
sda
├─sda1
│ ext4 1.0 21642707-f58c-49e3-b952-197cb1873870 28G 23% /
├─sda2
│ vfat FAT32 NO_LABEL
│ 9FF5-D9DC 510,7M 0% /boot/efi
├─sda3
│ ext4 1.0 f54af7b4-ce11-4736-a952-adadd7b22483 66,7G 3% /home
└─sda4
ext4 1.0 1df118ed-a54d-4846-866d-f890661358b7
sr0

is there something I miss? how do I make sda4 into swap?

As you can see, you have no swap partition, but instead you have formatted /dev/sda4 as ext4. The swap flag in the partition table does not reflect what’s on the partition ─ it is only a flag.

If the filesystem on /dev/sda4 is not mounted anywhere, then you can reformat it as a swap partition by way of mkswap. Be sure to then also add it to /etc/fstab with the proper UUID.

More information below… :arrow_down:

man mkswap
man fstab

The tutorial below also contains a section on /etc/fstab. :arrow_down:

1 Like

https://wiki.archlinux.org/title/Swap#Swap_partition

1 Like

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