Automatic Boot Disk redirector?

  • Thread starter Thread starter Yousuf Khan
  • Start date Start date
Y

Yousuf Khan

Whenever an external drive is plugged into my PC, the BIOS gets all
confused and it rearranges the boot order of the drives. You then have
to go into the BIOS setup and rearrange them back, which is a temporary
solution until you don't connect external drive and you have to do it
all over again. Or use the BIOS's boot device chooser which is even more
temporary.

What I'd like to know is if there is some kind of automatic boot sector
manager that can be put onto non-boot disks and redirect the boot
towards the right disk?

Yousuf Khan
 
In comp.sys.ibm.pc.hardware.storage Yousuf Khan said:
Whenever an external drive is plugged into my PC, the BIOS gets all
confused and it rearranges the boot order of the drives. You then have
to go into the BIOS setup and rearrange them back, which is a temporary
solution until you don't connect external drive and you have to do it
all over again. Or use the BIOS's boot device chooser which is even more
temporary.
What I'd like to know is if there is some kind of automatic boot sector
manager that can be put onto non-boot disks and redirect the boot
towards the right disk?
Yousuf Khan

In theory, a bootable disk has a boot-signature in the
boot-sector, while a non-bootable disk does not have it and
should be skipped. As soon as the boot-secotr is loaded into
RAM and executed, it is actually too late as the BIOS has
relinquished control to it permenently at this time.

A PC bios expexts 0x55 0xAA in the last two bytes of the
first sector of a device in order to consider it bootable.
Maybe just overwriting these two bytes with 0x00 0x00 would
do the trick, but maybe it could confuse other software.
It should be easily reversible though in case of problems.

Arno
 
In theory, a bootable disk has a boot-signature in the
boot-sector, while a non-bootable disk does not have it and
should be skipped. As soon as the boot-secotr is loaded into
RAM and executed, it is actually too late as the BIOS has
relinquished control to it permenently at this time.

A PC bios expexts 0x55 0xAA in the last two bytes of the
first sector of a device in order to consider it bootable.
Maybe just overwriting these two bytes with 0x00 0x00 would
do the trick, but maybe it could confuse other software.
It should be easily reversible though in case of problems.

Arno

Does this have anything to do with "active" and "non-active" partitions?
Because I have already tried removing the active property from any
partitions that had active set in them. It didn't do anything though.

Yousuf Khan
 
Yousuf said:
Whenever an external drive is plugged into my PC, the BIOS gets all
confused and it rearranges the boot order of the drives. You then have
to go into the BIOS setup and rearrange them back, which is a temporary
solution until you don't connect external drive and you have to do it
all over again. Or use the BIOS's boot device chooser which is even more
temporary.

What I'd like to know is if there is some kind of automatic boot sector
manager that can be put onto non-boot disks and redirect the boot
towards the right disk?

Yousuf Khan

Does your PC have a popup boot menu ?

On my Asus motherboard, you press F8 early in POST. On the Asrock, it's F11.
There will be a list of drives presented, and you select the one you want.
The selection is temporary, and if on the next boot you don't press any
key, the preference in the BIOS is applied. The popup boot menu selection
is not recorded. The mechanism avoids the need to enter the BIOS and make
changes and save them.

That can function as a workaround, when the BIOS messes things up
when new disks are added.

Paul
 
Yousuf Khan wrote
Arno wrote
Does this have anything to do with "active" and "non-active" partitions?

Nope, thats a different issue entirely.
Because I have already tried removing the active property from any partitions that had active set in them. It didn't
do anything though.

Yeah, most bios just ignore that now when deciding what is bootable.
 
R. C. White wrote
Hi, Yousuf wrote
This may be a big part of your problem.

Unlikely given that changing that made no difference.
In order to boot from a disk, it must have exactly ONE "active" partition.

Hasnt been like that for a LONG time now.
To be marked active ("bootable"), that must be a primary partition, not a logical drive in an extended partition.

But there are plenty of boot managers that can boot those too.
 
Does this have anything to do with "active" and "non-active" partitions?
Because I have already tried removing the active property from any
partitions that had active set in them. It didn't do anything though.
Yousuf Khan

That is something else.

Arno
 
In comp.sys.ibm.pc.hardware.storage R. C. White said:
Hi, Yousuf.
This may be a big part of your problem. In order to boot from a disk, it
must have exactly ONE "active" partition. To be marked active ("bootable"),
that must be a primary partition, not a logical drive in an extended
partition.

No. In order to boot old Windows versions it has to be like that.
But as the BIOS does not undertsnd partitions, it does not understand
whether a partition is active or not.

Arno
 
Hi, Yousuf.


This may be a big part of your problem. In order to boot from a disk, it
must have exactly ONE "active" partition. To be marked active
("bootable"), that must be a primary partition, not a logical drive in
an extended partition.

RC

Well, as I said, I removed all of the partitions previously marked as
"active", and it made no difference.

It was a royal pain to do it too, because although Windows' Disk
Management can turn a partition active, but it cannot turn it
"inactive": what was Microsoft thinking, it costs too much to put the
reverse command in? Instead, I discovered that you have go to an arcane
commmand-line based tool called Diskpart to do that. The tool itself is
not so bad, I figured it out quite quickly, it was just a pain to search
through Google to find this command in the first place.

Yousuf Khan
 
Does your PC have a popup boot menu ?

On my Asus motherboard, you press F8 early in POST. On the Asrock, it's
F11.
There will be a list of drives presented, and you select the one you want.
The selection is temporary, and if on the next boot you don't press any
key, the preference in the BIOS is applied. The popup boot menu selection
is not recorded. The mechanism avoids the need to enter the BIOS and make
changes and save them.

That can function as a workaround, when the BIOS messes things up
when new disks are added.

Yes it does have the boot menu, as I mentioned in a different way when I
talked about the "BIOS's boot device chooser". It's okay for somebody
like me to use a boot device menu, but it's more difficult for other
users of this computer.

Yousuf Khan
 
Yousuf said:
Well, as I said, I removed all of the partitions previously marked as
"active", and it made no difference.

It was a royal pain to do it too, because although Windows' Disk
Management can turn a partition active, but it cannot turn it
"inactive": what was Microsoft thinking, it costs too much to put the
reverse command in? Instead, I discovered that you have go to an arcane
commmand-line based tool called Diskpart to do that. The tool itself is
not so bad, I figured it out quite quickly, it was just a pain to search
through Google to find this command in the first place.

Yousuf Khan

Do you have a copy of PTEDIT32.exe ?

Give that a try and you should be able to see the 0x80 boot flag with that.

ftp://ftp.symantec.com/public/english_us_canada/tools/pq/utilities/PTEDIT32.zip

You can edit the primary partition table, and do things to boot flag if you want.

Paul
 
Yousuf Khan wrote
R. C. White wrote
Well, as I said, I removed all of the partitions previously marked as
"active", and it made no difference.
It was a royal pain to do it too, because although Windows' Disk
Management can turn a partition active, but it cannot turn it
"inactive": what was Microsoft thinking, it costs too much to put the
reverse command in?

Nope, they just realise that if only one can be active, it makes more
sense to automatically mark just one active when the user specifys which one to make active.
Instead, I discovered that you have go to an arcane commmand-line based tool called Diskpart to do that. The tool
itself is not so bad, I figured it out quite quickly, it was just a pain to search through Google to find this command
in the first place.

Hardly the end of civilisation as we know it when modern systems
dont use the active flag for anything at all, as you discovered.
 
R. C. White said:
Hi, Yousuf.


Well, as I said, ONE partition on the boot device MUST be "active".
That's the partition that will act as the "System Partition" - and that
"System" label will appear in Disk Management's Status column for that
partition.

This is true in Windows perhaps, but there are other OSes out there.
The boot flag 0x80 is a "suggested serving". The MBR code can look at
it, or ignore it. Windows OSes happen to like it.

I didn't know about this, until one day I had an OS
disk with a Linux distro on it, and no boot flag. Unlike these guys,
I didn't even know there were install options for grub. Grub is a
big mystery to me, and having a grub and grub2 (two streams) doesn't help.

http://www.linuxquestions.org/questions/debian-26/what-is-this-bootable-flag-562885/

"If you installed grub to MBR, it will boot with or without bootflag"

Virtually every time I install a grub, I get a surprise. For example,
I thought grub stage 1.5 was stored in sectors below 63, and just two
days ago, found a virtually completely clean first 63 sectors, with
no hint of grub at all. Just too many variables, for me to keep track of.

Paul
 
This is true in Windows perhaps, but there are other OSes out there.
The boot flag 0x80 is a "suggested serving". The MBR code can look at
it, or ignore it. Windows OSes happen to like it.

Actually, Windows is stupid here. Any sane OS loader will be
flexible and just require a partition to be specified to it.
Windows relies on the hostoreic mechanism of the "active" flag.

Despite what some here have said, an arbitrary
number of partitions can be active at the same time. This
is not magic, just one byte in the partirion descriptor
that is 0x80 if active and 0x00 otherwise.
I didn't know about this, until one day I had an OS
disk with a Linux distro on it, and no boot flag. Unlike these guys,
I didn't even know there were install options for grub. Grub is a
big mystery to me, and having a grub and grub2 (two streams) doesn't help.

Grub-legacy is a finished product. Grub2 is a major redesign and
under development, but already usable. Chose either as to your needs.
"If you installed grub to MBR, it will boot with or without bootflag"
Virtually every time I install a grub, I get a surprise. For example,
I thought grub stage 1.5 was stored in sectors below 63, and just two
days ago, found a virtually completely clean first 63 sectors, with
no hint of grub at all.

Stage 1.5 is where you put it, i.e. typically in a file. The
difference is that stage 1 loads it by knowing its block
numbers on the device, while stage 1.5 does understand filesystems
and loads stage 2 via filesystem addressing. All in the documentation
here:

http://www.gnu.org/software/grub/manual/legacy/grub.html#Images
Just too many variables, for me to keep track of.

Then you better not mess with booting. Sorry, not everything is easy.

Arno
 
Arno said:
Then you better not mess with booting. Sorry, not everything is easy.

Arno

Everything is easy... if it is properly documented.

There was a time, when things *were* properly documented. But that time has passed.

Paul
 
Ah, that explains it. No problem.

Arno


In comp.sys.ibm.pc.hardware.storage R. C. White said:
Hi, Paul.
Yes, I probably should apologize to you and Rod and Arno - and Yousuf. I'm
guilty of being focused solely on Windows, especially Win7. I don't
normally read comp.sys.ibm.pc.hardware.storage and didn't notice before my
Replies that Yousuf had cross-posted his question to that NG, as well as to
alt.windows7.general, where I was reading it. If I had noticed, I would
have clarified that my remarks apply only to Windows. In my youth <g> I
experimented with other OSes, up until about OS/2, but haven't looked at
Linux, or at other systems since then.
Thanks for pointing out the differences in booting with non-Windows systems.
RC
--
R. C. White, CPA
San Marcos, TX
(e-mail address removed)
Microsoft Windows MVP (2002-2010)
Windows Live Mail 2011 (Build 15.4.3538.0513) in Win7 Ultimate x64 SP1

"Paul" wrote in message news:[email protected]...
This is true in Windows perhaps, but there are other OSes out there.
The boot flag 0x80 is a "suggested serving". The MBR code can look at
it, or ignore it. Windows OSes happen to like it.
I didn't know about this, until one day I had an OS
disk with a Linux distro on it, and no boot flag. Unlike these guys,
I didn't even know there were install options for grub. Grub is a
big mystery to me, and having a grub and grub2 (two streams) doesn't help.

"If you installed grub to MBR, it will boot with or without bootflag"
 
Hi, Yousuf.


Well, as I said, ONE partition on the boot device MUST be "active".
That's the partition that will act as the "System Partition" - and that
"System" label will appear in Disk Management's Status column for that
partition.

Well, obviously I left the one disk with an active partition alone, the
one that I actually intend to boot with.
Since there can be only ONE active partition on each disk, you can mark
Partition 2 inactive by simply making Partition 2 Active.

To make Partition 1 Inactive, right-click on Partition 2 and mark it
Active. Since Disk Management knows that there can be only one active
partition, it will automatically remove the Active mark from Partition
1. If you then make Partition 3 Active, both Partitions 1 and 2 will
become Inactive.

So, you automatically make Partition 1 INactive by making another
primary partition Active.

I see the problem here, you're not aware that my system has six internal
hard disks in it, as well as occasionally 3 external ones. When I said I
had multiple active partitions, I meant they were active over different
disks, not on the same disk.

This is why I asked the question in the first place, when external disks
are occasionally plugged in during boot, they mess up the hard disk
priority order in the BIOS. So a drive that is not my boot disk may be
listed ahead of my boot disk in the BIOS disk priority.
Yes, the DiskPart shell is very powerful - and arcane - so it must be
used with care. Disk Management is really just the "pretty face" GUI for
DiskPart. It does MOST of what DiskPart does and in a less-intimidating
way. (Earlier Windows had a Diskpart command in the Recovery Console,
but that was quite limited to just creating and deleting partitions.)

Yeah, I can remember using something similar to diskpart in the XP &
2000 command-line recovery console.

Yousuf Khan
 
Hi, Paul.

Yes, I probably should apologize to you and Rod and Arno - and Yousuf.
I'm guilty of being focused solely on Windows, especially Win7. I don't
normally read comp.sys.ibm.pc.hardware.storage and didn't notice before
my Replies that Yousuf had cross-posted his question to that NG, as well
as to alt.windows7.general, where I was reading it. If I had noticed, I
would have clarified that my remarks apply only to Windows. In my youth
<g> I experimented with other OSes, up until about OS/2, but haven't
looked at Linux, or at other systems since then.

Thanks for pointing out the differences in booting with non-Windows
systems.

Well, maybe I should've asked in a Linux group as well, since it is
installed and it gets affected as well. But the majority of my debugging
is being done under Windows, so I didn't want to confuse the issue.

I'm also using Grub (Legacy) as my boot loader on my boot disk, but that
really doesn't make a difference to this problem. Whether I'm using Grub
or Windows' own loader directly, they are both effectively bypassed when
the boot disk order gets messed up by the BIOS.

So getting back to the original problem, there is no boot disk
redirector utility that can effectively just tell the BIOS that "Hey,
I'm not the boot disk, go to the next disk"?

Yousuf Khan
 
This is weird. If physical disk zero (HDD-0 on my BIOS) is the first
boot device, then that's the one it should boot from. Maybe you haven't
plugged your boot drive into the disk-zero location. Both SATA and IDE
count the disk number from one end of the plug strip/bank to the other,
make sure you've connected the disks and the external plugs in the
correct sequence.

No, it's quite definitely disk #0 (first disk enumerated). But for some
reason my BIOS feels the need to give external disks higher priorities
whenever they are plugged in, until I manually reorder their priorities
in the BIOS setup.

Yousuf Khan
 
Back
Top