problem with lvm swap with luks key reqs pass bootup

Support for security such as Firewalls and securing linux
Post Reply
fooman
Posts: 16
Joined: 2011/11/16 10:32:37

problem with lvm swap with luks key reqs pass bootup

Post by fooman » 2012/05/24 13:03:18

I have a headless centos setup and don't have your typical luks within lvm setup because its a headless box and remote so entering passes is not in my best interest.

I have lvm setup and within lvm i have / that's not encrypted with keys inside that opens up partitions I made within the vg that are encrypted hence why / is not encrypted so it can startup on its own without user interaction. its not a secure setup but it serves my purposes.

Now initially I had swap using a random key but centos does like it and so I just used an actual keyfile but it still asks for a password. I evenremoved the first or 0 slot which contained the password and replaced it with the static keyfile but still on bootup prior to centos would show press I for interactive startup it would get stuck asking for the dang swap pw when there is none. Pressing enter 3 times skips it and it mounts my other partitions with keys just fine. But what's with swap? I even tried to disable swap in fstab to avoid stalled reboots but whenever the lvm is opened up it keeps asking for the password.

I also done things like mkfs and cleared luks off swap but that didn't work seems like whatever I have done to rid the system from seeing the swap vg partition as a luks has went no where. How can I stop my centos remote box asking for swaps password when I had it set to use a random key in crypttab as /dev/urandom. I don't mind even if it does not automount swap on bootup I can just add to /etc/rc.local to mount swap so that it doesn't stall waiting for a password.

Begging for some advice, been beating up my keyboard in frustration.. tia

:-o

User avatar
TrevorH
Site Admin
Posts: 33215
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

problem with lvm swap with luks key reqs pass bootup

Post by TrevorH » 2012/05/24 13:44:06

[quote]
initially I had swap using a random key but centos does like it
[/quote]

Sure it does. On CentOS 5 I have this

[code]
# grep swap /etc/fstab
/dev/mapper/xswap swap swap defaults 0 0
# grep swap /etc/crypttab
xswap /dev/mapper/vg-lv_swap /dev/urandom swap
[/code]

fooman
Posts: 16
Joined: 2011/11/16 10:32:37

Re: problem with lvm swap with luks key reqs pass bootup

Post by fooman » 2012/05/31 09:55:09

That was my initial fstab and crypttab

should I do a cryptsetup luksFormat or format it as a ext3 partition. I think I tried both alrready but will try again tomorrow night. Luckily the server is stable and I have a good uptime

User avatar
TrevorH
Site Admin
Posts: 33215
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: problem with lvm swap with luks key reqs pass bootup

Post by TrevorH » 2012/05/31 11:39:35

Post the exact contents of your /etc/crypttab and /etc/fstab, wrapped in [code][/code] tags to preserve formatting please. Probably also worth including the output from the `lvs` command too.

Post Reply