How to restore grub from a separate partition, to boot a luks partition?

2

My setup is:

sda1  /boot ext2
sda2  swap  swap
sda3  /     luks

I broke the boot partition. Now when trying to boot manually, cannot figure out how to load crypto modules needed to open the root partition.

I'm issuing theese commands from the grub shell:

root (hd0,0)
kernel gentoo-genkernel[...]
initrd initrams[...]
boot

I see another System.Map and found no way to tell grub about real_root and crypto stuff.

It starts to boot, but it's being dropped to a linux shell where I can issue cryptsetup luksOpen /dev/sda3 root, but neither here can load the required modules and got a "no key available with this passphrase" message.

Could I manage to load these modules and boot a luks partition that was working normally? It is fine to do it in grub shell or in the basic shell provided right afterwards.

user463527

Posted 2015-06-28T00:54:47.393

Reputation: 21

Answers

0

Sounds to me like you've locked the proverbial keys in the car. I don't know much about Linux, but I would get Ubuntu on a flash drive and start it up. From there, download a boot repair program so you can avoid the crypto problem altogether. https://help.ubuntu.com/community/Boot-Repair

SolidSnake859

Posted 2015-06-28T00:54:47.393

Reputation: 242