FS#11295 - SWAP keyword in /etc/crypttab doesn't create /dev/mapper/swap

Attached to Project: Arch Linux
Opened by Manuel C. (ekerazha) - Saturday, 23 August 2008, 16:43 GMT
Last edited by Thomas Bächler (brain0) - Friday, 29 August 2008, 13:29 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To Thomas Bächler (brain0)
Architecture All
Severity Medium
Priority Normal
Reported Version None
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

If you put (example)


swap /dev/sda3 SWAP -c aes-xts-plain -h whirlpool -s 512


into /etc/crypttab and reboot, it doesn't create any /dev/mapper/swap device (and it can't "swapon").

It seems like the "SWAP" keywork doesn't work as expected.

Other users have this issue too: http://bbs.archlinux.org/viewtopic.php?id=53808
This task depends upon

Closed by  Thomas Bächler (brain0)
Friday, 29 August 2008, 13:29 GMT
Reason for closing:  Not a bug
Comment by Bernhard (dw) - Sunday, 24 August 2008, 09:32 GMT
i can confirm this one...
Comment by Roman Kyrylych (Romashka) - Thursday, 28 August 2008, 20:27 GMT
Cannot confirm, everything works as expected:
# cat /etc/crypttab | grep /dev/sda2
swap /dev/sda2 SWAP -c aes-xts-plain -h whirlpool -s 512
# ls -l /dev/mapper/swap
brw------- 1 root disk 254, 2 сер 28 19:16 /dev/mapper/swap
Comment by Manuel C. (ekerazha) - Thursday, 28 August 2008, 20:33 GMT
I can still confirm the issue on a fresh installed Arch Linux system (using 2008.06).

Bernhard (dw), can you still confirm this one too?
Comment by Thomas Bächler (brain0) - Thursday, 28 August 2008, 21:43 GMT
There is a sanity check in place: If the partition contains a LUKS signature, initscripts do not open the mapping and overwrite the partition.

However, other sanity checks are not in place, although they should be. Try overwriting the first few sectors of the partition with dd and see if it helps.-
Comment by Manuel C. (ekerazha) - Friday, 29 August 2008, 08:05 GMT
I'll try, however this is weird as I deleted and recreated/reformatted the partition and /dev/sda3 was never luksFormatted.
Comment by Bernhard (dw) - Friday, 29 August 2008, 08:41 GMT
hi there.

i can reproduce this using up to date installation media in a fully updated system (both with and without testing enabled)

it seems to me that the check in /etc/sysinit.rc wheter the partition is as luks-partition seems to have something to do with the problem. my swap partition was ONCE a luks partition but in the meantime i have formatted this quite a few times. so i don't really understand why overwriting the first sectors could help to solve the problem. but i will try and report back here.
Comment by Thomas Bächler (brain0) - Friday, 29 August 2008, 09:54 GMT
# cryptsetup isLuks /dev/something
# echo $?

If this returns 0, then /dev/something is recognized as a LUKS partition.
Comment by Bernhard (dw) - Friday, 29 August 2008, 12:48 GMT
thomas, you were right. after using dd if=/dev/zero of=/dev/myswap everything works as expected. strange though, that reformating obviously doesn't remove the luks header of the partition....
Comment by Thomas Bächler (brain0) - Friday, 29 August 2008, 12:51 GMT
The LUKS magic number is not directly at the beginning of the partition. And creating a filesystem often leaves some space untouched, so this could easily happen. Can we close this then?
Comment by Manuel C. (ekerazha) - Friday, 29 August 2008, 13:26 GMT
I didn't have time to try this yet, however I had a LUKS partition there... well, it was deleted, recreated (using a different size) and formatted... but maybe the "magic number" is still somewhere as for "dw". I think you can close this, eventually I'll reopen the ticket.

Loading...