Friday, May 10, 2024
 Popular · Latest · Hot · Upcoming
3
rated 0 times [  3] [ 0]  / answers: 1 / hits: 455  / 1 Year ago, fri, march 31, 2023, 11:06:15

I have noticed that my swap is not available. This could explain why my computer freezes every so often when I am using it heavily.



I installed 14.04 64-bit with an encrypted folder, which automatically encrypts my swap. This used to work perfectly in 12.04 64-bit.



The relevant lines from /etc/fstab are:



# swap was on /dev/sda6 during installation
#UUID=5e37c9cd-ba35-4907-8c77-556a308d1491 none swap sw 0 0
/dev/mapper/cryptswap1 none swap sw 0 0


sudo blkid does not list the swap:



/dev/sda1: LABEL="PQSERVICE" UUID="FA3A29383A28F375" TYPE="ntfs" 
/dev/sda2: LABEL="SYSTEM RESERVED" UUID="967CF34F7CF3291F" TYPE="ntfs"
/dev/sda3: LABEL="Daisy PC" UUID="36027B05027AC97F" TYPE="ntfs"
/dev/sda5: LABEL="DaisyHome" UUID="4ad946a8-3a8e-41b9-907c-258b2ad9544e" TYPE="ext4"
/dev/sda7: LABEL="DaisyRoot" UUID="5cb3c1ff-fdd2-458b-9765-b9407d19b469" TYPE="ext4"


System Monitor shows swap as being unavailable.



Swap not available in System Monitor



Gparted shows the swap partition as "unknown".



GIMP swap partition unknown



Disks shows the swap partition as "Linux Swap", but is unable to mount the partition.



Disks Linux partition



I have been Googling, reading Ubuntu Forums and searching this forum, and have been unable to find anything that helps to re-enable the swap.



Can you help, please.



EDIT



The file /etc/crypttab confusingly has two lines:



cryptswap1 UUID=5e37c9cd-ba35-4907-8c77-556a308d1491 /dev/urandom swap,cipher=aes-cbc-essiv:sha256
cryptswap1 UUID=7426472f-9ec1-4e53-b8e1-930e3d6f73fc /dev/urandom swap,cipher=aes-cbc-essiv:sha256


Here is a list of the UUIDs on my system:



$ ls -l /dev/disk/by-uuid/
total 0
lrwxrwxrwx 1 root root 10 Jun 20 08:48 36027B05027AC97F -> ../../sda3
lrwxrwxrwx 1 root root 10 Jun 20 08:48 4ad946a8-3a8e-41b9-907c-258b2ad9544e -> ../../sda5
lrwxrwxrwx 1 root root 10 Jun 20 08:48 5cb3c1ff-fdd2-458b-9765-b9407d19b469 -> ../../sda7
lrwxrwxrwx 1 root root 10 Jun 20 08:48 967CF34F7CF3291F -> ../../sda2
lrwxrwxrwx 1 root root 10 Jun 20 08:48 FA3A29383A28F375 -> ../../sda1


Now my problem is: How do I determine the UUID of /dev/sda6? Is this even possible on an encrypted swap? Finally, how do I fix /etc/crypttab?


More From » encryption

 Answers
7

Thanks to your comments, @saiarcot895, on further investigation I have discovered what to do.



I have edited /etc/crypttab to remove the extra line (there was also an extra line in /etc/fstab, which I removed), and to replace UUID with the partition reference. Hence:



cryptswap1 /dev/sda6 /dev/urandom swap,cipher=aes-cbc-essiv:sha256


I would still like to know how to replace the partition reference with the UUID, but perhaps that's not possible with an encrypted swap.



EDIT:



As far as I can tell, the UUID of an encrypted partition is unavailable until that partition has been decrypted. I have discovered that in the case of an encrypted swap using a random key each boot, the UUID changes each time. Therefore, the UUID is not useful in specifying which encrypted partition to mount.



This can cause a serious problem with removable disks!


[#24540] Saturday, April 1, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
scusaper

Total Points: 335
Total Questions: 111
Total Answers: 119

Location: Belize
Member since Mon, Jun 20, 2022
2 Years ago
scusaper questions
Fri, Apr 15, 22, 15:26, 2 Years ago
Wed, Mar 15, 23, 03:53, 1 Year ago
Sat, Jun 4, 22, 18:03, 2 Years ago
;