Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 429966

Summary: sys-fs/cryptsetup: Migrate from /etc/conf.d/dmcrypt to /etc/crypttab
Product: Gentoo Linux Reporter: Samuli Suominen (RETIRED) <ssuominen>
Component: Current packagesAssignee: Gentoo's Team for Core System packages <base-system>
Status: CONFIRMED ---    
Severity: normal CC: alexander, andrew.bugs, ao, candrews, fturco, gentoo, gentoo, genzilla, leho, lukas.schneiderbauer, nikoli, systemd, zoltan
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://bugs.gentoo.org/show_bug.cgi?id=429390
Whiteboard:
Package list:
Runtime testing required: ---

Description Samuli Suominen (RETIRED) gentoo-dev 2012-08-05 08:05:25 UTC
Fedora (what cryptsetup upstream really is), Debian, Ubuntu, etc. uses /etc/crypttab and apps like sys-fs/udisks expect the configuration to be there.
Comment 1 SpanKY gentoo-dev 2012-08-06 02:29:52 UTC
i could have sworn there was already a bug open on this topic, but i can't find it atm.  maybe it was just mentioned in passing.
Comment 2 Doug Goldstein (RETIRED) gentoo-dev 2013-05-01 15:33:31 UTC
(In reply to comment #1)
> i could have sworn there was already a bug open on this topic, but i can't
> find it atm.  maybe it was just mentioned in passing.

You and I talked about it a while back (before the bug was made) and Samuli and I talked about it before he made this bug.
Comment 3 Leho Kraav (:macmaN @lkraav) 2013-08-31 17:36:15 UTC
Is it documented somewhere yet what I have to do? In the middle of converting a server from OpenRC here.
Comment 4 Doug Goldstein (RETIRED) gentoo-dev 2013-08-31 19:27:16 UTC
(In reply to Leho Kraav (:macmaN @lkraav) from comment #3)
> Is it documented somewhere yet what I have to do? In the middle of
> converting a server from OpenRC here.

This is a todo for us to change the format of our cryptsetup config file. So its likely unrelated to your situation.
Comment 5 Leho Kraav (:macmaN @lkraav) 2013-09-01 01:27:10 UTC
OK. Itmw I managed to migrate to /etc/crypttab with some googling. Mostly painless, once newest lvm2 discovered all VGs and some minutes were spent really going through man crypttab.
Comment 6 Andrew 2013-10-14 17:36:14 UTC
(In reply to Leho Kraav (:macmaN @lkraav) from comment #5)
> OK. Itmw I managed to migrate to /etc/crypttab with some googling. Mostly
> painless, once newest lvm2 discovered all VGs and some minutes were spent
> really going through man crypttab.

I have been unable  to use /etc/crypttab to mount plain (not luks)
encrypted partitions that use a keyfile rather than a password.
(see https://forums.gentoo.org/viewtopic-t-972332-highlight-.html)
Are you able and willing to give me any guidance?
Comment 7 Andrew 2013-10-15 19:23:55 UTC
(In reply to Leho Kraav (:macmaN @lkraav) from comment #5)
> OK. Itmw I managed to migrate to /etc/crypttab with some googling. Mostly
> painless, once newest lvm2 discovered all VGs and some minutes were spent
> really going through man crypttab.

Ignore my  above comment. Everything works just fine for me now.
Comment 8 Leho Kraav (:macmaN @lkraav) 2013-10-16 12:03:18 UTC
(In reply to Andrew from comment #7)
> (In reply to Leho Kraav (:macmaN @lkraav) from comment #5)
> > OK. Itmw I managed to migrate to /etc/crypttab with some googling. Mostly
> > painless, once newest lvm2 discovered all VGs and some minutes were spent
> > really going through man crypttab.
> 
> Ignore my  above comment. Everything works just fine for me now.

Glad to hear that. I'm totally swamped at the moment, wasn't trying to ignore your help request.
Comment 9 Pacho Ramos gentoo-dev 2013-11-17 10:13:03 UTC
(Looks like some people hit this while moving to systemd)
Comment 10 Zoltan Puskas 2018-07-07 23:38:59 UTC
How would this change affect OpenRC users? Mainly considering the use case, where some partitions/block devices are not opened during boot, but later by the user/root on first login. E.g:

1) The init filesystem has symlinks to dmcrypt for different devices:
$ ls -l /etc/init.d/dm*
/etc/init.d/dmcrypt
/etc/init.d/dmcrypt.storage -> dmcrypt
/etc/init.d/dmcrypt.swap -> dmcrypt
...

2) Separate partitions/block devices have their own config:

$ cat /etc/conf.d/dmcrypt.storage
...
target=crypt-storage
source='/dev/disk/by-uuid/...'
...
$ cat /etc/conf.d/dmcrypt.swap
...
swap=crypt-swap
source='/dev/sda2'
...

3) There is another runlevel 'unlocked'
$ rc-update
...
dmcrypt.storage |            unlocked
dmcrypt.swap | boot
...

Use case for above setup is, when server is not physically accessible (e.g. co-located, on travel from home box, etc.) and drive is unlocked by ssh-ing in after reboot and swiching runlevel and passing in password/key.