Today I tried to replace my Ubuntu install with Debian. I also have Kali installed. Before starting the installer, I thought it would be 'fun' to try

rm -rf /*

on my Ubuntu install. But I didn't unmount the efi partition and it got wiped out. It turns out the Debian installer has a bug and it failed to install Grub. I skipped the Grub installation and completed the rest of the steps. I chrooted to Debian and installed Grub2. But the command

grub-install /dev/sda

is acting weirdly. It says:

Installing for i386-pc platform.
grub-install: error: cannot find a GRUB drive for sda.  Check your device.map.

First, I have a 64 bit system and second, sda1 partition is set with flags boot and ESP. Anybody knows what is the problem here, and what is the solution?

Solution: For some reason apt-get install grub, installed grub-efi-ia32 along with it. Installing the package grub-efi-amd64 solved the problem.

  • 1
    When you chroot'd to the Debian install, did you make sure both /proc and /sys were mounted inside the chroot? – derobert Sep 24 '16 at 15:30
  • Yep, proc sys and dev – saga Sep 24 '16 at 16:53

If your current version of Debian have systemd-boot, I would recommend using that instead. It is much easier to use. Just follow the guide here.

I wouldn't bother with Grub when it comes to UEFI. The new systemd-boot (bootctl) is much easier and incorporated in systemd. I gave up on grub efi a long time ago. Also just ask any questions if you want to try my method.

| improve this answer | |
  • 1
    Please don't rely on external sites and describe the relevant content in your answer. – user147505 Sep 24 '16 at 15:23
  • 1
    Really? That is a lot of work when I don't even know if he wants to use bootctl or can. – Coding Guy Sep 24 '16 at 15:32
  • Yes, really. Why did you link to Arch's wiki? – user147505 Sep 24 '16 at 15:41
  • 1
    Because debians wiki don't have one and also I like Arch's wiki. It is also the one I used to learn how to fix debians issues with UEFI. – Coding Guy Sep 24 '16 at 15:46

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.