Automatic Boot Disk redirector?

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
 
A

Arno

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
 
Y

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
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
 
P

Paul

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
 
R

R. C. White

Hi, Yousuf.
I have already tried removing the active property from any partitions that
had active set in them
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
--
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


"Yousuf Khan" wrote in message
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
 
R

Rod Speed

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

Rod Speed

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.
 
A

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
That is something else.

Arno
 
A

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
 
Y

Yousuf Khan

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
 
Y

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
 
P

Paul

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
 
R

R. C. White

Hi, Yousuf.
Well, as I said, I removed all of the partitions previously marked as
"active", and it made no difference.
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.
Windows' Disk Management can turn a partition active, but it cannot turn
it "inactive"
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.
you have go to an arcane commmand-line based tool called Diskpart to do
that.
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.)

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


"Yousuf Khan" wrote in message
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
 
R

Rod Speed

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.
 
P

Paul

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
 
A

Arno

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
 
P

Paul

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
 
R

R. C. White

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
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
 
A

Arno

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"
 
Y

Yousuf Khan

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top