View Full Version : New dual boot setup
Earthling
April 25th, 2008, 12:42 PM
On advice from kOlo I have reorganised my boot setup so that XP and Vista each occupy a primary partition on the same SATA disk. (Formerly XP was on primary and Vista on an extended logical partition, and ATI 11 has not been able to successfully image and restore the Vista partition).
I have tested each OS using DD to hide the OS partition not in use, and everything is working correctly. I now want to install Grub4DOS as a boot manager but have run into a problem.
Trying to install Grub4DOS from Vista the install complains that the partition table is bad and will not offer the option to install to Whole Disk MBR. It is offering Whole Disk Other.
I have killed it and need some guidance as to the next step please.
K0LO
April 25th, 2008, 02:15 PM
Earthling:
Could you post a screen shot of sector 0 of the disk using DD10 with the view "as partition table" and another with the view "as hex"? I suspect that Grub4DOS may be looking for something specific that is present in an XP MBR. The Vista MBR is slightly different, and perhaps Grub4DOS just doesn't recognize it as valid.
Not to worry - Vista will boot fine from an XP MBR and vice-versa. But I wonder why it complains about the partition table?
For reference, here (http://www.wilderssecurity.com/showthread.php?t=201521) (post #7) is a comparison of the Vista and XP MBRs. Note that the partition tables are identical.
Earthling
April 25th, 2008, 03:32 PM
Here we go -
K0LO
April 25th, 2008, 03:57 PM
Hmm... That's not what I had expected to see. You've got me scratching my head here:
1. Is this the same disk as previously shown here (http://www.wilderssecurity.com/showpost.php?p=1227641&postcount=23)?
2. The disk ID is different and the BIOS geometry is different (you currently show a 240 head geometry while the older figure shows 255 heads). Normally this is determined by the BIOS, so is this the same computer?
3. I had expected to see two primary partitions from your description of what you did. Instead, the first partition is logical and the second is primary.
4. The MBR is not from XP or Vista, but rather from Grub4DOS.
I'm really confused.... is that really the right picture?
**Edit - Just noticed the title bar in the graphic. This is your Disk 2. Could you substitute the pictures from Disk 1? It would help on the hex view to resize horizontally so that each line showed 16 bytes (0000 - 000F, etc). Thanks.
Earthling
April 25th, 2008, 04:13 PM
Mark:
Really sorry about that. These pics are after retrying the procedure in XP, but the result was the same - Bad Partition Table - and I could not install Grub4DOS
K0LO
April 25th, 2008, 05:35 PM
Bernard:
OK; that looks better. It's a Vista MBR and the partition table looks OK to me. However, I'm not sure which consistency checks Grub4DOS is using to determine that there is a problem with the partition table.
For example, you have your partitions in this order [Primary 1] [Extended] [Primary 2], which I assume are [XP][logical drives][Vista]. The older partitioning rules used by Windows will not let you create a layout like this. After you have created your first logical partition you can then no longer create any primary partitions that follow the extended partition container. Ironically, Windows will run just fine this way, as you know because your system is working. Perhaps Grub4DOS is checking for this and sees that you do not have [Primary 1][Primary 2][Extended], which would conform to the DOS standards, and throws up its hands and says "something is fishy".
There is nothing wrong with your layout. Disk Director, Linux, and a lot of other partitioning tools can create layouts with mixed primary/logical partitions.
I can think of only two reasons for the Grub4DOS error. One, maybe it does not understand the rest of the Vista MBR. Or two, it's the order of primary/extended partitions.
What to do? Since we are unsure of the reason for Grub4DOS not wanting to install correctly we will have to guess. You can either:
1. Replace the Vista MBR with an XP MBR using fixmbr from a Windows XP disk, or
2. Re-order your partitions so that you have [XP] [Vista] [Logical drives]
Your choice. #2 is a little bit of work, but I think it's the most likely cause of the problem. Here is how I would do it. I am assuming that you successfully moved all of the Vista boot files into the Vista partition and have got the BCD working correctly so that Vista boots when its partition is active. If so, TI should now do fine for partition restorations.
A) Before backing up, generalize your Vista BCD to make Vista independent of location on the disk. This is done by changing the references in the BCD from "Partition = C:" to "Boot". The term "boot" refers to the partition that Vista just booted from, and thus is position independent. To do this, follow the steps in post #1 of this thread (http://www.wilderssecurity.com/showpost.php?p=1078316). Do this from Vista while it is working and before backing up. This step will make moving the Vista partition around almost hassle-free because you will no longer need to do a BCD repair when moving the partition.
B) Back up all of your partitions
C) Using DD, delete all of the partitions except for the XP partition
D) Create a new primary partition of the correct size for Vista, immediately to the right of the XP partition
E) Next create your logical partitions immediately following the Vista partition
F) Restore the Vista partition from your TI backup
G) Reboot and test Vista, making sure it is assigned the C drive letter.
G) Restore each logical partition from your backup
H) Reboot and check that drive letters are as-preferred in both operating systems.
Once you have this setup working, then try installing Grub4DOS again.
Earthling
April 25th, 2008, 05:56 PM
Mark:
The arrangement is a consequence of converting my Vista partition from logical to primary.
I understand what you are saying and will see it through, though it may be a day or two before I can.
Is there a reason not to install OSS in this situation rather than Grub4DOS? Not that I know anything about OSS, but it came free with DD of course.
K0LO
April 25th, 2008, 10:34 PM
Bernard:
No, you can use OSS, or BootItNG, GRUB, or any boot manager of your choosing. But before installing a boot manager, let's think this over and determine the optimum course of action so that you don't have to move things around again.
My favorite arrangement is to have a combination of the standard, generic Microsoft boot mechanism that is backed up by a boot manager. This type of arrangement is fail-safe. If the boot manager gets mangled then you can drop back to the old way of booting. Let me give an example from the arrangement on my laptop.
On the laptop I have Windows XP and Kubuntu plus an Acronis repair partition containing the bootable full and safe mode versions of DD and TI. I use GRUB as the boot manager.
Instead of installing GRUB to the MBR and letting it control everything, I kept the plain-vanilla Microsoft MBR; the one that simply searches the partition table for the Active partition and then boots it. So the disk is arranged like this: [Windows] [Extended partition]. The first two partitions are primaries and the rest are logicals and contain Linux, NTFS data, and Acronis.
The boot manager GRUB is installed to the partition boot record of the Boot partition, a small (100 MB) partition holding the boot manager and the Linux kernels. The partition table in the MBR has this partition set as active, so that when I boot the laptop, GRUB starts and its menu appears. Then I can choose which OS to start (Windows, Linux, Acronis).
If something were to go wrong with the boot manager or its files, I could boot from a recovery CD and simply set partition #2 as active. Then Windows would boot directly. I prefer this because there are multiple ways to recover in case something goes wrong.
I was thinking that a similar idea may work to your benefit. You could keep the Vista MBR that you currently have working and consider creating a small boot partition. You could put VistaPE in this partition, as well as whatever boot manager you decide to use. By making this the active partition, the boot manager would start when you boot the PC. From the boot manager menu you could choose XP, Vista, or VistaPE.
If you ever had a failure you could use DD to change the active partition to XP or Vista to boot them (and hide/unhide appropriately).
So before you rearrange your disk, think about whether this is something you might consider. If so let's plan it out first, then do the work.
I'm still trying to understand what Grub4DOS was objecting to, and if we can then it may not be necessary to shuffle partitions around. Just to prove that it is possible to boot with your disk as-is, here is an experiment that you can try. Let's use Grub4DOS on your Disk2 to boot XP as a test. On Disk 1, hide the Vista partition, unhide XP, and make the XP partition active. Then boot VistaPE from Disk 2. When the Grub4DOS menu appears, type a "c" to bring up a GRUB command prompt.
Since you booted from Disk 2, it will be (hd0) and your Disk 1 will be (hd1), so we will direct Grub4DOS to boot Windows XP on partition 1, so it will be (hd1,0). {Remember, GRUB numbers disks and partitions starting with 0}. Also, Windows must boot from Disk 1 so we will use the "map" command to fool it into thinking its running from disk 1.Type the following commands:
[B]root (hd1,0) #Grub should say "Filesystem type is NTFS, partition type 0x7"
find /ntldr #Grub should return the location as (hd1,0)
map (hd0) (hd1)
map (hd1) (hd0) #Fool Windows into thinking it's running from disk 1
chainloader /ntldr #Grub should say "Will boot NTLDR from drive=0x81, partition=0x0(hidden sectors=xxxxxxx)
boot #XP should bootThis will demonstrate that it is possible to control the boot process from Grub4DOS. If we were doing this on your primary disk then the map statements would not be needed and we would add commands to hide the Vista partition and unhide the XP partition, so everything would be automatic. All you would need to do is to choose the OS from the menu.
Let me know if this works, and think about how you would like to control your system before ripping into it and rearranging all of the partitions. It would be nice to avoid this, or at the least, to plan it so it only has to be done once. In the mean time, I'll do some more research on Grub4DOS to see what it is complaining about.
Earthling
April 26th, 2008, 03:29 AM
Mark:
I like the setup you are recommending and can see how it would work, though in some ways it's like asking for directions and being advised it's best not to start from here ;)
I do need to keep in mind why I have set off down this road, which is to be able to use ATI 'with confidence' as the authors say. Well, after the changes made so far it does look as if I may be able to do just that, as I can still boot to either OS, but both now image and restore with ATI without any of the problems I had previously.
OK, it's a bit of a palaver switching OS, but it's only about once month I need XP and even then it's usually only to Ghost my system partitions because ATI couldn't hack it, or to use one of the older bits of software I haven't yet got on Vista. Maybe I won't even bother with Ghost for much longer either.
I'm filing all this stuff away because one day, maybe with my next system, that's how I'll probably set it up.
BTW, I did try out what you suggested but was baulked by the partition table problem. Each command comes back with "Unrecognized partition table for drive 81. Please rebuild it using a Microsoft compatible FDISK tool (err=8 ) Current C/H/S=16383/255/63 Filesystem type is ntfs, partition type 0x7"
Once again I want to thank you for your infinite patience and willingness to help ppl like myself up the learner curve. If the IT community ever brings in canonization I'm gonna put your name forward :D
K0LO
April 26th, 2008, 09:17 AM
-{ Quote: "BTW, I did try out what you suggested but was baulked by the partition table problem. Each command comes back with "Unrecognized partition table for drive 81. Please rebuild it using a Microsoft compatible FDISK tool (err=8 ) Current C/H/S=16383/255/63 Filesystem type is ntfs, partition type 0x7"" }-I finally found out what this error means.
-{ Quote: "2007-08-29 version 1.1 (revision 19)
* Run mbr test to detect chs problem" }-So Grub4DOS is complaining that one or more partitions are not aligned on cylinder boundaries. I must have been tired when I looked at your partition table before and said that I couldn't see anything wrong. Looking here, the Vista partition does not start on a cylinder boundary. The value of "beginning sector" should be 1, and the "Relative Sectors" and "Number of Sectors" should be divisible by 63, so this partition is misaligned.
199518
How does your disk layout appear when viewed by DD?
199519
After you converted the Vista partition from logical to primary, does the Vista partition now follow the logical partitions in the graphic; in other words is it the last partition on the right or is it next to the XP partition?
Earthling
April 26th, 2008, 09:27 AM
The view from XP -
K0LO
April 26th, 2008, 10:18 AM
OK - it all makes sense. Since all of your other partitions are properly aligned you only need to delete and restore the Vista partition to fix the partition table problem. The following should work:
1. Generalize your Vista BCD first so that you don't have to deal with repairing it when it gets moved. Step A in post #6.
2. Create an image of the Vista partition after doing step 1.
3. Boot to DD and delete the Vista partition, leaving uncommitted free space.
4. Create a new, primary NTFS partition that completely fills the free space
5. After committing the changes in DD, check the partition table view of the disk and confirm that the newly-created Vista partition is aligned properly. You should see "Begin Sector" = 1, "Relative Sectors" = 61432560, and "Number of Sectors" = 61432560 in the partition table view if my math is correct.
6. In anticipation of a test boot into Vista, hide the XP partition, unhide the Vista partition and set the Vista partition active.
7. Boot to TI and restore the Vista image to the newly-created partition, choosing primary active state while restoring.
8. Boot to Vista to check.
Assuming that works, check whether Grub4DOS is happy by booting to VistaPE and testing some manual GRUB commands per post #8.
Is Grub4DOS happy now? If so, before making it your bootloader, check back. There are a couple of things I still need to figure out, like how it reacts to having its loader file and menu file in a hidden partition, before proceeding. I can do some of those tests here on my machine.
Earthling
April 26th, 2008, 10:23 AM
OK, I'll check back once that's all sorted.
Earthling
April 26th, 2008, 11:51 AM
All tickety-boo. What next?
K0LO
April 26th, 2008, 12:32 PM
Excellent!
I've been experimenting with grub4DOS and have found that it can indeed find its loader file and menu file in a hidden partition, so that's one less worry. I tried sticking these files in random places all over my disk in FAT32, Linux ext2, and NTFS partitions and it always found them. Pretty slick.
Here are the remaining steps. Let's install Grub4DOS to the MBR and put its files in the first primary partition, since that's where it begins searching from.
1. Make sure that you have a recent TI backup that contains the MBR and Track 0. If things go wonky with Grub4DOS then you can just restore the MBR to get back to the current state.
2. From XP, copy the following files from your VistaPE partition (J:?) to the root of the XP partition:Source Destination
J:\grldr C:\grldr
J:\Boot\gentleblue.gz C:\gentleblue.gz
J:\Boot\memtest.bin C:\memtest.bin3. Copy the following text into a file and name it menu.lst, and put the file in the root of C:\ like the others:# Custom grub4DOS menu for Earthling
# 4.26.2008 K0LO
# Other splash image files are available in VistaPE \Boot folder. Rename this to suit
splashimage /gentleblue.gz
# Timeout in seconds before default operating system boots
timeout 10
# Default OS from choices below. Numbered starting with zero.
default 0
# GRUB numbers disks starting with 0, partitions starting with 0
# (hd0,0)=first primary partition on disk 1
# For partitions, 0=primary 1, 1=primary 2, 2=primary 3, 3=primary 4
# 4=logical 1, 5=logical 2, 6=logical 3, 7=logical 4, etc.
# Hide XP, unhide Vista
title Windows Vista
root (hd0,1)
hide (hd0,0)
unhide (hd0,1)
chainloader /bootmgr
# Hide Vista, unhide XP
title Windows XP
root (hd0,0)
hide (hd0,1)
unhide (hd0,0)
chainloader /ntldr
# Unhide both XP and Vista. Since VistaPE is on second hard disk,
# use the map commands to fool it into thinking it is running from the first disk.
title VistaPE
root (hd1,0)
unhide (hd0,0)
unhide (hd0,1)
map (hd0) (hd1)
map (hd1) (hd0)
chainloader /bootmgr
# Memtest86+ memory test program
title Memory Test
kernel /memtest.bin
# Get a grub4DOS command prompt
title CommandLine
commandline
title Reboot
reboot
title Halt
haltI've included menu entries in this file for booting Vista, XP, VistaPE, and memtest86+, and you can add more. Change the default, the timeout interval, and the splash image to suit your tastes.
4. Install grub4DOS to the MBR of your disk 1.
5. Try it out. I hope I got all of the commands correct; if not let me know.
Earthling
April 26th, 2008, 01:24 PM
-{ Quote: "... Make sure that you have a recent TI backup that contains the MBR and Track 0 ..." }-
Don't they all, by default?
MudCrab
April 26th, 2008, 01:29 PM
-{ Quote: "Don't they all, by default?" }-
Yes, they do.
Earthling
April 26th, 2008, 02:46 PM
Mark:
atm it won't boot either Vista or VistaPE from the menu. Also, it has destroyed the three data partitions on Disk 1 which are showing as a single primary partition of 239.5GB 0x15 (Unknown). I should be able to restore those partitions from the backup, but won't just yet until the problem is identified.
This was a bit unexpected.
K0LO
April 26th, 2008, 03:11 PM
Bernard:
You bet that's unexpected. I can't imagine what would cause that. It sounds like something made changes to the partition table that affected the extended partition container, which would probably result in the loss of references to some or all of the logical partitions.
To troubleshoot, a couple of questions:
1. Did the correct GRUB menu show up when booting?
2. Did XP boot correctly?
3. Can you post a screen shot of the partition table for Disk 1?
4. While running DD, can you try the "Recover Partitions" wizard to see if it can find the logical partitions? (after doing step 3).
Earthling
April 26th, 2008, 03:52 PM
Got a few functionality problems atm, like Favs have disappeared along with everything else.
1. Yes, menu was OK
2. Yes, XP boots
3. Below
4. Will revert
K0LO
April 26th, 2008, 03:56 PM
Bernard:
Hang on a second before reverting. I have an idea.
K0LO
April 26th, 2008, 03:59 PM
On the above picture of the partition table, all looks fine except for the "Partition Type" listed for the Extended partition. It is listed as "Unknown". Could you click on the drop-down box and change it to "Extended", save the sector, then see if everything looks normal again? If you reboot, only boot into XP. I think I know what happened.
Earthling
April 26th, 2008, 04:02 PM
4. The wizard can't find any unallocated spaces. I'm now going to restore the missing partitions - I need 'em.
Earthling
April 26th, 2008, 04:09 PM
OK, changing it to Extended has restored the missing partitions. I'm still in VistaPE/DD (booted from CD) and will await your advice.
K0LO
April 26th, 2008, 04:22 PM
Bernard:
This is what I think is going on. Your partition table is not in disk order. If you look at your disk in the graphic view of DD, the XP partition is first followed by the Vista partition and then by the logical partitions.
Looking at the partition table, the order is XP, the logical partitions then Vista.
Apparently grub4DOS is going by partition table order when referring to partitions and not by disk order. The following illustration shows what I think is happening:
199534
Let's confirm this by doing a quick test. If you could reboot the machine, then choose "Command Line" from the grub menu. Try this:root (hd0,2)
find /bootmgrWhat partitions are returned as containing this file? Are they (hd0,2) and (hd1,1)?
Don't let the PC boot into XP or Vista yet.
Earthling
April 26th, 2008, 04:49 PM
Sorry for delay - interruptions! The partition table looks ok, but root (hd,0,2) returns no partition; root (hd0,1) returns the filesystem and partition type, and find /bootmgr returns (hd0,1) and (hd1,2), which looks OK to me.
Earthling
April 26th, 2008, 05:10 PM
I'm tempted to try the 'wrong' partition table data per #10, but It's just a half educated guess really. btw, XP can't see the data partitions even though they are showing in DD
K0LO
April 26th, 2008, 05:22 PM
Then I really am baffled. My interpretation in post #25 must be completely wrong. It would appear that (hd0,1) does indeed point to the second primary partition on Disk 1, which is your Vista partition. The output of the find /bootmgr command confirms that Vista is in this partition. But why did the "hide" command end up hiding the wrong partition?
Yet the other response for (hd1,2) is unexpected; that's saying VistaPE is on Disk #2 (correct) in primary partition #3 (what??). Looking at the illustration of your Disk 2 in post #3 shows only two partition table entries, an extended partition followed by a primary partition. However, from your other thread, the DD view of Disk 2 is shown below:
199535
So perhaps the unallocated space is being counted as unformatted primary partitions. Confusing. But try this sequence by booting the PC and choosing a Command Line in grub:root (hd1,2)
map (hd0) (hd1)
map (hd1) (hd0)
chainloader /bootmgrIf VistaPE starts correctly then that will confirm that the partition designator is correct.
I'll have to think about this some more. Sorry to get your disk so messed up. If you want to return to normalcy then use TI to restore the MBR and Track 0, manually hide/unhide and manually select the correct partition to be active.
Gotta shut down here - big thunderstorm and may lose power at any moment.
Earthling
April 26th, 2008, 06:05 PM
Mark:
I'm shutting down here too, I'm a bit tired. No apologies please - I've made sure I know how to get back to where I was, and I'll be doing that first thing in the morning. We will crack it.
K0LO
April 26th, 2008, 08:15 PM
-{ Quote: "...btw, XP can't see the data partitions even though they are showing in DD" }-You may only need to go to XP Disk Management and reassign the drive letters.
K0LO
April 26th, 2008, 08:44 PM
Bernard:
While you're sleeping I was doing some tests on my laptop. I had a spare slot in the partition table so I created a new primary partition. The partition showed up as (hd0,3) in GRUB as expected, as (hd1,3) in grub4DOS (when booted to a VistaPE flash drive, the hard disk is (hd1) and the flash drive is (hd0), so that's as expected), as /dev/sda4 in Linux (primary partition #4), so that's as expected, and as primary partition #4 in Windows as viewed by Disk Management and by DD. So nothing unexpected or out of the ordinary here.
I then tried hiding and unhiding various partitions with both GRUB and with grub4DOS, and in all cases the outcome was as expected. However, I do not have the same disk layout as you do with the order of the partitions on the disk differing from the order in the partition table. I suspect that this is the root cause of the problem. If you are positive that your menu.lst file had the correct hide/unhide statements (hiding (hd0,0) and (hd0,1) only) and yet you somehow ended up with the extended partition (hd0,2) hidden, then I'm highly suspicious that this is the issue.
So, I would recommend biting the bullet and getting the partition table order straightened out. Most tools are supposed to be able to deal with this situation, but it is nonstandard and you never know when you might run into some program that doesn't deal properly with an out-of-order partition table. Maybe you just did with grub4DOS!
Since TI restores are working for you it really is not difficult to straighten this out. I'm game to help if you're game for doing it. This is a rough outline, but I can provide further details if needed:
1. Using DD, delete the logical partitions and the Vista partition
2. Re-create the partition structure in the correct order and sizes (Vista first as primary, then logicals)
3. Restore the Vista partition using TI
4. Restore the logical partitions
With the partition table ordered correctly then the menu.lst file should work correctly, except for booting VistaPE. That's another issue that we can fix later...
Earthling
April 27th, 2008, 03:38 AM
Mark:
Just to confirm that it's back to the position we were in at #14, everything functioning normally.
I'm quite confident I can recreate the partition structure if that's what's needed, but I have been looking at your suggested menu.lst to see if I can understand how it replicates the steps I have to take in DD to switch OS -
1. Hide last OS
2. Unhide next OS
3. Set new partition active
1 and 2 are obviously there but how is 3 catered for? Presumably it's either the root or chainloader command?
K0LO
April 27th, 2008, 08:14 AM
Bernard:
You've got it; those are the steps. But when using a boot manager there is no need for setting the "Active" flag. The active flag is only used by the simple generic Microsoft MBR code. This code searches the partition table to find the one and only partition with the active flag set, then it jumps to this partition and executes the boot code in the partition boot record. So it "chainloads" so to speak.
With other boot managers you point them to the partition that you want to boot from and then tell them "go", so the active flag isn't used.
With GRUB and grub4DOS, the "root" command is used to point to the partition of interest and the "chainloader" command is used to jump to either the start of a partition (chainloader +1) or to a specific file (chainloader /ntldr).
K0LO
April 27th, 2008, 08:39 AM
Here is a revised menu.lst file with a few comments rearranged, a couple of typos corrected, and the partition reference for VistaPE changed to correspond with your findings.
# Custom grub4DOS menu for Earthling
# Rev. B with corrected partition references and makeactive statements
# 4.27.2008 K0LO
# Other splash image files are available in VistaPE \Boot folder; rename to suit
splashimage /gentleblue.gz
# Timeout in seconds before default operating system boots
timeout 10
# Default OS from choices below. Numbered starting at zero
default 0
# GRUB numbers disks starting with 0, partitions starting with 0
# (hd0,0)=first primary partition on disk 1
# For partitions, 0=primary 1, 1=primary 2, 2=primary 3, 3=primary 4
# 4=logical 1, 5=logical 2, 6=logical 3, 7=logical 4, etc.
# For reference, these are the partition designators for your disk
# (hd0,0) Windows XP
# (hd0,1) Windows Vista
# (hd1,2) VistaPE on Disk #2
title Windows Vista
root (hd0,1)
makeactive
# Hide XP, unhide Vista
hide (hd0,0)
unhide (hd0,1)
chainloader /bootmgr
title Windows XP
root (hd0,0)
makeactive
# Hide Vista, unhide XP
hide (hd0,1)
unhide (hd0,0)
chainloader /ntldr
title VistaPE
root (hd1,2)
# Unhide both XP and Vista
unhide (hd0,0)
unhide (hd0,1)
# Since VistaPE is on second hard disk, use map commands
# to fool it into thinking it is running from the first disk.
map (hd0) (hd1)
map (hd1) (hd0)
chainloader /bootmgr
# Memtest86+ memory test program
title Memory Test
kernel /memtest.bin
# Get a grub4DOS command prompt
title CommandLine
commandline
title Reboot
reboot
title Shut Down
halt
Earthling
April 27th, 2008, 10:37 AM
Mark:
I'd rather avoid getting my disk in a state again if poss. I see the menu is the same as the previous one as far as XP and Vista are concerned, and different for VistaPE. This seems to imply you are very confident that it was my partition order that caused the havoc, and that if I sort that and then install Grub4DOS in the MBR it will be fine.
How confident?
K0LO
April 27th, 2008, 11:22 AM
Bernard:
I'd say very confident. Of course it's your choice.
MudCrab
April 27th, 2008, 11:23 AM
-{ Quote: "...when using a boot manager there is no need for setting the "Active" flag. The active flag is only used by the simple generic Microsoft MBR code. This code searches the partition table to find the one and only partition with the active flag set, then it jumps to this partition and executes the boot code in the partition boot record. So it "chainloads" so to speak.
With other boot managers you point them to the partition that you want to boot from and then tell them "go", so the active flag isn't used." }-
I would just add that if you don't set the Active flag and you boot into a Windows partition that requires Windows to reassign drive letters, you may end up with a problem. In those cases, it's best to have the Windows partition set Active prior to booting it.
Earthling
April 27th, 2008, 11:42 AM
-{ Quote: "Bernard:
I'd say very confident. Of course it's your choice." }-
Mark (and MudCrab):
I'd like this thread to end with an all round success. We've achieved a great deal already, and I'm confident of finishing the job in the next day or two. It's just the time factor.
We haven't had any comments from other Windows dual booters who use ATI, but I do hope some are watching and thinking of giving it a whirl.
I'll come back and confirm when it's done.
MudCrab
April 27th, 2008, 12:30 PM
Mark,
From Post #26:
The partition table looks ok, but root (hd,0,2) returns no partition; root (hd0,1) returns the filesystem and partition type, and find /bootmgr returns (hd0,1) and (hd1,2)
I'm having a hard time figuring this out. Your tests didn't have the partitions out of order in the partition table. I may make a scrambled version and do a test, but I wonder if something else is going on.
From Post #6:
4. Install grub4DOS to the MBR of your disk 1.
When you refer to disk 1 you mean the XP/Vista disk, right? When installing Grub4DOS this would show up as Disk 0 (hd0) in the list. However, this could also be different. I have an IDE drive in my computer and even though the boot drive is my RAID, the IDE gets the (hd0) positition by Grub4DOS.
I'm just trying to verify that Grub4DOS did get installed to the XP/Vista drive. Also that the current BIOS booting drive is the XP/Vista drive and not the VistaPE drive. As you know, Grub4DOS will search for the /grubldr file and use the first one it finds. There are two on this system.
The reason is the following:
If you assume that the booting drive was not the XP/Vista drive, but was instead the VistaPE drive and you assume that Grub4DOS is keeping the (hd#,#) values according to their slot positions, then the values returned by Post #26 make sense.
(hd0,1) = VistaPE disk, first drive, second Primary partition (second slot) = VistaPE partition
(hd1,2) = XP/Vista disk, second drive, third Primary partition (third slot) = Vista partition
Another case may be that Grub4DOS is detecting the VistaPE drive as (hd0) even though the XP/Vista drive is the BIOS boot drive.
A different find test that looks for a unique file would show which is really which: find /ntldr
When I setup different partitions with GRUB, I like to put "tag" files on them. XPtag, Vistatag, etc. This lets me run the find command and verify exactly which drive/partition is which as GRUB sees it.
I may just be confusing the matter more, but I'm trying to understand what happened.
K0LO
April 27th, 2008, 01:13 PM
-{ Quote: "I would just add that if you don't set the Active flag and you boot into a Windows partition that requires Windows to reassign drive letters, you may end up with a problem. In those cases, it's best to have the Windows partition set Active prior to booting it." }-What is confusing when you try to interpret how Windows assigns drive letters is that the MS documentation is fairly old; this reference (http://support.microsoft.com/kb/51978) is for DOS/Windows and this one (http://support.microsoft.com/kb/234048/en-us) is for Windows 2000.
For example, from the DOS/Windows article, after scanning floppies:-{ Quote: "3. Regardless of whether a second floppy disk drive is present, MS-DOS then assigns the drive letter C to the primary MS-DOS partition on the first physical hard disk, and then goes on to check for a second hard disk." }-And from the Windows 2000 article:-{ Quote: "BASIC Disk - Drive Letter Assignment Rules
The following are the basic disk drive letter assignment rules for Windows 2000:
• Scan all fixed hard disks as they are enumerated, assign drive letters starting with any active primary partitions (if there is one), otherwise, scan the first primary partition on each drive. Assign next available letter starting with C:
• Repeat scan for all fixed hard disks and removable (JAZ, MO) disks and assign drive letters to all logical drives in an extended partition, or the removable disk(s) as enumerated. Assign next available letter starting with C:.
• Finally, repeat scan for all fixed hard disk drives, and assign drive letters to all remaining primary partitions. Assign next available letter starting with C:.
• Floppy drives. Assign letter starting with A:
• CD-ROM drives. Assign next available letter starting with D:." }-So does the scan "see" hidden partitions? With Windows, probably not. Going by Earthling's dual-boot setup, which is pretty commonplace for isolated dual-boots of Windows, shouldn't the following happen? If booting to XP and the Vista partition is active but hidden, won't XP then choose the first visible primary partition (its own) to assign to C:? And when booting to Vista if the XP partition is active but hidden, won't Vista choose the first visible primary partition (again, its own) as C:?
I believe this will happen but like you say there may be some circumstance when there is another active partition visible to the OS at boot time, so in this case the drive letter assignments may not come out as intended. Perhaps it would be safer to also change the active flag when switching operating systems, at any event it wouldn't hurt.
It is easy enough to do this with GRUB by adding the makeactive statement. An example of an XP boot stanza is:title Windows XP
root (hd0,0)
makeactive
# Hide Vista, unhide XP
hide (hd0,1)
unhide (hd0,0)
chainloader /ntldr
I'll incorporate this change into the menu.lst file in post #34 just so it is more robust.
K0LO
April 27th, 2008, 01:41 PM
-{ Quote: "From Post #6:
4. Install grub4DOS to the MBR of your disk 1.
When you refer to disk 1 you mean the XP/Vista disk, right? When installing Grub4DOS this would show up as Disk 0 (hd0) in the list. However, this could also be different. I have an IDE drive in my computer and even though the boot drive is my RAID, the IDE gets the (hd0) positition by Grub4DOS.
I'm just trying to verify that Grub4DOS did get installed to the XP/Vista drive. Also that the current BIOS booting drive is the XP/Vista drive and not the VistaPE drive. As you know, Grub4DOS will search for the /grubldr file and use the first one it finds. There are two on this system." }-Hi, Paul. I'm glad you are having a look at this.
Yes, I did intend for grub4DOS to be installed to the first IDE hard disk; the one containing XP and Vista. Good point about the destination of the install. One way to be certain would be to disconnect the disk with VistaPE. If the grub menu appears with only the XP/Vista disk connected then the install went to the correct disk.
-{ Quote: "Another case may be that Grub4DOS is detecting the VistaPE drive as (hd0) even though the XP/Vista drive is the BIOS boot drive.
A different find test that looks for a unique file would show which is really which: find /ntldr
When I setup different partitions with GRUB, I like to put "tag" files on them. XPtag, Vistatag, etc. This lets me run the find command and verify exactly which drive/partition is which as GRUB sees it.
I may just be confusing the matter more, but I'm trying to understand what happened." }-I think at the moment, Bernard has removed grub4DOS from his primary hard disk so perhaps there is an alternate way to confirm this. He could boot from the second hard disk, which has grub4DOS now, and go to a command prompt. How about the inverse test:find /ntldr
# should return (hd1,0) if the VistaPE drive is detected as (hd0)
# but will return (hd0,0) if the VistaPE drive is detected as (hd1)
# Another unique file:
find /gentleblue.gz
# should return (hd1,0) since this file was copied to the XP root
# and the one in the VistaPE partition is inside a folder and won't be foundGood suggestions; keep them coming.
Earthling
April 27th, 2008, 02:27 PM
-{ Quote: "... I think at the moment, Bernard has removed grub4DOS from his primary hard disk so perhaps there is an alternate way to confirm this. He could boot from the second hard disk, which has grub4DOS now, and go to a command prompt. How about the inverse test:find /ntldr
# should return (hd1,0) if the VistaPE drive is detected as (hd0)
# but will return (hd0,0) if the VistaPE drive is detected as (hd1)
# Another unique file:
find /gentleblue.gz
# should return (hd1,0) since this file was copied to the XP root
# and the one in the VistaPE partition is inside a folder and won't be foundGood suggestions; keep them coming." }-
Sorry guys, other duties today.
I can remove any doubt on this. ATM there are no hidden partitions, Grub4DOS has been removed from the first hard disk, and I've booted to VistaPE. I've also put a tag file on each of the three bootable partitions -
find / XPTag.txt returns (hd1,0) - correct, 1st partition on XP/Vista disk
find /VistaTag.txt returns (hd1,2) - surprise, and probably supports Mark's theory about my partitions. I expected (hd1,1)
find /VistaPETag.txt returns (hd0,1) - I think that's correct but need to check it. It's in the last of three partitions on the eSATA but the second may be a logical.
EDIT - the last is correct. There's an extended partition containing two logical partitions, then the VistaPE primary, and that's how it shows in the partition table.
Earthling
April 27th, 2008, 02:39 PM
It would help with all this if there was a way to switch from Command line in VistaPE to LiteStep, and vice versa, rather than having to continually reboot.
Is this possible?
MudCrab
April 27th, 2008, 03:06 PM
-{ Quote: "find / XPTag.txt returns (hd1,0) - correct, 1st partition on XP/Vista disk
find /VistaTag.txt returns (hd1,2) - surprise, and probably supports Mark's theory about my partitions. I expected (hd1,1)
find /VistaPETag.txt returns (hd0,1)" }-
This is good.
The next test (when you have time, of course), would be to reinstall Grub4DOS to the XP/Vista drive and then boot it and run the same find commands. Those results would verify exactly what Grub4DOS sees when doing a normal boot.
MudCrab
April 27th, 2008, 03:08 PM
-{ Quote: "It would help with all this if there was a way to switch from Command line in VistaPE to LiteStep, and vice versa, rather than having to continually reboot.
Is this possible?" }-
Are you referring to switching between the Grub4DOS command line and VistaPE?
Even if you could, the results might not be the same as when booted directly to Grub4DOS.
Earthling
April 27th, 2008, 03:30 PM
Yes, sorry, that is what I meant, and I was pretty sure it wasn't doable. Thanks.
K0LO
April 27th, 2008, 03:31 PM
-{ Quote: "find / XPTag.txt returns (hd1,0) - correct, 1st partition on XP/Vista disk
find /VistaTag.txt returns (hd1,2) - surprise, and probably supports Mark's theory about my partitions. I expected (hd1,1)
find /VistaPETag.txt returns (hd0,1) - I think that's correct but need to check it. It's in the last of three partitions on the eSATA but the second may be a logical.
EDIT - the last is correct. There's an extended partition containing two logical partitions, then the VistaPE primary, and that's how it shows in the partition table." }-This finding is consistent with everything except post #26.
For Disk 1 from post #25:
199556
Apparently the partition numbers returned by grub4DOS of (hd1,0) for XP and (hd1,2) for Vista are referring to the location or "slot" in the partition table.
For Disk 2 from post #3:
199557
Again, the returned value of (hd0,1) is consistent with the location in the partition table.
What doesn't make sense are the values found in post #26:-{ Quote: "but root (hd,0,2) returns no partition; root (hd0,1) returns the filesystem and partition type, and find /bootmgr returns (hd0,1) and (hd1,2)" }- Here Vista was identified as (hd0,1) instead of (hd0,2) and VistaPE was identified as (hd1,2) instead of (hd1,1). Like Paul says, the best way to decipher this is to search for your tag files when booting grub4DOS from Disk 1.
You will have to reinstall grub4DOS to the MBR of Disk 1 to do this, then to undo the install use TI to restore the MBR of Disk 1. If you don't try booting to anything then this should not result in any changes to your disk except for the MBR.
K0LO
April 27th, 2008, 03:39 PM
-{ Quote: "If you assume that the booting drive was not the XP/Vista drive, but was instead the VistaPE drive and you assume that Grub4DOS is keeping the (hd#,#) values according to their slot positions, then the values returned by Post #26 make sense.
(hd0,1) = VistaPE disk, first drive, second Primary partition (second slot) = VistaPE partition
(hd1,2) = XP/Vista disk, second drive, third Primary partition (third slot) = Vista partition" }-And going back to Paul's post #39, this will all make sense if the test done in post #26 was accidentally done while booted from the VistaPE disk or from a VistaPE CD instead of from the primary (XP/Vista) hard disk. Post #26 is the only inconsistency in all of the tests done so far.
Post #24 says-{ Quote: "OK, changing it to Extended has restored the missing partitions. I'm still in VistaPE/DD (booted from CD) and will await your advice." }-
Bernard, is there any chance that this might have happened? If so, mystery solved.
MudCrab
April 27th, 2008, 03:49 PM
-{ Quote: "And going back to Paul's post #39, this will all make sense if the test done in post #26 was accidentally done while booted from the VistaPE disk..." }-
Mark,
The other possibility is that because Grub4DOS was installed on both drives, even if it booted from Disk 1 (hd0), it may have detected the VistaPE drive as (hd0) when it scanned them and then booted it instead because it searched it first and found /grubldr on it.
However, you would think the menu.lst file would be different on each partition. The VistaPE partition's menu.lst shouldn't include the XP and Vista entries and the other changes in your file.
Are both the drives in the computer using the same interface? Both SATA or IDE? This problem seems to happen mostly when mixing SATA and IDE drives.
Earthling
April 27th, 2008, 03:51 PM
-{ Quote: "And going back to Paul's post #39, this will all make sense if the test done in post #26 was accidentally done while booted from the VistaPE disk or from a VistaPE CD instead of from the primary (XP/Vista) hard disk. Post #26 is the only inconsistency in all of the tests done so far.
Post #24 says
Bernard, is there any chance that this might have happened? If so, mystery solved." }-
Hard to be absolutely sure about that, but I think it was done from VistaPE.
I was about to ask how to avoid upsetting Windows if I did what Paul has suggested, so thanks for the tip.
Earthling
April 27th, 2008, 03:53 PM
MudCrab:
Both are identical SATAs
K0LO
April 27th, 2008, 04:05 PM
I think we are really close to finally solving this. I think I understand what happened, but if you want to be methodical then I suggest proceeding as follows.
Manually configure to boot to XP. You will need the grubinst_gui.exe file on your XP OS to be able to reinstall grub4DOS to the MBR of Disk 1. Do the install and then reboot the machine to a grub command prompt and search for your tag files. If you see them as expected:
(hd0,0) XPTag.txt
(hd0,2) VistaTag.txt
(hd1,1) VistaPETag.txt
then the experiment in post #26 was done by booting from the VistaPE disk instead of the main disk and its results have confused us all.
Earthling
April 27th, 2008, 04:25 PM
Mark:
Ah, you posted that while I was setting up the test. The only thing is I installed Grub4DOS to the Disk 1 MBR from Vista rather than from XP. I didn't think it made any difference which you used.
The results, if they are still useful, are exactly as you just predicted.
K0LO
April 27th, 2008, 04:45 PM
That confirms my suspicions. The test in post #26 was just done when booted from Disk 2 instead of from Disk 1.
I thought that I understood what was happening after writing post #25 but after seeing the test results in #26 I got really confused and stopped until we cleared things up.
Do you know how simple it is to fix this? All that is needed is to change the menu.lst file to refer to the partitions correctly. XP is (hd0,0), Vista is (hd0,2) and VistaPE is (hd1,1) when booted from Disk 1. Please double-check my edits to be sure we have this correct in this edited menu.lst file:# Custom grub4DOS menu for Earthling
# Rev. C with corrected partition references and makeactive statements
# 4.27.2008 K0LO
# Other splash image files are available in VistaPE \Boot folder; rename to suit
splashimage /gentleblue.gz
# Timeout in seconds before default operating system boots
timeout 10
# Default OS from choices below. Numbered starting at zero
default 0
# GRUB numbers disks starting with 0, partitions starting with 0
# (hd0,0)=first primary partition on disk 1
# For partitions, 0=primary 1, 1=primary 2, 2=primary 3, 3=primary 4
# 4=logical 1, 5=logical 2, 6=logical 3, 7=logical 4, etc.
# For reference, these are the partition designators for your disk
# (hd0,0) Windows XP
# (hd0,2) Windows Vista
# (hd1,1) VistaPE on Disk #2
title Windows Vista
root (hd0,2)
makeactive
# Hide XP, unhide Vista
hide (hd0,0)
unhide (hd0,2)
chainloader /bootmgr
title Windows XP
root (hd0,0)
makeactive
# Hide Vista, unhide XP
hide (hd0,2)
unhide (hd0,0)
chainloader /ntldr
title VistaPE
root (hd1,1)
# Unhide both XP and Vista
unhide (hd0,0)
unhide (hd0,2)
# Since VistaPE is on second hard disk, use map commands
# to fool it into thinking it is running from the first disk.
map (hd0) (hd1)
map (hd1) (hd0)
chainloader /bootmgr
# Memtest86+ memory test program
title Memory Test
kernel /memtest.bin
# Get a grub4DOS command prompt
title CommandLine
commandline
title Reboot
reboot
title Shut Down
haltIf you simply replace the menu.lst file on the XP partition with the above file then all should work correctly.
Earthling
April 27th, 2008, 04:56 PM
Mark:
What can I say? I must have been a bit tired/confused when I did that.
I will set it up tomorrow and have every confidence, now I have some understanding of the boot process, that it will be successful.
K0LO
April 27th, 2008, 05:08 PM
Bernard:
No apology required. Actually, I'm glad that my theory about scrambled partition tables was incorrect. If it had been the cause, it would have pointed to a bug in GRUB or in grub4DOS. This is a much better outcome and so simple to fix.
Hopefully you will be completely successful tomorrow. Philosophically, it is sometimes good to struggle with something because if it's simple then you don't learn anything. You've probably got a much better grasp of the PC boot process now after having done this.
Paul, I'm glad you took a look at this because you nailed the cause. I hadn't thought of the partitions making sense from the perspective of the other disk. That was the clue that helped solve this.
MudCrab
April 27th, 2008, 05:19 PM
-{ Quote: "Actually, I'm glad that my theory about scrambled partition tables was incorrect. If it had been the cause, it would have pointed to a bug in GRUB or in grub4DOS. This is a much better outcome and so simple to fix." }-
I agree. I've had enough of "scrambled" partition tables with TI 10.
-{ Quote: "Paul, I'm glad you took a look at this because you nailed the cause. I hadn't thought of the partitions making sense from the perspective of the other disk. That was the clue that helped solve this." }-
You're welcome. I was following the thread from the beginning, but you were doing so well I didn't need to add anything. As I said, I've run into the GRUB vs. Linux vs. Windows disk order detection and don't trust it. Too many drives get swapped around. Tag the partitions and it's as easy as a "find" command to figure out the partition you want.
Try installing three or four Linux distros to their own partitions and then using the standard "find /boot/grub/stage2" command and see how well it helps.
Earthling
April 28th, 2008, 08:55 AM
Mark (and MudCrab):
Finally plucked up the courage to install Grub4DOS and your menu. XP and Vista both boot just fine (relief!), but VistaPE would not boot from the menu.
I had been questioning in my mind the need for the map commands, so just commented them and then it worked.
Still to test Memtest, Command, and Reboot but we are finally there.
A great outcome, and a step change in my understanding of how all this stuff works.
Bernard
K0LO
April 28th, 2008, 09:52 AM
Bernard:
Terrific! Glad to hear that you have it working, and that you've discovered one of the reasons why I prefer GRUB. Although it is a little (or a lot) geeky, you have absolute control over the boot process. Once understood you can easily make changes by editing a plain-text file. I haven't found anything yet that it can't handle. While there are a lot of boot managers that have prettier interfaces and even can insulate you from the inner workings, they lack the flexibility to handle unusual situations.
So now if you want to add another OS on your machine just create a partition for it, install it, and add another menu item to your menu.lst file. Note that since you have a boot manager, the need for installing operating systems in primary partitions goes away. You can add any other OS, even Windows, to logical partitions and they can be booted from grub4DOS.
Have fun with your new setup and I'm glad to have helped. Both of us learned from this.
Earthling
April 30th, 2008, 12:50 PM
Mark:
This new setup is exactly right, and for the first time ATI is behaving in exemplary fashion, but if for any reason I wanted to remove Grub4DOS from the MBR (though I can't atm imagine why I would want to do that), is it simply a case of booting to the Vista RE and running FIXMBR?
Or do I need to keep the last image I took before installing Grub4DOS so that I could restore the MBR from that?
K0LO
April 30th, 2008, 01:21 PM
Bernard:
That's correct; bootrec /FixMbr will work.
FixMbr will restore the boot code in sector 0 without changing the partition table. A TI MBR/Track 0 restore will do likewise plus it will replace any information in the rest of the sectors (1 through 62) of track 0. Grub4DOS uses sector 0 and sectors 2 - 12, so a TI MBR/Track 0 restore will completely restore grub4DOS if it gets damaged.
If your last backup image is too large to keep, note that any TI 11 partition image will contain MBR/Track 0, so you could back up the smallest partition on your disk to get a copy of the MBR in the smallest possible file size. Theoretically you could even create a tiny partition and just back that up to make the backup image smaller yet.
I know, too much information! Returning to the original question -- bootrec /FixMbr will restore the standard Microsoft boot loader and allow your PC to boot directly to the currently-active partition.
Earthling
April 30th, 2008, 03:57 PM
-{ Quote: "...I know, too much information! ..." }-
Not at all. Q. answered, thanks
vBulletin® Copyright ©2000-2012, Jelsoft Enterprises Ltd.
Copyright ©2002 - 2012, Wilders Security Forums