You are not logged in.

#1 2023-06-13 16:58:15

vrik
Member
Registered: 2023-01-30
Posts: 22

[SOLVED] unable to disable swap

i read the relevant documentation and tried removing my swap partition on /dev/sda5 however, after a reboot the swap came back
heres the commands i ran

:$ sudo swapoff /dev/sda5
:$ systemctl --type swap
  UNIT                                   LOAD   ACTIVE SUB    DESCRIPTION
  dev-disk-by\x2ddiskseq-1\x2dpart5.swap loaded active active Swap Partition

LOAD   = Reflects whether the unit definition was properly loaded.
ACTIVE = The high-level unit activation state, i.e. generalization of SUB.
SUB    = The low-level unit activation state, values depend on unit type.
1 loaded units listed. Pass --all to see loaded but inactive units, too.
To show all installed unit files use 'systemctl list-unit-files'.
:$ sudo systemctl mask x2dpart5.swap

heres some logs that might or might not be relevant

:$ journalctl -b --grep="swap"
Jun 13 18:36:15 archtest kernel: Spectre V1 : Mitigation: usercopy/swapgs barriers and __user pointer sanitization
Jun 13 18:36:15 archtest kernel: zswap: loaded using pool zstd/zsmalloc
Jun 13 18:36:26 archtest systemd[1]: Activating swap Swap Partition...
Jun 13 18:36:26 archtest kernel: Adding 8000508k swap on /dev/sda5.  Priority:-2 extents:1 across:8000508k FS
Jun 13 18:36:26 archtest systemd[1]: Activated swap Swap Partition.
Jun 13 18:36:26 archtest systemd[1]: Reached target Swaps.

Last edited by vrik (2023-06-13 19:41:06)

Offline

#2 2023-06-13 17:54:45

jl2
Member
From: 47° 18' N 8° 34' E
Registered: 2022-06-01
Posts: 1,054

Re: [SOLVED] unable to disable swap

remove/coment out the line with the swap partition from /etc/fstab.
also remove any "resume=" boot parameters.


Why I run Arch? To "BTW I run Arch" the guy one grade younger.
And to let my siblings and cousins laugh at Arsch Linux...

Upload longer text output like this

Offline

#3 2023-06-13 18:13:56

vrik
Member
Registered: 2023-01-30
Posts: 22

Re: [SOLVED] unable to disable swap

jl2 wrote:

remove/coment out the line with the swap partition from /etc/fstab.

my fstab looks like this and i dont see any swap line

# Static information about the filesystems.
# See fstab(5) for details.

# <file system> <dir> <type> <options> <dump> <pass>
# /dev/sda4
UUID=4fbb4de7-df33-4ad6-a6b7-0eb294e1c6b4	/         	ext4      	rw,relatime	0 1

# /dev/sda1 LABEL=SYSTEM_DRV
UUID=B807-832A      	/boot     	vfat      	rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro	0 2
 
jl2 wrote:

also remove any "resume=" boot parameters.

using this method i can tell that i didnt have any resume parameters in the first place. the output of cat /proc/cmdline is

 BOOT_IMAGE=/vmlinuz-linux root=UUID=4fbb4de7-df33-4ad6-a6b7-0eb294e1c6b4 rw quiet splash

Offline

#4 2023-06-13 18:17:19

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,417
Website

Re: [SOLVED] unable to disable swap

In order to mask the systemd service, you'd need to use the full name dev-disk-by\x2ddiskseq-1\x2dpart5.swap, but it'd be cleaner / easier to just change the partition type / label as that's what systemd uses to automatically detect and activate it as a swap partition.  Or if you really don't intend to use it anymore, just remove the partition entirely.

Last edited by Trilby (2023-06-13 18:17:40)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#5 2023-06-13 18:18:13

ua4000
Member
Registered: 2015-10-14
Posts: 527

Re: [SOLVED] unable to disable swap

instead of
:$ sudo systemctl mask x2dpart5.swap
use the correct unit name from your printout:
:$ sudo systemctl mask 'dev-disk-by\x2ddiskseq-1\x2dpart5.swap'

Offline

#6 2023-06-13 19:40:41

vrik
Member
Registered: 2023-01-30
Posts: 22

Re: [SOLVED] unable to disable swap

ua4000 wrote:

:$ sudo systemctl mask 'dev-disk-by\x2ddiskseq-1\x2dpart5.swap'

this worked. thanks to everyone who helped!

Offline

Board footer

Powered by FluxBB