Hello,
I cannot install grub to my ESP it seems. I have a PC with both Windows 8.1 and Debian installed and I can only boot into Windows since GRUB is not installed on my PC.
I am using a Ubuntu Live USB to install GRUB on /dev/sda1 (my ESP).
I am using the following commands from Ubuntu Live USB-:
sudo mount /dev/sda7 /mnt
sudo mount --bind /dev /mnt/dev
sudo mount --bind /dev/pts /mnt/dev/pts
sudo mount --bind /proc /mnt/proc
sudo mount --bind /sys /mnt/sys
sudo chroot /mnt /bin/bash
After this I am executing-:
grub-install /dev/sda1
After executing that I am getting the following output-:
root@ubuntu:/# grub-install /dev/sda1
Unrecognized option `/dev/sda1'
Usage: grub-install [OPTION]
Install GRUB on your EFI partition.
-h, --help print this message and exit
-v, --version print the version information and exit
--modules=MODULES pre-load specified modules MODULES
--root-directory=DIR install GRUB images under the directory DIR
instead of the root directory
--grub-mkimage=FILE use FILE as grub-mkimage
--grub-mkdevicemap=FILE use FILE as grub-mkdevicemap
--grub-probe=FILE use FILE as grub-probe
--no-floppy do not probe any floppy drive
--recheck probe a device map even if it already exists
grub-install copies GRUB images into the DIR/boot directory specified by
--root-directory.
Report bugs to bug-grub@gnu.org.
Can anyone tell me what I am doing wrong ? Why is /dev/sda1 a unrecognized option ? I am at my wits end with this. Unless GRUB is installed I cannot use Debian I can only use Windows.
Do I do this before chrooting into my Debian system from my Ubuntu Live USB ? Or do I execute this after chrooting into my Debian system.
When I execute-:
$ sudo grub-install --root-partition=/mnt /dev/sda1 won't it install GRUB to /mnt and not my ESP ? Also won't it install the GRUB version found in Ubuntu, rather than the one found in Debian which is the one I am trying to install ?
---------- Post updated at 09:43 PM ---------- Previous update was at 09:21 PM ----------
I executed the following commands-:
sudo mount /dev/sda7 /mnt
sudo mount --bind /dev /mnt/dev
sudo mount --bind /dev/pts /mnt/dev/pts
sudo mount --bind /proc /mnt/proc
sudo mount --bind /sys /mnt/sys
sudo chroot /mnt /bin/bash
Then I executed-:
$ grub-install --root-directory=/mnt /dev/sda1
The got the following output for that-:
root@ubuntu:/# grub-install --root-directory=/mnt /dev/sda1
Unrecognized option `/dev/sda1'
Usage: grub-install [OPTION]
Install GRUB on your EFI partition.
-h, --help print this message and exit
-v, --version print the version information and exit
--modules=MODULES pre-load specified modules MODULES
--root-directory=DIR install GRUB images under the directory DIR
instead of the root directory
--grub-mkimage=FILE use FILE as grub-mkimage
--grub-mkdevicemap=FILE use FILE as grub-mkdevicemap
--grub-probe=FILE use FILE as grub-probe
--no-floppy do not probe any floppy drive
--recheck probe a device map even if it already exists
grub-install copies GRUB images into the DIR/boot directory specified by
--root-directory.
Report bugs to <bug-grub@gnu.org>.
When I ran the following command-:
grub-install --root-directory=/mnt
I got the following output-:
/mnt/boot/grub doesn't look like an EFI partition.
It seems its a problem with the Grub configuration.
Take another look at the link I posted in my post #3.
That guy had a EFI partition, like you. He installed Debian, like you.
He found that a bootloader was not installed, like you.
He was trying to dual boot Windows, like you.
He spent a lot of time but was good enough to publish his solution.
I have tried both the links that you have specified. The first link has one difference to my problem. The person there was converting a BIOS installation to UEFI but I am already in UEFI. Plus, the command line options for grub-efi-amd64 like --bootloader-id and --removable are no longer supported. If you want I can probably provide my man page to you.
The second link does not tell me how to make the grub bootable image. I need to know that since update-grub fails for me.