Skip to contentSkip to conversation

encrypted partitions aren't recognized in a good way

DISCUSSION Vladimir 'φ-coder/phcoder' Serbinenko 1 participant 5 messages Jul 20, 2011 – Nov 10, 2011 4 messages not in the archive

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive

Moving to grub-devel.

Quoted 7 lines · devkral

Hello,
the scripts to generate a grub.cfg file doesn't find lvm under encrypted partitions (arch).
Debian has fixed this problem elsewise but it would be nice to have a clean way detecting such partitions.
I attach a patch to do so with an alternative /etc/grub.d/10_linux file (cryptgrub2.patch).

Quoted 5 lines

Cryptswapgrub2.patch includes also a fix
for hibernation support with encrypted swap-partitions (it includes
every swap device in fstab invoked by the "resume=" command in the kernel argument list, so I'm not sure if this hasn't annoying consequences).

These options are distro-specific but it's ok to provide the debian ones and let distros handle the differences. On the other hand this uses third-party tools which shouldn't be necessary since grub in bzr trunk already has LUKS support. Could you use our own grub-probe as base? Also we should supply the LUKS UUID and not underlying device since it's subject to change.

Quoted 9 lines

Regards,
Alex

_______________________________________________
Bug-grub mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-grub

Signature · 2 lines
Regards
Vladimir 'φ-coder/phcoder' Serbinenko
#3 lore raw
In reply to a message not in the archive

Please keep the list CC'ed.

Quoted 2 lines · devkral

sorry, I don't understand the uuid-LUKS logic of grub-probe and dmsetup doesn't support this check.

dmsetup info /dev/mapper/mycrypt gives:
...
UUID: CRYPT-LUKS1-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-mycrypt_unformatted And with grub-probe -t cryptodisk_uuid /mnt/crypt
you have:
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Where xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx is the unique UUID which is also used in /dev/disk/by-uuid/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx, just formatted differently.
The patch as is unnecessarily uses a heavily different codepath than non-crypt ones. From maintainance point of view this is unacceptable.

Signature · 2 lines
Regards
Vladimir 'φ-coder/phcoder' Serbinenko
#5 lore raw
In reply to a message not in the archive

Keep the list CC'ed. It's not difficult

Quoted 19 lines · devkral

Am Donnerstag, den 21.07.2011, 21:51 +0200 schrieb Vladimir 'φ-coder/phcoder' Serbinenko:

Quoted 4 lines

Please keep the list CC'ed.

Quoted 2 lines · devkral

sorry, I don't understand the uuid-LUKS logic of grub-probe and dmsetup doesn't support this check.

Quoted 12 lines

dmsetup info /dev/mapper/mycrypt gives:
...
UUID: CRYPT-LUKS1-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-mycrypt_unformatted And with grub-probe -t cryptodisk_uuid /mnt/crypt
you have:
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Where xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx is the unique UUID which is also used in /dev/disk/by-uuid/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx, just formatted differently.
The patch as is unnecessarily uses a heavily different codepath than non-crypt ones. From maintainance point of view this is unacceptable.

thx, here the new patch. Sorry for the delay.

Signature · 2 lines
Regards
Vladimir 'φ-coder/phcoder' Serbinenko
#7 lore raw
In reply to a message not in the archive
Quoted 3 lines · devkral

Am Donnerstag, den 21.07.2011, 21:51 +0200 schrieb Vladimir 'φ-coder/phcoder' Serbinenko:

Quoted 1 line

Please keep the list CC'ed.

Keep the list CC'ed. Idon't accept patches sent privately

Quoted 17 lines
Quoted 15 lines · devkral
Quoted 2 lines

sorry, I don't understand the uuid-LUKS logic of grub-probe and dmsetup doesn't support this check.

dmsetup info /dev/mapper/mycrypt gives:
...
UUID: CRYPT-LUKS1-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-mycrypt_unformatted And with grub-probe -t cryptodisk_uuid /mnt/crypt
you have:
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Where xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx is the unique UUID which is also used in /dev/disk/by-uuid/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx, just formatted differently.
The patch as is unnecessarily uses a heavily different codepath than non-crypt ones. From maintainance point of view this is unacceptable.

I have had a logical mistake in my patch (the ':' doesn't vanish like dmsetup … -c -o vg_name). Here the corrected version of my patch.

Signature · 2 lines
Regards
Vladimir 'φ-coder/phcoder' Serbinenko
#8 lore raw
In reply to a message not in the archive
Quoted 7 lines · devkral

Hello,
the scripts to generate a grub.cfg file doesn't find lvm under encrypted partitions (arch).
Debian has fixed this problem elsewise but it would be nice to have a clean way detecting such partitions.
I attach a patch to do so with an alternative /etc/grub.d/10_linux file (cryptgrub2.patch).

Could you update it to use grub-probe as it now has LUKS support?

Quoted 14 lines

Cryptswapgrub2.patch includes also a fix
for hibernation support with encrypted swap-partitions (it includes
every swap device in fstab invoked by the "resume=" command in the kernel argument list, so I'm not sure if this hasn't annoying consequences).

Regards,
Alex

_______________________________________________
Bug-grub mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-grub

Signature · 2 lines
Regards
Vladimir 'φ-coder/phcoder' Serbinenko