1

I created a swap partition during installation, but I commented it out latter, and my computer has been reboot many times.

# swap was on /dev/sda3 during installation
#UUID=71b04cbb-8779-4b0d-8664-9f2c402f5328 none  swap    sw              0       0

but I found the swap partition was still being used despite this:

$ swapon --show
NAME      TYPE      SIZE USED PRIO
/dev/sda3 partition 7.5G   0B   -2

I found the following entry in /var/log/messages:

debian kernel: [    5.665876] Adding 7812092k swap on /dev/sda3.  Priority:-2 extents:1 across:7812092k SSFS

I'm not sure what's going on and how to fix this. Can anyone help?


update

$ lsblk -o +PARTUUID
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT PARTUUID
sda      8:0    0 447.1G  0 disk            
├─sda1   8:1    0   190M  0 part /boot/efi  3838849b-e3fd-4b5f-81c0-422b61fa5b5e
├─sda2   8:2    0   286M  0 part /boot      2406c09a-459e-422b-86b9-24b993df1826
├─sda3   8:3    0   7.5G  0 part [SWAP]     4d1a1f8f-a4ae-4fad-b9ab-40c2e2f0c106
├─sda4   8:4    0  46.6G  0 part /          7552267d-9ca8-4b3a-bf42-e688cdc9ada1
├─sda5   8:5    0 111.8G  0 part            eb053a9b-bd97-44ab-b864-45655589f2c2
└─sda6   8:6    0 280.9G  0 part /home      6179cce6-66d5-42db-a288-5675910be9cb
$ systemctl list-units --type=swap
UNIT          LOAD   ACTIVE SUB    DESCRIPTION                                                                                                                                                                    
dev-sda3.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.

 systemctl status dev-sda3.swap
● dev-sda3.swap - Swap Partition
   Loaded: loaded (/run/systemd/generator.late/dev-sda3.swap; generated)
   Active: active since Thu 2021-04-01 16:56:20 CST; 16h ago
     What: /dev/sda3
     Docs: man:systemd-gpt-auto-generator(8)
    Tasks: 0 (limit: 4915)
   Memory: 536.0K
   CGroup: /system.slice/dev-sda3.swap

Apr 01 16:56:20 debian systemd[1]: Activating swap Swap Partition...
Apr 01 16:56:20 debian systemd[1]: Activated swap Swap Partition.

to prevent the swap (/dev/sda3) from automount by systemd, use

sgdisk -A 3:set:63 /dev/sda
Roy
  • 21

0 Answers0