You are not logged in.

#1 2020-10-06 14:15:55

phuturism
Member
From: Jakarta, Bali, Singapore, Melb
Registered: 2016-07-15
Posts: 101

[SOLVED] Encrypted swap not mounting on boot

I noticed some error messages flashing by after entering encryption password but boot and operation was ok.   Encryption on Lithium install was standard with separate root/home/swap partitions as I recall.   Subsequently I did shrink the root partition and increased the home partition as my ssd drive is only 128GB.  I used KDE Partition Manager following instructions here http://e1z.ca/devlog/encrypted_partition_resize.html from a live lithium ISO - vaguely recall some fiddling around so possibly broke swap then without noticing it til now.

Then occasionally the system would crash (freeze) under heavy load and I thought swap might be an issue as RAM is 8GB and I'm often sitting around 6 or 7. 

Boot error messages turned out to be:

: dev-mapper-c2yp70n0m1c0n\x2d\x2dvg\x2dswap_1.swap: Swap process exited, code=exited, status=255/EXCEPTION
Oct 06 20:29:50 c2yp70n0m1c0n systemd[1]: dev-mapper-c2yp70n0m1c0n\x2d\x2dvg\x2dswap_1.swap: Failed with result 'exit-code'.
Oct 06 20:29:50 c2yp70n0m1c0n systemd[1]: Failed to activate swap /dev/mapper/c2yp70n0m1c0n--vg-swap_1.
Oct 06 20:29:50 c2yp70n0m1c0n systemd[1]: Dependency failed for Swap.
Oct 06 20:29:50 c2yp70n0m1c0n systemd[1]: swap.target: Job swap.target/start failed with result 'dependency'.

Googled some of these errors but nothing particular seemed relevant in Debian forums or elsewhere.   Did give me a clue to try swapon, results here:

~$ sudo swapon --all --verbose
swapon: /dev/mapper/c2yp70n0m1c0n--vg-swap_1: found signature [pagesize=4096, signature=swap]
swapon: /dev/mapper/c2yp70n0m1c0n--vg-swap_1: pagesize=4096, swapsize=23999807488, devsize=9198108672
swapon: /dev/mapper/c2yp70n0m1c0n--vg-swap_1: last_page 0x596800000 is larger than actual size of swapspace
swapon /dev/mapper/c2yp70n0m1c0n--vg-swap_1
swapon: /dev/mapper/c2yp70n0m1c0n--vg-swap_1: swapon failed: Invalid argument

Thoughts welcome :-)

Last edited by phuturism (2020-10-28 06:42:03)


L I N U X  -  M O T O R B I K E S  -  B O O K S  -  T R A V E L  -  A S I A

Offline

#2 2020-10-06 16:59:29

sleekmason
Member
Registered: 2018-05-22
Posts: 259

Re: [SOLVED] Encrypted swap not mounting on boot

I would look at:

sudo blkid

and make sure the uuid's match up with whatever you have in /etc/fstab.

If different, just change the uuid in fstab to the number you get from the sudo blkid command, and then update initramfs with:

sudo update-initramfs -u -k all

Kinda looks like the swap partition changed in some way.  Or is something handled differently due to encryption? Anyhow, hope this helps.

Offline

#3 2020-10-07 02:01:37

phuturism
Member
From: Jakarta, Bali, Singapore, Melb
Registered: 2016-07-15
Posts: 101

Re: [SOLVED] Encrypted swap not mounting on boot

sleekmason wrote:

I would look at:

sudo blkid

and make sure the uuid's match up with whatever you have in /etc/fstab.

If different, just change the uuid in fstab to the number you get from the sudo blkid command, and then update initramfs with:

sudo update-initramfs -u -k all

Kinda looks like the swap partition changed in some way.  Or is something handled differently due to encryption? Anyhow, hope this helps.

Thanks sleekmason.  Same error unfortunately! 

I'll keep digging.


L I N U X  -  M O T O R B I K E S  -  B O O K S  -  T R A V E L  -  A S I A

Offline

#4 2020-10-07 11:15:45

phuturism
Member
From: Jakarta, Bali, Singapore, Melb
Registered: 2016-07-15
Posts: 101

Re: [SOLVED] Encrypted swap not mounting on boot

Solved - by reinstalling lithium as I buggered something up even worse using KDE partitionmanager


L I N U X  -  M O T O R B I K E S  -  B O O K S  -  T R A V E L  -  A S I A

Offline

#5 2020-10-28 04:51:05

phuturism
Member
From: Jakarta, Bali, Singapore, Melb
Registered: 2016-07-15
Posts: 101

Re: [SOLVED] Encrypted swap not mounting on boot

Encountered the same problem using partitionmanager to resize/move the swap partition.   Partition manager decrypts the partitions nicely to allow mods, but seemed to do something to the swap partition so it's not activated. 

i did find a solution which I post here for others if they experience the same problem - something about the encrypted partition path was not being dealt with.  Had to remake the swap partition with the correct encrypted path.

anto@cryptonomicon:~$ sudo mkswap /dev/mapper/cryptonomicon--vg-swap_1
[sudo] password for anto: 
mkswap: /dev/mapper/cryptonomicon--vg-swap_1: warning: wiping old swap signature.
Setting up swapspace version 1, size = 7.7 GiB (8271163392 bytes)
no label, UUID=95123208-29ee-4320-9288-453473d66e90
anto@cryptonomicon:~$ sudo swapon -a
anto@cryptonomicon:~$ swapon
NAME      TYPE      SIZE USED PRIO
/dev/dm-2 partition 7.7G   0B   -2

L I N U X  -  M O T O R B I K E S  -  B O O K S  -  T R A V E L  -  A S I A

Offline

Board footer

Powered by FluxBB