Skip to content

Swapfile in fstab disables GPT automount of swap partition #35429

@cvlc12

Description

@cvlc12

systemd version the issue has been seen with

256.8

Used distribution

Arch

Linux kernel version used

6.12

CPU architectures issue was seen on

x86_64

Component

systemd-gpt-auto-generator

Expected behaviour you didn't see

Swap partition (encrypted) properly configured for automount:

# swapon
NAME      TYPE      SIZE USED PRIO
/dev/dm-2 partition  16G   0B   -2

Add an additional swapfile in fstab:

# cat /etc/fstab
/swap/swapfile none swap defaults 0 0
# swapon --all
# swapon
NAME           TYPE      SIZE USED PRIO
/dev/dm-2      partition  16G   0B   -2
/swap/swapfile file        4G   0B   -3

Unexpected behaviour you saw

Reboot, and the swap partition is not automounted anymore:

$ swapon
NAME           TYPE SIZE USED PRIO
/swap/swapfile file   4G   0B   -2

Why does adding a swapfile disable swap partition automounting ? If this is the desired behavior, I believe it's not documented anywhere?

Steps to reproduce the problem

No response

Additional program output to the terminal or log subsystem illustrating the issue

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions