1

Recently I accidentally formatted boot partition (sda1,512MB) as fat32 on ubuntu 16.04 computer. I haven't turned off my computer yet so I can still use it.

I tried to use boot-repair tool to recover my boot partition but it failed. The error message is:

GPT detected. Please create a BIOS-Boot partition (>1MB, unformatted filesystem, bios_grub flag). This can be performed via tools such as Gparted. Then try again.

The BootInfo is here: https://paste2.org/WntgO8Xa

I tried to use the Gparted to format the sda1 as unformatted also setup the bios_grub flag. After I done that, the format of sda1 shown in the Gparted is unknow and I am still getting the same error from boot repair.

Anyone have idea how to fix that without reinstalling the whole system?

Jason Liu
  • 117
  • 2
    You only need the bios_grub partition if you want to boot in BIOS mode. Boot-Repair is suggesting that since you did not have the ESP - efi system partition, FAT32 with boot flag. You may be able to use testdisk or parted rescue to restore the partition. It may or may not still have your data, but once created you can use Advanced options in Boot-Repair to do a total reinstall of grub which should add the Ubuntu boot files. this was to restore a Linux partition but same process: http://askubuntu.com/questions/665445/upgraded-to-windows-10-on-dual-boot-and-cant-boot-to-ubuntu-partition/665462 – oldfred Aug 08 '17 at 22:02
  • Hello oldfred, I just tried the parted rescue to restore the partition as the reference you provided but after I ran it, it seems no different. What I guess is after I accidentally formatted it, I was trying to repair it and delete it for a couple times and now cannot be able to restore to the original. Here is the log: https://paste2.org/1gxaYnpA. I am not quite familiar with the FS and OS, I greatly appreciate your help. – Jason Liu Aug 09 '17 at 00:23
  • If you just have Ubuntu, then you can easily just reformat sda1 to FAT32 and give it the boot flag (if using parted or gparted) to make it an ESP. Then use Boot-Repair's advanced option to totally reinstall grub. Be sure to boot Ubuntu live installer in UEFI mode. The total reinstall of grub in UEFI mode will add new UEFI entries in the UEFI boot menu and restore /EFI/ubuntu folder & .efi boot files. Any old UEFI entries will be obsolete as they will refer to the old ESP & its GUIDs. – oldfred Aug 09 '17 at 03:37
  • I tried that way too but it doesn't work as it suppose to. I formatted it to FAT32 and boot flag, esp flag was enabled. When I am trying to reinstall the grub, the boot repair gives the same GPT error as I mention above. Do you mean I need to boot it with a u-drive then i can install the grub? – Jason Liu Aug 09 '17 at 17:51
  • If it wants a bios_grub partition then you have booted Ubuntu live installer in BIOS/Legacy/CSM boot mode. You must always boot in UEFI boot mode with UEFI systems (unless you did all installs in the 35 year old BIOS configuration which would not necessarily take full advantage of newer hardware.). – oldfred Aug 09 '17 at 19:52
  • I got my boot repaired successfully today. I really appreciate your help, thank you! Last question, my boot partition takes only 16.17 MiB, is that normal? – Jason Liu Aug 14 '17 at 16:37
  • When you say boot partition are you referring to the ESP - efi system partition which is normally small with only one install, or the Ubuntu's /boot partition which has most of grub & boot kernels. Generally desktop users should not need a separate partition for /boot unless using LVM and/or full drive encryption. – oldfred Aug 14 '17 at 20:45
  • Sorry for my bad question, I mean the first case you mentioned, it is the partition of /dev/sda1 with fat32 file system. You have answered my question, thanks again. – Jason Liu Aug 14 '17 at 21:36

0 Answers0