1 (edited by ronbaby 2014-01-15 11:08:39)

Topic: MBR Bootable flag bass-ackwards in Gparted?

The Gparted online documentation says that the bootable flag for a partition is "used by some commercial operating system boot loaders":

http://gparted.org/display-doc.php?name … tion-flags

While accurate, this is not the whole story.  I happen to own a motherboard (Gigabyte GA-M55Plus-S3G) whose BIOS is also sensitive to this flag on a partition.  It refuses, quite reasonably, I believe, to list a device in its Hard Disk Boot Priority list unless the drive (or USB stick) in question contains at least one MBR partition with the bootable flag set.  For this reason, the status of this flag, in various partitions, is of keen interest to me.

I am currently using GParted 0.16.1, as present within the Ultimate Boot CD 5.2.7 release.  I am aware that this is not 100% current, but it is close, and I do suspect that the behavior of 0.16.1 is probably indicative of the behavior of the current 0.17.0 release.

Today, I have been performing numerous tests, with Gparted, with my GA-M55Plus-S3G, and with various drives that I own.  The bottom line is that my findings are indicating to me, quite clearly, that if there is a check mark next to the "boot" flag, as displayed by Gparted, then all other indications are that the relevant partition is in fact not, I repeat, not actually marked as bootable, and conversely, that if Gparted displays the "boot" flag without a check mark next to it, then the relevant MBR partition is in fact marked as bootable.

I intend to report this formally as bug in GParted, however I felt it best to report this finding here first, in case anyone wishes to dispute my finding.  If anyone does, then I'll be more than happy to describe, at least, the tests I've done and the evidence I have gathered, all of which appears to me to be compelling.

P.S.  The most compelling evidence (but not to the only evidence) which supports my conclusion (i.e. that GParted is in fact displaying the negation of the actual bootable flag) is that GParted, when displaying these flags for a perfectly working, bootable hardrive with a full Windows7 install on it, is showing the Windows recovery partition with the bootable flag checked and is showing the actual Windows7 OS partition with the bootable flag not checked.  Additionally, the BIOS of my GA-M55Plus-S3G declines to list in its Boot Priority list a USB stick containing a single MBR partition that GParted shows with the "boot" flag checked, however if that flag is manually unchecked, using Gparted, and then the USB stick is inserted into the GA-M55Plus-S3G, then the BIOS does list the USB stick itself on its Boot Priority list.

It may perhaps be the case that both Windows 7 and my Gigabyte motherboard are getting things bass-ackwards, and that GParted is the only one telling the true story with respect to the status of this (bootable) flag, but that seems a bit unlikely.

2 (edited by ronbaby 2014-01-15 11:12:55)

Re: MBR Bootable flag bass-ackwards in Gparted?

I have done some more tests now, and it turns out that the truth is a bit more complex than my prior posting conveyed.

Everything I said in my prior posting is 100% true and correct, and I've now verified it all on multiple different machines with the exact same drive (containing an installed copy of Windows 7).  However I have now also used GParted to look at the various partition flags associated with the two partitions comprising the installed Windows 7 (i.e. recovery and actual OS partitions) on my old laptop, and in that case, quite surprisingly and unexpectedly, things look very different.  In that case, Gparted is showing partition flag settings that are what I would have expected, i.e. the actual OS partition does have the "boot" flag checked (in GParted) and the recovery partition has the boot flag unchecked (and has only the "diag" flag checked).

These flag setting are what one would reasonably expect, and in the case of the drive in my laptop, everything makes perfect sense.  However in the case of my desktop hard drive (which happens to be an nearly new 64GB SanDisk SSD, in case anyone is interested) the flags are being reported by GParted to have exactly the values I described in my prior posting, i.e. the Win7 main OS partition is reported as not having the bootable flag set while the 100 MB recovery partition does have that flag set (and no others).  Nonetheless, this drive does boot up with no problems at all when inserted (sATA) into my desktop system.

Based on these partition flag settings, as reported by GParted, I truly have no idea either (a) how the partition flags on my desktop hard drive came to be so... ummm... odd... I certainly never diddled them to make them like that... nor do I have the faintest idea (b) why the bloody hard drive boots up just fine, and with no problems at all, despite its (apparently goofy) partition flags.

That's all I have to say.  I am left with this profound mystery.

I do hereby withdraw my suggestion that perhaps GParted was incorrectly inverting the true value of the bootable flag, for partitions it is asked to report on.  Now, it seems to me that this possibility is entirely less likely, based on the findings I've gathered from my old laptop.  However it is still entirely enigmatic how my desktop hard drive can even be booted from... with these bizarre partition flags... and also there is still the matter of USB-attached drives and my Gigabyte GA-M55Plus-S3G motherboard.  The BIOS of that motherboard still refuses to even see a given USB-attached device as being bootable if the device in question has only one MBR partition and if that partition does have the bootable flag set, as reported by GParted.  It is however entirely happy to see the same device as bootable if the bootable flag in the MBR record for the USB device's one and only partition is un-set.

If anybody can explain any of this to me, please proceed.  I confess that it makes no sense to me, but I have checked and re-checked my findings and my results several times now, and I am highly confident of the accuracy of the facts I am reporting, inexplicable though some of them may be.

3

Re: MBR Bootable flag bass-ackwards in Gparted?

Thank you ronbaby for your interest in GParted.

I have read through your detailed posts and have a suggestion to try.  I do believe that GParted indicates the boot flag on the correct partition.  Having said, that we can checking with other partition tools.  Would you be able open a terminal window and provide the output from the following two commands?

sudo fdisk -l -u

where one of the options is a lower case "L" and not the number one.

sudo parted /path-to-your-device unit s print

where /path-to-your-device is something like /dev/sda.

Regarding the boot flag being on the recovery partition, it is entirely possible that a system set up in this way will provide a prompt to a user to invoke system recovery.  Then after a small time lapse with no input, then the computer will proceed to boot the operating system.  This might indeed be the case where you see the boot flag on the recovery partition and not on the Windows partition.

4

Re: MBR Bootable flag bass-ackwards in Gparted?

gedakc wrote:

Would you be able open a terminal window and provide the output from the following two commands?

sudo fdisk -l -u
sudo parted /path-to-your-device unit s print

where /path-to-your-device is something like /dev/sda.

I could do that, however you need to be more specific.  What devices, specifically, did you want me to have plugged into the system where I will be running these commands?  Did you want this info just for my sATA drive?  You know, the one where the partition flags appear to be goofy?  (I am guessing so, but on another mailing list where I have been discussing related issues, the partition flag setting on some USB sticks have also been a topic of discussion.)

Regarding the boot flag being on the recovery partition, it is entirely possible that a system set up in this way will provide a prompt to a user to invoke system recovery.  Then after a small time lapse with no input, then the computer will proceed to boot the operating system.  This might indeed be the case where you see the boot flag on the recovery partition and not on the Windows partition.

Yes, that kind of possibility had occurred to me, but my posts here were already rather verbose, so I didn't want to delve into any theories along these lines.

5

Re: MBR Bootable flag bass-ackwards in Gparted?

gedakc wrote:

Would you be able open a terminal window and provide the output from the following two commands?

sudo fdisk -l -u
sudo parted /path-to-your-device unit s print
Disk /dev/sda: 63.0 GB, 63021981184 bytes, 123089807 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 label type: dos
Disk identifier: 0x00055d91

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048      206847      102400    7  HPFS/NTFS/exFAT
/dev/sda2          206848    90671103    45232128    7  HPFS/NTFS/exFAT
Model: ATA SanDisk SDSSDP06 (scsi)
Disk /dev/sda: 123089807s
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 

Number  Start    End        Size       Type     File system  Flags
 1      2048s    206847s    204800s    primary  ntfs         boot
 2      206848s  90671103s  90464256s  primary  ntfs

6

Re: MBR Bootable flag bass-ackwards in Gparted?

Thank you for providing the output as requested.  From looking at the output it would appear that fdisk, parted, and gparted all agree on which partition contains the boot flag.

My conclusion from this is that GParted is correctly displaying the location of the boot flag, and that GParted does not have this backwards.

7

Re: MBR Bootable flag bass-ackwards in Gparted?

gedakc wrote:

Thank you for providing the output as requested.  From looking at the output it would appear that fdisk, parted, and gparted all agree on which partition contains the boot flag.

My conclusion from this is that GParted is correctly displaying the location of the boot flag, and that GParted does not have this backwards.

I do believe that I agree, however I confess that I am still utterly mystified at the fact that my copy of Windows7 Retail, installed onto a drive in my desktop system, has the recovery partition set as bootable (and the actual OS partition set as not bootable) whereas the installed (OEM) copy of Windows7 over on my trusty old (circa 2010) laptop has the exact opposite.  Yet both work and boot up just fine.

This is befuddling, to say the least.

8

Re: MBR Bootable flag bass-ackwards in Gparted?

One never knows how an OEM will choose to configure and install the OS, and what extra software packages they will add on top.