3

I found few threads that explain how to reinstall grub2 by the mean of chroot but none of them explain how to proceed if my / is encrypted and if there is a plain /boot partition. Thing is I installed Debian in EFI mode and it made an unbootable entry (Japanese character) in the UEFI boot menu.

I tried to make a new entry using efibootmgr from Ubuntu liveUSB but it is still unbootable. I'd like to reinstall grub from Ubuntu liveUSB but I don't know to chroot the encrypted / partition and how the separate /boot partition blends in.

1
  • Given your configuration, you might want to try my rEFInd boot manager, which tends to handle multi-distribution configurations better than GRUB. Try downloading the USB flash drive or CD-R version to see if it will boot both Debian and Ubuntu. (You may need to add extra boot options to identify your root filesystem by pressing F2 or Delete twice to boot Ubuntu.) If it works, you can install the PPA from Ubuntu or the Debian package in either Debian or Ubuntu. – Rod Smith Jan 10 '16 at 15:16
2
  1. Boot from an Ubuntu Live USB with a working internet connection.

  2. Open a Terminal window (ApplicationsAccessoriesTerminal).

  3. Type the following commands (pay attention to the comments, starting with #, after some commands):

    sudo -i
    apt-get update
    apt-get install cryptsetup lvm2
    fdisk -l
    cryptsetup luksOpen /dev/sda? TAG           # sda? is your root partition
    vgchange -ay
    vgscan
    vgchange -ay [VOLUME GROUP NAME]           # From the above command
    lvscan
    mount /dev/[VOLUME GROUP NAME]/[LOGICAL VOLUME NAME] /mnt          # LOGICAL VOLUME NAME from above command
    modprobe efivars
    mount /dev/sda? /mnt/boot/efi          # sda? is your efi partition
    mount --bind /dev /mnt/dev 
    mount --bind /dev/pts /mnt/dev/pts
    mount --bind /proc /mnt/proc
    mount --bind /sys /mnt/sys
    cp /etc/resolv.conf /mnt/etc/
    chroot /mnt
    

    then do

    apt-get install --reinstall grub-efi-amd64
    

    or

    apt-get install --reinstall grub-efi
    

    and continue with

    update-grub
    umount /mnt
    vgchange -an
    cryptsetup luksClose TAG
    
1
  • One should also check out (askubuntu.com/a/831241/321153). I used a combined version of this and the one under link to fix my ubuntu 18.04. – Max Mar 18 '20 at 22:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.