1

Prior to making some changes with GParted, I observe my disk in both GParted and the Ubuntu "Disks" utility. It appears I have only one partition marked with the boot flag in GParted (and having the bootable property "on" in the "Disks" utility view). Is that an indication that this partition is where GRUB is located?

Motivation: My disk/system had the following history: Windows 7 --> Wubi install of Ubuntu --> migration script for migrating from Wubi to regular Ubuntu installation, dual boot included. I would like to scratch my Windows partition and reuse it as a new data partition for Ubuntu, avoiding a non-bootable machine situation in the process.

1
  • 1
    Grub does not use Boot flag. Windows has to have a boot flag on the primary NTFS partition with its boot files. Some BIOS need to see a boot flag so we still suggest having one. If you now have a full partitioned install you should be able to just reformat the Windows NTFS patition(s). Often a 100MB boot and the main install. Best of course to have full backup as many remove Windows and then find one application that does not work and they need it back. And have a Live Ubuntu installer for the current version you have installed. Post this: sudo parted -l
    – oldfred
    Oct 24, 2014 at 0:39

1 Answer 1

1

No, some boot loaders like Windows' rely on the boot flag, because it simply passes control to the partition boot sector.

But Grub does not require this; it knows which partition contains additional grub modules and the config file and loads them based on that information rather than the presence or absence of a boot flag.

If you run the bootinfoscript it will tell you more information about your system, including where Grub loads it's files from. Usually Grub will locate this partition based on its UUID, so modifying other partitions doesn't affect booting. But if Grub is booting with the partition number, deleting or adding partitions may result in boot problems.

I would recommend having an Ubuntu bootable USB available so that you can reinstall Grub if required.

Q. How does the BIOS know it should run Grub?

For BIOS based (not EFI) computers, BIOS looks to the MBR (master boot record) to find the main bootloader and partition table. This is where Grub is installed (or the windows boot loader). The problem with this is that the space is very limited so the functionality of the bootloader is too. For Windows' bootloader that's okay because it does little more than pass on control, but Grub takes a different approach and loads up additional modules as required directly from it's /boot partition.

If you look at the results of the bootinfoscript it tells you what is installed in the MBR as in:

============================= Boot Info Summary: ===============================

 => Windows is installed in the MBR of /dev/sda.

or

 => Grub2 (v1.99) is installed in the MBR of /dev/sda and looks at sector 1 of 
    the same hard drive for core.img. core.img is at this location and looks 
    for (,msdos5)/boot/grub on this drive.
2
  • So how does the BIOS know it should run Grub then, actually?
    – matanox
    Oct 24, 2014 at 18:06
  • @matt see edited answer
    – bcbc
    Oct 25, 2014 at 17:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .