0

I have installed Windows OS in UEFI and Ubuntu in Legacy.

After some time I got an error when I tried to boot in Ubuntu.

error: unknown filesystem. grub rescue> _
grub rescue>

I solved this issue - unknown filesystem, grub rescue

set root=(hd0,gpt7)
set prefix=(hd0,gpt7)/boot/grub
insmod normal
normal

But when I tried to reinstall Grub using

sudo grub-install /dev/sda

Error : -

grub-install: warning: this GPT partition label contains no BIOS Boot Partition; 
embedding won’t be possible.

After that I created a partition using

parted /dev/sda set 1 bios_grub on

and installed grub using

grub-install /dev/sda

And that's when the problem started. When I tried to boot into Windows in UEFI mode following error appears:

No boot device found press any key to reboot machine.

What should I do ?

  • If you really want to boot Ubuntu in BIOS mode, you need a separate 1 or 2MB unformatted partition with the bios_grub flag. Better to have Ubuntu in UEFI mode. If sda1 was your efi partition you then overwrote it with parts of grub and have to restore the FAT32 formatted partition with the boot flag and repair it with a Windows repair disk. This will not fix Windows issues but will show details. Post link to summary report: help.ubuntu.com/community/Boot-Repair – oldfred Mar 8 '15 at 16:15
0

You wrote:

After that I created a partition using parted /dev/sda set 1 bios_grub on

The command you specified did not create a partition; instead, it marked your existing first partition as a BIOS Boot Partition, which GRUB uses by writing part of itself directly to the partition, without using a filesystem. Thus, when you re-installed GRUB, you trashed your existing first partition! That partition was probably either your EFI System Partition (ESP), where your EFI boot loaders go, or perhaps some other Windows-specific boot partition.

There's a slim chance that you can overcome this problem by resetting the type code on your first partition and using dosfsck or some other filesystem-recovery tool on it; but you may need to re-create the partition's contents from scratch. This is possible, but tricky. I don't have a URL handy to a procedure, but try a Web search on terms like "fixing damaged EFI System Partition." The ESP is basically a FAT partition that holds EFI boot loaders, which are ordinary files, so the recovery procedure will involve laying down a fresh FAT filesystem and restoring the files by copying them from another source or using a Windows recovery tool.

As a meta-comment, installing Linux in BIOS/CSM/legacy mode to a computer that already has Windows running in EFI/UEFI mode is doing things the hard way, at best. It's much better to install both OSes in the same mode, as described in this page I wrote. If you hadn't trashed your ESP, it would be relatively simple to add an EFI boot loader for Linux to the ESP to work around your initial problem, but now you've got to restore your Windows boot loader, and possibly adjust your boot loader NVRAM entries.

Good luck!

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.