How to add an entry in /etc/crypttab? [Solved]

Discussions Regarding Software

Moderator: Moderators

How to add an entry in /etc/crypttab? [Solved]

Postby aquarius » Thu Jun 30, 2011 22:54

Hi,

I'm trying to add an entry into /etc/crypttab. The problem is Sabayon seams to ignore my change and appropriate device is not available in /dev/mapper. The entry itself is fine - I can open the encrypted partition in terminal with cruptsetup luksOpen.

I've also noticed that /etc/crypttab and /etc/fstab are working differently on Sabayon comparing to Fedora/Ubuntu.
My /etc/crypttab in Fedora:
Code: Select all
aruba etc # cat /etc/crypttab
luks-d57e1ed1-2f1a-4852-99e4-9c2106209ec1 UUID=d57e1ed1-2f1a-4852-99e4-9c2106209ec1 none
vg_acer-lv_encrypted      /dev/mapper/vg_acer-lv_decrypted    /path/luks.key  luks

and /etc/fstab (comments removed):
Code: Select all
aruba etc # cat /etc/fstab
/dev/mapper/luks-d57e1ed1-2f1a-4852-99e4-9c2106209ec1 /                ext4    defaults        1 1
UUID=7b054c32-9a50-48b5-89b9-203c7bb0984f /boot                   ext3    defaults        1 2
tmpfs                   /dev/shm                tmpfs   defaults        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0
/dev/mapper/vg_acer-lv_decrypted          /mnt/decrypted     ext3    defaults          0  1


In Sabayon /etc/crypttab:
Code: Select all
aruba / # cat /etc/crypttab
luks-7c70b28a-e765-405d-8701-8d8f5488d93a UUID=7c70b28a-e765-405d-8701-8d8f5488d93a none
vg_acer-lv_encrypted      /dev/mapper/vg_acer-lv_decrypted    /path/luks.key  luks

and /etc/fstab (the last row is commented out because Sabayon does not create /dev/mapper/vg_acer-lv_decrypted):
Code: Select all
aruba etc # cat /etc/fstab
UUID=b64600a3-394f-4cfa-8361-c06b4b7d9d29 /                       btrfs   defaults        1 1
UUID=6de2df91-f287-401b-b13f-0ac17491bd6d /boot                   ext3    defaults        1 2
tmpfs                   /dev/shm                tmpfs   defaults        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0
#/dev/mapper/vg_acer-lv_decrypted          /mnt/decrypted     ext3    defaults          0  1

Please, notice the root partition UUID differs in crypttab and fstab in Sabayon. In Fedora they are the same. In fact Sabayon is not using /dev/mapper for the root partition in fstab.

In short. I want my encrypted partition to be opened by /etc/crypttab and mounted by /etc/fstab.
Any tips how can I achieve this?

Thanks in advance
Last edited by aquarius on Sat Jul 09, 2011 20:55, edited 1 time in total.
Gnome2 is dead! Long live... E17!

System76 Gazelle Professional:
Intel Core i7-2670QM
Nvidia GeForce GTX 560M
16GB DDR3 SDRAM
750GB HDD + 120GB SSD
15.6" Full HD LED-Backlit Matte Display

powered by Sabayon amd64 E17
aquarius
Simple Hen
 
Posts: 86
Joined: Sun Jun 26, 2011 22:17
Location: L'viv, Ukraine

Re: How to add an entry in /etc/crypttab?

Postby aquarius » Thu Jul 07, 2011 20:25

I've found a bug which prevents Sabayon form reading non-first entries in /etc/crypttab:
http://bugs.sabayon.org/show_bug.cgi?id=2522

I think this is the root of my problem with crypttab :(
Gnome2 is dead! Long live... E17!

System76 Gazelle Professional:
Intel Core i7-2670QM
Nvidia GeForce GTX 560M
16GB DDR3 SDRAM
750GB HDD + 120GB SSD
15.6" Full HD LED-Backlit Matte Display

powered by Sabayon amd64 E17
aquarius
Simple Hen
 
Posts: 86
Joined: Sun Jun 26, 2011 22:17
Location: L'viv, Ukraine

Re: How to add an entry in /etc/crypttab?

Postby aquarius » Sat Jul 09, 2011 20:55

I've found a workaround (all thanks go to guys on Sabayon IRC and Google).
I created 2 scripts in /etc/local.d
The first one which ends with .start opens encrypted partitions and mounts them.
The second one which ends with .stop unmounts the partitions and closes them (luksClose).

Because of this I mark this thread as solved.
Gnome2 is dead! Long live... E17!

System76 Gazelle Professional:
Intel Core i7-2670QM
Nvidia GeForce GTX 560M
16GB DDR3 SDRAM
750GB HDD + 120GB SSD
15.6" Full HD LED-Backlit Matte Display

powered by Sabayon amd64 E17
aquarius
Simple Hen
 
Posts: 86
Joined: Sun Jun 26, 2011 22:17
Location: L'viv, Ukraine


Return to Software in General

Who is online

Users browsing this forum: No registered users and 1 guest