Difference between bootable and non-bootable partitions

5,072

Solution 1

Though it was down voted ... possibly because someone thought it was not answering the question ... I think @Rony's answer is a good start at explaining what the boot flag is about. (I was actually planning to begin my answer with an example similar to the one he provided.)

I was all set to ramble off an answer about how the boot flag is, at this point in time, an often ignored (as @Rony's example shows) historical remnant from a period when hard drives were smaller and bootloaders were much less sophisticated.

But then I discovered this had already been said in this answer to this question: What is the "Bootable flag" option when installing a distro?

What's more there was also a link to a short article about the Boot flag which says

  • "Its primary function is to indicate to a MS-DOS/MS Windows-type boot loader which partition to boot. In some cases it is used by Windows XP/2000 to assign the active partition the letter "C:"."

Well, this is embarrassing ...

When I claimed that the boot flag was a "historical remnant" I was assuming this was the case because clearly GRUB had no need to use it. Surely Microsoft would also have "moved on".

The well known quote usually attributed to Oscar Wilde turned out to be too true in this instance.

It appears that the MBR and PBR (Partition Boot Record) loaders used by the Windows operating systems DO expect the boot flag to be set correctly.

To test this I cleared the boot flag from all the partitions of a Windows 8 VM. (See below. If you're curious, here's a link to the pastebin of the complete BootInfo Script result)

Drive: sda     
Disk /dev/sda: 26.8 GB, 26843545600 bytes
255 heads, 63 sectors/track, 3263 cylinders, total 52428800 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes

Partition  Boot  Start Sector    End Sector  # of Sectors  Id System

/dev/sda1               2,048       718,847       716,800   7 NTFS / exFAT / HPFS
/dev/sda2             718,848    52,426,751    51,707,904   7 NTFS / exFAT / HPFS

When I cleared the flag from both partitions, I got the error message FATAL: INT18: BOOT FAILURE when I attempted to boot. (I am not sure if that is from the Windows MBR bootloader or the VM's equivalent of a BIOS.)

Just to see what would happen, I also set the boot flag on the "wrong" partition, /dev/sda2 instead of /dev/sda1. Doing that resulted in the window shown in the image below.

Windows failed to start error window

<sigh/>

This experience makes me wonder if Microsoft is still using the same MBR boot sector loader which they used for MS-DOS and Windows 3.0/3.1?

Solution 2

I know that a user cannot boot a system from a partition marked non-bootable and can from one marked bootable.

From laptop harddisk

# fdisk  -l /dev/sda

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x47b94fbe

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1            2048     1999999      998976   83  Linux
/dev/sda2         2000000     9999999     4000000   82  Linux swap / Solaris
/dev/sda3        10000000    89999999    40000000   83  Linux
/dev/sda4        90000000   976773167   443386584   83  Linux

From bootable USB Linux

# fdisk  -l /dev/sdb

Disk /dev/sdb: 8004 MB, 8004304896 bytes
247 heads, 62 sectors/track, 1020 cylinders, total 15633408 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000a5395

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1            2048     2097151     1047552   83  Linux
/dev/sdb2         2097152    15632383     6767616   83  Linux

They do not have a single bootable partition, while they are all bootable.

Solution 3

Just a flag in the table of partitions. The MBR search the flag in the partitions and run from the partition with the "boot" flag.

Share:
5,072

Related videos on Youtube

Sam
Author by

Sam

A Blogger

Updated on September 18, 2022

Comments

  • Sam
    Sam almost 2 years

    What is the difference between a bootable and non-bootable partition? I know that a user cannot boot a system from a partition marked non-bootable and can from one marked bootable.

    I want to know about the underlying differences between these partition flags.

    • Admin
      Admin about 12 years
      May be knowing what is linux boot process might help you. ibm.com/developerworks/linux/library/l-linuxboot
    • irrational John
      irrational John about 12 years
      @anon_anon Uh, that article, while no doubt a good one, is a bit old. It's from 2006 and discusses GRUB Legacy. I think things have change a bit with GRUB 2. (If nothing else, they use different names for the boot "stages" in GRUB 2 :). I tried to locate a DeveloperWorks update of the article you linked for GRUB 2, but did not. Closest I could come was this: Migrate to GRUB 2.
    • irrational John
      irrational John about 12 years
      @Rony Ooops. Updated my answer.
    • Gilles 'SO- stop being evil'
      Gilles 'SO- stop being evil' about 12 years
  • Sam Hobbs
    Sam Hobbs over 2 years
    Young people attribute the original IBM PC disk layout, such as the MBR, to Microsoft. They were called IBM PC because IBM designed them. The original IBM PC was designed to (and did) allow other OSs, such as Unix. The boot flag was/is an IBM thing, not Microsoft. The boot flag is processed in the BIOS.