Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Problem with GRUB configuration for LUKS and LVM
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2  
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 44224
Location: 56N 3W

PostPosted: Sat Jun 10, 2017 2:13 pm    Post subject: Reply with quote

skysearcher,

You should be asked for your pass phrase before
Code:
Scanning for and activating Volume Groups
appears.
Until sb4-luks is unlocked, vg_gentoo2-lv_root cannot exist.
You actually need both LUKS unlocked to boot.

How did your make your initrd?
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
skysearcher
n00b
n00b


Joined: 27 May 2017
Posts: 19

PostPosted: Sat Jun 10, 2017 4:34 pm    Post subject: Reply with quote

NeddySeagoon wrote:
skysearcher,

You should be asked for your pass phrase before
Code:
Scanning for and activating Volume Groups
appears.
Until sb4-luks is unlocked, vg_gentoo2-lv_root cannot exist.
You actually need both LUKS unlocked to boot.

How did your make your initrd?

I did my inird with genkernel.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 44224
Location: 56N 3W

PostPosted: Sat Jun 10, 2017 5:08 pm    Post subject: Reply with quote

skysearcher,

Can you unlock your LUKS volumes by hand in the initrd shell?

Your initrd is a cpio archive of cpio archives. Unpick it somewhere safe and pastebin its init script.
It will either be /sbin/init (in the initrd) or /init (in the initrd)

Either the LUKS bit is missing or its in the wrong place.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
skysearcher
n00b
n00b


Joined: 27 May 2017
Posts: 19

PostPosted: Sun Jun 11, 2017 9:56 am    Post subject: Reply with quote

NeddySeagoon wrote:
skysearcher,

Can you unlock your LUKS volumes by hand in the initrd shell?

Your initrd is a cpio archive of cpio archives. Unpick it somewhere safe and pastebin its init script.
It will either be /sbin/init (in the initrd) or /init (in the initrd)

Either the LUKS bit is missing or its in the wrong place.

I´am sorry but I´am afraid I need a little bit help with that.

I can open my LUKS volumes by hand in the initrd shell. I boot let it failed and then opened my LUKS volumes. Then I did: ls /sbin/init and got: /sbin/init. I also tried ls /init and got: /init. Then I ran cat /init and got an output which seemed to be the correct one. But the problem was I couldn´t mount an external device (usb,disk). Then I tried the same from my Install media and copied this file to my usb-stick. I tried to unpack this file on my other PC but it didn´t recognise the file system and I got always this output:
Code:
file init:
init: ERROR: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2error reading (Invalid argument).

Then I tried to gzip the file, unapack it with gunzip and then tried to unpack the archiv with cpio -i < init and got also an error message:
Code:
cpio: Malformed number `
cpio: Malformed number 
cpio: Malformed number
cpio: Malformed number
cpio: Malformed number
cpio: Malformed number
cpio: Malformed number 
cpio: Malformed number 
cpio: Malformed number (
cpio: Malformed number
cpio: Malformed number `
cpio: verfrühtes Ende des Archivs


Is this the correct file or should I use my initrd file in my boot partition.

I´am very sorry for the inconvenience.
Back to top
View user's profile Send private message
szatox
Veteran
Veteran


Joined: 27 Aug 2013
Posts: 1778

PostPosted: Sun Jun 11, 2017 10:28 am    Post subject: Reply with quote

Quote:
file init:
init: ERROR: ELF 64-bit LSB executable, x86-64,
This message means it's a compiled executable, not a script. Did you actually get it from within initramfs? Or was it the init stored in your root filesystem?
Also, `ls` alone is not very useful. Go with `ls -lh` instead for a detailed view (with (-h)uman-friendly units). It will resolve symbolic links for you. The file you got could be e.g. busybox. Genkernel's init is a bash script, so you definitely didn't get the file you want.

A hint on extracting initramfs:
Create a new directory, enter it and then run command
`gzip -d < /path/to/initramfs.gz | cpio -i`
Replace gzip with whatever compression you use there, xz and bzip2 are not uncommon.
There is no need to mangle over and over again. The directory structure you get from this is exactly what you have available during early boot - before you switch to disk.
Back to top
View user's profile Send private message
skysearcher
n00b
n00b


Joined: 27 May 2017
Posts: 19

PostPosted: Sun Jun 11, 2017 1:07 pm    Post subject: Reply with quote

NeddySeagoon wrote:
skysearcher,

Can you unlock your LUKS volumes by hand in the initrd shell?

Your initrd is a cpio archive of cpio archives. Unpick it somewhere safe and pastebin its init script.
It will either be /sbin/init (in the initrd) or /init (in the initrd)

Either the LUKS bit is missing or its in the wrong place.

I hope I safed the right init now. I boot the Install media, mounted boot and copied the initramfs to my other PC and extracted the file in a new directory as szatox described (thanks a lot!). Then I got an init file. I safed this file on this site:
https://fr32k.de/schnipsel/?881216d6f956d359#IsnjuQY6+R/24VnWgJtEXAF4sOEK6HI23XNDZP64fqg=
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 44224
Location: 56N 3W

PostPosted: Mon Jun 12, 2017 8:47 am    Post subject: Reply with quote

skysearcher,

That's the right file.

I was expecting to find a call to luksopen to decrypt your lvm container to be able to find the root filesystem.
Its not there.
There are calls to luksopen but only in the context of resuming.

Is luksopen in your initrd?
If not, it might be the case that you missed luks support when you made the initrd.

What you want to do can be made to work but I'm begining to suspect that you will need to create your own initrd.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
skysearcher
n00b
n00b


Joined: 27 May 2017
Posts: 19

PostPosted: Mon Jun 12, 2017 12:14 pm    Post subject: Reply with quote

NeddySeagoon wrote:
skysearcher,

That's the right file.

I was expecting to find a call to luksopen to decrypt your lvm container to be able to find the root filesystem.
Its not there.
There are calls to luksopen but only in the context of resuming.

Is luksopen in your initrd?
If not, it might be the case that you missed luks support when you made the initrd.

What you want to do can be made to work but I'm begining to suspect that you will need to create your own initrd.

LuksOpen should be in my initrd. I created my initrd with Luks support.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 44224
Location: 56N 3W

PostPosted: Mon Jun 12, 2017 2:06 pm    Post subject: Reply with quote

skysearcher,

You unpacked your initrd to extract the init script. Is luksopen there?
There is nothing in the in the init scrip that calls it.

You boot process goes ...
Something, usually grub2 loads the kernel and initrd into memory and leaves the kernel command line where the kernel can find it.
The boot loader jumps to the kernel start address.
The kernel decompresses itself and initialises all the build in things. It then mounts the initrd as its root filesystem and begins executing the init script.
The init script is in charge of what happens next.
Sometime before it mounts your root, it needs to run luksopen on the encrypted space, then start lvm so that your logical volumes became visible.

The init script does not call luksopen.

You can try rebuilding the initrd with genkernel or with dracut. I've never used either.
You can make your own initrd. That's not as hard as it sounds provided the kernel is configured to not need any modules from the initrd.
That allows the kernel to be updated without making a new initrd.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
skysearcher
n00b
n00b


Joined: 27 May 2017
Posts: 19

PostPosted: Mon Jun 19, 2017 3:37 pm    Post subject: Reply with quote

NeddySeagoon wrote:
skysearcher,

You unpacked your initrd to extract the init script. Is luksopen there?
There is nothing in the in the init scrip that calls it.

You boot process goes ...
Something, usually grub2 loads the kernel and initrd into memory and leaves the kernel command line where the kernel can find it.
The boot loader jumps to the kernel start address.
The kernel decompresses itself and initialises all the build in things. It then mounts the initrd as its root filesystem and begins executing the init script.
The init script is in charge of what happens next.
Sometime before it mounts your root, it needs to run luksopen on the encrypted space, then start lvm so that your logical volumes became visible.

The init script does not call luksopen.

You can try rebuilding the initrd with genkernel or with dracut. I've never used either.
You can make your own initrd. That's not as hard as it sounds provided the kernel is configured to not need any modules from the initrd.
That allows the kernel to be updated without making a new initrd.


I´am afraid that I need some help with my initrd.
I created an initrd but I think it´s not correct and there are some mistakes (it´s the first time I do this). I also configured my Kernel manually and I built the initrd into the kernel.
That is my actual initrd:
https://fr32k.de/schnipsel/?92da09f629d9f8a0#MTs/qYE0rrcuA2f6TwJ1vQYracMnSQPGaAE+fpuKl5c=[/quote]
Back to top
View user's profile Send private message
frostschutz
Advocate
Advocate


Joined: 22 Feb 2005
Posts: 2971
Location: Germany

PostPosted: Mon Jun 19, 2017 3:51 pm    Post subject: Reply with quote

:? :? :?

It seems you copy-pasted my example that does something completely different from what you need (process multiple RAID and LUKS containers in parallel). You don't want the wait # for mdadm, nor the for loop.

Maybe a simpler example should be added to that page. But the purpose of the Custom Initramfs wiki article is to teach people how to build their own scripts, not just copy-paste one without any real understanding. It certainly targets users with some shell scripting experience.

Otherwise you'd be better off with one of the initramfs generators (genkernel, dracut, etc.)
Back to top
View user's profile Send private message
skysearcher
n00b
n00b


Joined: 27 May 2017
Posts: 19

PostPosted: Mon Jul 03, 2017 8:08 am    Post subject: Reply with quote

frostschutz wrote:
:? :? :?

It seems you copy-pasted my example that does something completely different from what you need (process multiple RAID and LUKS containers in parallel). You don't want the wait # for mdadm, nor the for loop.

Maybe a simpler example should be added to that page. But the purpose of the Custom Initramfs wiki article is to teach people how to build their own scripts, not just copy-paste one without any real understanding. It certainly targets users with some shell scripting experience.

Otherwise you'd be better off with one of the initramfs generators (genkernel, dracut, etc.)

I generated my initramfs now with dracut and I think it should be correct. But know I get again an error message. I posted the output of the error message on this site:https://framapic.org/CXmUdP8uoA7e/TmQPvwIcjpnv.jpeg. I solved some other error messages but then I get always another error message :cry:

I´am very sorry for the inconvenience :oops: .

Furthermore I`d like to thank everyone for the awesome help I did receive! :D
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum