- Joined
- Jul 20, 2006
Edit: Someone suggested I "use the edit function" I believe they thought I was making too many posts. Don't know how this would be an improvement, but let it never be said that I'm not a good sport. What basically happened is somebody suggested (on this board) that in order to boot a windows HD (drive 2) that had XP and 2003 Server on it I use this code in grub:
map (hd0) (hd1)
map (hd1) (hd 0)
unhide (hd1,0)
hide (hd1,4)
rootnoverify (hd1,0)
makeactive
Chainloader +1
The unhide and hide commands belonged BEFORE the mapping becuse what this effectively did was hide the partitions on the wrong drive causing linux not to load. And a further suggestion changed the MBR from standard to "Unknown" Causing the windows HD not to boot. Currently Windows is back up and running and Linux is up and running though the Linux drive is in a state of disarray. A complete log of what happened is found below. I'm on the last phase of attempting to put the Linux drive back in order (if anyone has any suggestions of how to do so) and maybe this thread could be useful to someone.
So I had Linux on HD0 and Windows XP and Windows 2003 server on HD1 and I just wanted to get Windows to boot from Grub. http://www.ocforums.com/showthread.php?t=469613
Well... This is what happened.
First I ran:
unhide (hd1,0)
hide (hd1,4)
rootnoverify (hd1,0)
map (hd0) (hd1)
map (hd1) (hd0)
makeactive
chainloader +1
Didn't work. So someone suggested:
map (hd0) (hd1)
map (hd1) (hd0)
unhide (hd1,0)
hide (hd1,4)
rootnoverify (hd1,0)
makeactive
chainloader +1
Didn't work either. So I figured the hell with it and just changed the pins and reversed the drives and booted into windows where I started watching the Chappelle Show lost episodes (off of the linux drive.) Everything was going fine until the Chappelle show got fuzzy and finally wouldn't load anymore. Next time I tried to get into Fedora? THE BLACK GRUB screen.
What did I do? Permanently switch HD0 and HD1? Did I hide HD0,4 instead of HD1,4? I've done something like that before.
When I try to run the command to load Linux manually it tells me it's an "Invalid file system." HELLLLLLLLLLLLLLLP!
POST 2
I'm typing this from Linux now, but it's of extreme importance that I understand what happened. Windows couldn't recognize any drives on the disk AT ALL after Linux went down. When I ran the Rescue mode on the Fedora DVD I could see all the partitions just fine. What could cause this? anyway I'm not sure if I'll even be able to get back into Linux once I logout so let me tell you what I can.
root (hd0,6)
kernel /vmlinuz-2.6.15-1.2054_FC5 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
initrd /initrd-2.6.15-1.2054_FC5.img
That was the default command for me to get into Linux, however it wouldn't load hd0,6 (even though it did before) so I hit 'e' to edit the root command and I got: hainloader
...what the hell is hainloader? Some sort of linux virus? Anyway I dropped to a grub command line tried a couple of things, then I hit 'e' again to edit the root line... and it let me without any weird messages... very odd.
fdisk -l
Disk /dev/hda: 203.9 GB, 203928109056 bytes
255 heads, 63 sectors/track, 24792 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/hda1 2 24792 199133707+ f W95 Ext'd (LBA)
/dev/hda5 2484 3758 10241406 b W95 FAT32
/dev/hda6 * 2 14 104359+ 83 Linux
/dev/hda7 15 2483 19832211 8e Linux LVM
/dev/hda8 3759 24792 168955573+ 7 HPFS/NTFS
So I switch from root (hd0,6) to root (hd0,5) just now and it booted Linux... even though it was most definately hd0,6 before as noted in my "Grub config" thread on this board.
Is this just a one time thing? I might not even be able to boot-up next time. More importantly though, there's some EXTREMELY important data on that NTFS partition. And I can't understand why Windows can't see it.
Can anyone tell me what happened and how to fix it?
POST 3
This is my current fdisk -l
Disk /dev/hda: 203.9 GB, 203928109056 bytes
255 heads, 63 sectors/track, 24792 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/hda1 2 24792 199133707+ f W95 Ext'd (LBA)
/dev/hda5 2484 3758 10241406 b W95 FAT32
/dev/hda6 * 2 14 104359+ 83 Linux
/dev/hda7 15 2483 19832211 8e Linux LVM
/dev/hda8 3759 24792 168955573+ 7 HPFS/NTFS
-----------------------------------------
This is my previous fdisk -l
Device Boot Start End Blocks Id System
/dev/hda1 2 24792 199133707+ f W95 Ext'd (LBA)
/dev/hda5 2484 3758 10241406 b W95 FAT32
/dev/hda6 3759 24792 168955573+ 7 HPFS/NTFS
/dev/hda7 * 2 14 104359+ 83 Linux
/dev/hda8 15 2483 19832211 8e Linux LVM
What happened was hda6 was somehow moved to the bottom and everything under it was bumped up one. How? I have no idea.
but hda6 became hda8, hda7 became hda6, and hda8 became hda7
The start and end blocks are exactly the same however. So I'm thinking if I can just move the NTFS partition back to where it was and change the whole structure back to the way it was originally... then it should work just fine.
Anybody know the easiest way to do that?
POST 4
I'm posting the fdisk command from a Grub-booted fedora. All I did in grub config was change root from (hd0,6) to (hd0,5) I've now changed the windows section as well so the whole thing looks like this:
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,6)
# kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol00
# initrd /initrd-version.img
#boot=/dev/hda
default=0
timeout=5
splashimage=(hd0,5)/grub/splash.xpm.gz
hiddenmenu
title Fedora Core (2.6.15-1.2054_FC5)
root (hd0,5)
kernel /vmlinuz-2.6.15-1.2054_FC5 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
initrd /initrd-2.6.15-1.2054_FC5.img
title Windows
rootnoverify (hd1,0)
makeactive
chainloader +1
----------------------------------------------------------------------------------------------------------------------
I've went through and typed "unhide (hd0,x) for every partition on hd0. Will now go through and do the same for hd1.
POST 5
Quote:
Originally Posted by klingens
First. Check exactly which partition is your boot partition for Windows. Not where windows is installed but BOOT partition. This will be a single partition for the whole system even when you have several Windows versions installed. Then load it from grub via chainload. chainloader is simply a "load sector X on partition Y and treat it as a bootsector". Same thing that your BIOS does to boot anything.
PS: never ever change and map and change drives around between installs of the OSes. It only leads to situtations like yours
Quote:
Disk /dev/hdb: 203.9 GB, 203928109056 bytes
255 heads, 63 sectors/track, 24792 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/hdb1 * 1 6374 51199123+ 7 HPFS/NTFS
/dev/hdb2 6375 12044 45544275 7 HPFS/NTFS
/dev/hdb3 12045 21605 76798732+ 7 HPFS/NTFS
/dev/hdb4 21606 24791 25591545 f W95 Ext'd (LBA)
/dev/hdb5 21606 22880 10241406 7 HPFS/NTFS
Main Windows boot partition is hdb1 as shown.
POST 6
Good point. Maybe I don't. Just tried to load windows and it said "Invalid partition." All I did was do
rootnoverify (hd0,0)
makeactive
chainloader +1
Guess that ain't it. I'll try (hd0,1)
POST 7
Okay. Here's how I think I know it was my boot partition:
Because when I switched drives (via a jumper) it would boot right into windows. Now, since I've changed the active partition, if I switch drives it will tell me: Invalid partition.
How else would I be able to check which partition the main boot record is on? It's true that either the Windows XP or Windows 2003 partitions should theorhetically boot into windows (I might be a novice to Linux but I'm an expert in windows) so that it could be that I wasn't ACTUALLY booting into the real master partition. But why is it giving me an invalid partition error now?
My current fdisk -l:
/dev/hdb1 1 6374 51199123+ 7 HPFS/NTFS
/dev/hdb2 6375 12044 45544275 7 HPFS/NTFS
/dev/hdb3 * 12045 21605 76798732+ 7 HPFS/NTFS
/dev/hdb4 21606 24791 25591545 f W95 Ext'd (LBA)
/dev/hdb5 21606 22880 10241406 7 HPFS/NTFS
As you can see the system is flagged to boot (hd1,2) but I've already tried turning it back to (hd1,0) but it doesn't work.
Here's exactly what I did (basically followed your directions exactly
unhide (hd1,x) unhid all of the partitions available.
rootnoverify (hd1,0) to select the main bootrecord I would imagine
makeactive to set that partition as the active boot partition
chainloader +1
And that was it. It didn't work of course (never loaded anything ever without the map functions) so I changed drives and just tried to get back into windows and it gave me the "invalid partition" error right after post.
Then I tried hd1,1... then hd1,2 (which is where we are now) So like I said the active partition is set to hd1,2 now. I can change it back to hd1,0 using:
rootnoverify (hd1,0)
makeactive
chainloader +1
It won't work since it's exactly what got me into this me into this mess in the first place.
I know this is probably all stupidity layered upon stupidity... but it will be wonderful if I can actually learn why all this is happening. Then I'll understand exactly how it all works. I'm sorry to put anyone through any trouble in helping me, but it's very important that I understand (and important that I get back into windows and get my data back of course.)
POST 8?
Okay, so I believe what's happening is that the drive is now looking for it's own boot record on (hd1,0)... to the effect that when I switch drives it's STILL looking for it's own boot record on (hd1,0) even when I change the jumper so that it should actually be hd0,0.
To verify this (and you're not going to like this) I ran the old:
title Windows
rootnoverify (hd1,0)
map (hd0) (hd1)
map (hd1) (hd0)
makeactive
chainloader +1
And PRESTO! Found myself at the Windows Bootloader.
It didn't load of course (what we found out on the "Grub Config" thread is that it NEVER loaded) but at least now I have a clearer understanding for what's happening.
So maybe
rootnoverify hd0,0
makeactive
chainloader +1 would work for me.
We'll see...
POST 9
Now... I don't mean to imply that I'm the GREATEST tech in the world... (though I might be after I've mastered Linux...)
I might not know much about Linux (I knew a lot more when I was running Redhat 9 a couple of years ago) but I can GET DOWN when it comes to DOS and Windows.
I really wanted to solve this problem from within Linux, but I've got my WHOLE LIFE on that Windows drive, which is why I put Linux on a completely seperate HD to begin with. So I finally said "Screw it." and got my old Windows 98 boot cd and Ranish Partition Manager and GOT DOWN!
Apparently Grub (and I really need to learn more about grub. I read the manual but it doesn't go NEARLY as far in depth as to what it actually DOES) saved my Master Boot Record in perfect condition...
...but it saved it as an unknown IPL. Thus windows and my bios couldn't see it. I think it did the same thing on my Linux drive which is probably why I can't see the NTFS partition that's on THAT.
So I booted into Ranish partition manager where I had the option of switching the MBR type from "Unknown IPL" to "Boot Manager" or "Standard IPL."
I chose "Standard IPL" and Bingo, Bango, Sugar-in-the-gas tank, Windows booted. (I'm typing this from Windows now.)
I love Ranish and I couldn't believe they still had a site up. But I still don't understand how or why grub changed my MBR to an unknown IPL...
Nevertheless now all I have to do is switch the Linux drive's MBR from "Unknown IPL" to "Standard IPL" and Linux should still see the linux stuff just fine and Windows should be able to recognize my NTFS HD. And if it can't? I DON'T CARE! I'll nuke the whole dayyyyum thang! All my CRITICAL info is on this drive.
...but I'd still like to understand why Grub did what it did so I can avoid the problem in the future.
map (hd0) (hd1)
map (hd1) (hd 0)
unhide (hd1,0)
hide (hd1,4)
rootnoverify (hd1,0)
makeactive
Chainloader +1
The unhide and hide commands belonged BEFORE the mapping becuse what this effectively did was hide the partitions on the wrong drive causing linux not to load. And a further suggestion changed the MBR from standard to "Unknown" Causing the windows HD not to boot. Currently Windows is back up and running and Linux is up and running though the Linux drive is in a state of disarray. A complete log of what happened is found below. I'm on the last phase of attempting to put the Linux drive back in order (if anyone has any suggestions of how to do so) and maybe this thread could be useful to someone.
So I had Linux on HD0 and Windows XP and Windows 2003 server on HD1 and I just wanted to get Windows to boot from Grub. http://www.ocforums.com/showthread.php?t=469613
Well... This is what happened.
First I ran:
unhide (hd1,0)
hide (hd1,4)
rootnoverify (hd1,0)
map (hd0) (hd1)
map (hd1) (hd0)
makeactive
chainloader +1
Didn't work. So someone suggested:
map (hd0) (hd1)
map (hd1) (hd0)
unhide (hd1,0)
hide (hd1,4)
rootnoverify (hd1,0)
makeactive
chainloader +1
Didn't work either. So I figured the hell with it and just changed the pins and reversed the drives and booted into windows where I started watching the Chappelle Show lost episodes (off of the linux drive.) Everything was going fine until the Chappelle show got fuzzy and finally wouldn't load anymore. Next time I tried to get into Fedora? THE BLACK GRUB screen.
What did I do? Permanently switch HD0 and HD1? Did I hide HD0,4 instead of HD1,4? I've done something like that before.
When I try to run the command to load Linux manually it tells me it's an "Invalid file system." HELLLLLLLLLLLLLLLP!
POST 2
I'm typing this from Linux now, but it's of extreme importance that I understand what happened. Windows couldn't recognize any drives on the disk AT ALL after Linux went down. When I ran the Rescue mode on the Fedora DVD I could see all the partitions just fine. What could cause this? anyway I'm not sure if I'll even be able to get back into Linux once I logout so let me tell you what I can.
root (hd0,6)
kernel /vmlinuz-2.6.15-1.2054_FC5 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
initrd /initrd-2.6.15-1.2054_FC5.img
That was the default command for me to get into Linux, however it wouldn't load hd0,6 (even though it did before) so I hit 'e' to edit the root command and I got: hainloader
...what the hell is hainloader? Some sort of linux virus? Anyway I dropped to a grub command line tried a couple of things, then I hit 'e' again to edit the root line... and it let me without any weird messages... very odd.
fdisk -l
Disk /dev/hda: 203.9 GB, 203928109056 bytes
255 heads, 63 sectors/track, 24792 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/hda1 2 24792 199133707+ f W95 Ext'd (LBA)
/dev/hda5 2484 3758 10241406 b W95 FAT32
/dev/hda6 * 2 14 104359+ 83 Linux
/dev/hda7 15 2483 19832211 8e Linux LVM
/dev/hda8 3759 24792 168955573+ 7 HPFS/NTFS
So I switch from root (hd0,6) to root (hd0,5) just now and it booted Linux... even though it was most definately hd0,6 before as noted in my "Grub config" thread on this board.
Is this just a one time thing? I might not even be able to boot-up next time. More importantly though, there's some EXTREMELY important data on that NTFS partition. And I can't understand why Windows can't see it.
Can anyone tell me what happened and how to fix it?
POST 3
This is my current fdisk -l
Disk /dev/hda: 203.9 GB, 203928109056 bytes
255 heads, 63 sectors/track, 24792 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/hda1 2 24792 199133707+ f W95 Ext'd (LBA)
/dev/hda5 2484 3758 10241406 b W95 FAT32
/dev/hda6 * 2 14 104359+ 83 Linux
/dev/hda7 15 2483 19832211 8e Linux LVM
/dev/hda8 3759 24792 168955573+ 7 HPFS/NTFS
-----------------------------------------
This is my previous fdisk -l
Device Boot Start End Blocks Id System
/dev/hda1 2 24792 199133707+ f W95 Ext'd (LBA)
/dev/hda5 2484 3758 10241406 b W95 FAT32
/dev/hda6 3759 24792 168955573+ 7 HPFS/NTFS
/dev/hda7 * 2 14 104359+ 83 Linux
/dev/hda8 15 2483 19832211 8e Linux LVM
What happened was hda6 was somehow moved to the bottom and everything under it was bumped up one. How? I have no idea.
but hda6 became hda8, hda7 became hda6, and hda8 became hda7
The start and end blocks are exactly the same however. So I'm thinking if I can just move the NTFS partition back to where it was and change the whole structure back to the way it was originally... then it should work just fine.
Anybody know the easiest way to do that?
POST 4
I'm posting the fdisk command from a Grub-booted fedora. All I did in grub config was change root from (hd0,6) to (hd0,5) I've now changed the windows section as well so the whole thing looks like this:
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,6)
# kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol00
# initrd /initrd-version.img
#boot=/dev/hda
default=0
timeout=5
splashimage=(hd0,5)/grub/splash.xpm.gz
hiddenmenu
title Fedora Core (2.6.15-1.2054_FC5)
root (hd0,5)
kernel /vmlinuz-2.6.15-1.2054_FC5 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
initrd /initrd-2.6.15-1.2054_FC5.img
title Windows
rootnoverify (hd1,0)
makeactive
chainloader +1
----------------------------------------------------------------------------------------------------------------------
I've went through and typed "unhide (hd0,x) for every partition on hd0. Will now go through and do the same for hd1.
POST 5
Quote:
Originally Posted by klingens
First. Check exactly which partition is your boot partition for Windows. Not where windows is installed but BOOT partition. This will be a single partition for the whole system even when you have several Windows versions installed. Then load it from grub via chainload. chainloader is simply a "load sector X on partition Y and treat it as a bootsector". Same thing that your BIOS does to boot anything.
PS: never ever change and map and change drives around between installs of the OSes. It only leads to situtations like yours
Quote:
Disk /dev/hdb: 203.9 GB, 203928109056 bytes
255 heads, 63 sectors/track, 24792 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/hdb1 * 1 6374 51199123+ 7 HPFS/NTFS
/dev/hdb2 6375 12044 45544275 7 HPFS/NTFS
/dev/hdb3 12045 21605 76798732+ 7 HPFS/NTFS
/dev/hdb4 21606 24791 25591545 f W95 Ext'd (LBA)
/dev/hdb5 21606 22880 10241406 7 HPFS/NTFS
Main Windows boot partition is hdb1 as shown.
POST 6
klingens said:Boot flag in partition table is irrelevant. How else do you know it's your boot partition?
Good point. Maybe I don't. Just tried to load windows and it said "Invalid partition." All I did was do
rootnoverify (hd0,0)
makeactive
chainloader +1
Guess that ain't it. I'll try (hd0,1)
POST 7
Okay. Here's how I think I know it was my boot partition:
Because when I switched drives (via a jumper) it would boot right into windows. Now, since I've changed the active partition, if I switch drives it will tell me: Invalid partition.
How else would I be able to check which partition the main boot record is on? It's true that either the Windows XP or Windows 2003 partitions should theorhetically boot into windows (I might be a novice to Linux but I'm an expert in windows) so that it could be that I wasn't ACTUALLY booting into the real master partition. But why is it giving me an invalid partition error now?
My current fdisk -l:
/dev/hdb1 1 6374 51199123+ 7 HPFS/NTFS
/dev/hdb2 6375 12044 45544275 7 HPFS/NTFS
/dev/hdb3 * 12045 21605 76798732+ 7 HPFS/NTFS
/dev/hdb4 21606 24791 25591545 f W95 Ext'd (LBA)
/dev/hdb5 21606 22880 10241406 7 HPFS/NTFS
As you can see the system is flagged to boot (hd1,2) but I've already tried turning it back to (hd1,0) but it doesn't work.
Here's exactly what I did (basically followed your directions exactly
unhide (hd1,x) unhid all of the partitions available.
rootnoverify (hd1,0) to select the main bootrecord I would imagine
makeactive to set that partition as the active boot partition
chainloader +1
And that was it. It didn't work of course (never loaded anything ever without the map functions) so I changed drives and just tried to get back into windows and it gave me the "invalid partition" error right after post.
Then I tried hd1,1... then hd1,2 (which is where we are now) So like I said the active partition is set to hd1,2 now. I can change it back to hd1,0 using:
rootnoverify (hd1,0)
makeactive
chainloader +1
It won't work since it's exactly what got me into this me into this mess in the first place.
I know this is probably all stupidity layered upon stupidity... but it will be wonderful if I can actually learn why all this is happening. Then I'll understand exactly how it all works. I'm sorry to put anyone through any trouble in helping me, but it's very important that I understand (and important that I get back into windows and get my data back of course.)
POST 8?
Okay, so I believe what's happening is that the drive is now looking for it's own boot record on (hd1,0)... to the effect that when I switch drives it's STILL looking for it's own boot record on (hd1,0) even when I change the jumper so that it should actually be hd0,0.
To verify this (and you're not going to like this) I ran the old:
title Windows
rootnoverify (hd1,0)
map (hd0) (hd1)
map (hd1) (hd0)
makeactive
chainloader +1
And PRESTO! Found myself at the Windows Bootloader.
It didn't load of course (what we found out on the "Grub Config" thread is that it NEVER loaded) but at least now I have a clearer understanding for what's happening.
So maybe
rootnoverify hd0,0
makeactive
chainloader +1 would work for me.
We'll see...
POST 9
Now... I don't mean to imply that I'm the GREATEST tech in the world... (though I might be after I've mastered Linux...)
I might not know much about Linux (I knew a lot more when I was running Redhat 9 a couple of years ago) but I can GET DOWN when it comes to DOS and Windows.
I really wanted to solve this problem from within Linux, but I've got my WHOLE LIFE on that Windows drive, which is why I put Linux on a completely seperate HD to begin with. So I finally said "Screw it." and got my old Windows 98 boot cd and Ranish Partition Manager and GOT DOWN!
Apparently Grub (and I really need to learn more about grub. I read the manual but it doesn't go NEARLY as far in depth as to what it actually DOES) saved my Master Boot Record in perfect condition...
...but it saved it as an unknown IPL. Thus windows and my bios couldn't see it. I think it did the same thing on my Linux drive which is probably why I can't see the NTFS partition that's on THAT.
So I booted into Ranish partition manager where I had the option of switching the MBR type from "Unknown IPL" to "Boot Manager" or "Standard IPL."
I chose "Standard IPL" and Bingo, Bango, Sugar-in-the-gas tank, Windows booted. (I'm typing this from Windows now.)
I love Ranish and I couldn't believe they still had a site up. But I still don't understand how or why grub changed my MBR to an unknown IPL...
Nevertheless now all I have to do is switch the Linux drive's MBR from "Unknown IPL" to "Standard IPL" and Linux should still see the linux stuff just fine and Windows should be able to recognize my NTFS HD. And if it can't? I DON'T CARE! I'll nuke the whole dayyyyum thang! All my CRITICAL info is on this drive.
...but I'd still like to understand why Grub did what it did so I can avoid the problem in the future.
Last edited: