Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Failed Install of Win2k Renders Gentoo Unbootable
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
John R. Graham
Administrator
Administrator


Joined: 08 Mar 2005
Posts: 4844
Location: Somewhere over Atlanta, Georgia

PostPosted: Thu Aug 16, 2007 4:48 pm    Post subject: Failed Install of Win2k Renders Gentoo Unbootable Reply with quote

I have a test machine at the office that I've had Gentoo running on it just fine for some time: conservative CFLAGS, nice stable desktop install with KDE.

I then had the need to test some software under Win2k and, since there was unpartitioned space at the end of the drive, I thought it would be no problem. I booted my Win2k Pro install CD but was unable to install Win2k. Although the Win2k installer created the partition, it then claimed that, "...this disk does not contain a Windows 2000 compatible partition." Retrying, expectedly, didn't help.

Then came nasty surprise number 1. The Win2k install CD had already messed with the MBR and Gentoo would no longer boot. A message I'd never seen before claimed that there was no available bootstrap. Hmmm. I booted from a Live CD, chrooted into my environment, and setup grub again. You know, like this:
Code:
vesta ~ # grub
Probing devices to guess BIOS drives. This may take a long time.
    GNU GRUB  version 0.97  (640K lower / 3072K upper memory)

 [ Minimal BASH-like line editing is supported.  For the first word, TAB
   lists possible command completions.  Anywhere else TAB lists the possible
   completions of a device/filename. ]

grub> root (hd0,0)
 Filesystem type is ext2fs, partition type 0x83

grub> setup (hd0)
 Checking if "/boot/grub/stage1" exists... yes
 Checking if "/boot/grub/stage2" exists... yes
 Checking if "/boot/grub/e2fs_stage1_5" exists... yes
 Running "embed /boot/grub/e2fs_stage1_5 (hd0)"...  16 sectors are embedded.
succeeded
 Running "install /boot/grub/stage1 (hd0) (hd0)1+16 p (hd0,0)/boot/grub/stage2 /boot/grub/menu.lst"... succeeded
Done.

grub> quit

Next came nasty surprise number 2: the system still wouldn't boot. This time, there was evidence of a crash on the screen: a semi-random, non-meaningful string of characters displayed and the system was locked up, responsive only to the three-finger salute (Ctrl-Alt-Del).

The last arsenal in my bag of tricks was to use a floppy-based boot manager, something I have used in the past to boot the Gentoo install CDs on machines with very old BIOSs that don't suppport boot from CD. I used "Smart Boot Manager" and told it to boot from the first hard drive, and voila! I had my Grub menu back and, from there, Gentoo booted up normally.

So it appears that the Win2k setup had placed something in the MBR that the grub "setup" command is too polite to overwrite. Alas, I see a backup / reformat / repartition / restore in my future, if for no other reason than to get Win2k installed, which appears to want to go first. (Windows can be a pushy bastard at times, can't it?) Right now, my system still requires a floppy to boot, which, although not too inconvenient, is annoying me on general principles.

But my question is, is there a way to fix the damage, and, what, if anything, did I do wrong?

- John
Back to top
View user's profile Send private message
Ingmarv
Retired Dev
Retired Dev


Joined: 27 Feb 2007
Posts: 188
Location: Belgium

PostPosted: Thu Aug 16, 2007 5:33 pm    Post subject: Re: Failed Install of Win2k Renders Gentoo Unbootable Reply with quote

No real advice from me, only this: try to install lilo to the MBR from a livecd, just so you can boot gentoo

john_r_graham wrote:
Alas, I see a backup / reformat / repartition / restore in my future, if for no other reason than to get Win2k installed, which appears to want to go first. (Windows can be a pushy bastard at times, can't it?) Right now, my system still requires a floppy to boot, which, although not too inconvenient, is annoying me on general principles.

But my question is, is there a way to fix the damage, and, what, if anything, did I do wrong?


You can make windows think it's first on the disk though, see the grub faq-entry on 'How to boot Windows (or DOS) from a non-first disk?' : http://www.gnu.org/software/grub/grub-faq.en.html#q10
Back to top
View user's profile Send private message
Hypnos
Advocate
Advocate


Joined: 18 Jul 2002
Posts: 2366
Location: Omnipresent

PostPosted: Thu Aug 16, 2007 7:36 pm    Post subject: Reply with quote

Quote:
So it appears that the Win2k setup had placed something in the MBR that the grub "setup" command is too polite to overwrite. Alas, I see a backup / reformat / repartition / restore in my future, if for no other reason than to get Win2k installed, which appears to want to go first. (Windows can be a pushy bastard at times, can't it?) Right now, my system still requires a floppy to boot, which, although not too inconvenient, is annoying me on general principles.


* Yes, Windows wants to be first. I think OSX is the same way -- a design decision for OSes used to being preloaded by OEM :D

* That's pretty weird about MBR and the grub -- it may be corrupted (hard disk experts: is this even possible?). One thing to try is to use to Windows' fdisk utility to rewrite the MBR before doing grub setup:

Code:
# fdisk /mbr


I think there's a way to do this in Linux, but I don't remember how.
_________________
If you don't have backups, you deserve to lose your data -- read about my simple backup scheme.
Back to top
View user's profile Send private message
darkphader
Veteran
Veteran


Joined: 09 May 2002
Posts: 1054
Location: Motown

PostPosted: Thu Aug 16, 2007 10:22 pm    Post subject: Reply with quote

You can use dd to write/save/restore/destroy the MBR (the first 512 bytes of the drive) or part of it.
The MBR does contain the partition table, so if you don't want to f*ck with the partition table only work with the first 446 bytes.

Chris
_________________
To our sweethearts and wives. May they never meet.
Back to top
View user's profile Send private message
RaceTM
Apprentice
Apprentice


Joined: 16 Feb 2004
Posts: 281

PostPosted: Fri Aug 17, 2007 12:04 am    Post subject: Reply with quote

Can you pos the output of fdisk -l for the disk in question?
Back to top
View user's profile Send private message
Hu
Watchman
Watchman


Joined: 06 Mar 2007
Posts: 6825

PostPosted: Fri Aug 17, 2007 3:28 am    Post subject: Reply with quote

If you do not require high performance from the Windows 2000 system, you could install it in a virtual machine running under Gentoo, to avoid risking your hard disk again after you finish the current repairs. Both app-emulation/qemu and app-emulation/bochs are virtual machine packages available from Portage.
Back to top
View user's profile Send private message
John R. Graham
Administrator
Administrator


Joined: 08 Mar 2005
Posts: 4844
Location: Somewhere over Atlanta, Georgia

PostPosted: Fri Aug 17, 2007 2:47 pm    Post subject: Reply with quote

RaceTM wrote:
Can you pos the output of fdisk -l for the disk in question?
Sure, but I don't think that's the issue. Here it is:
Code:
vesta ~ # fdisk -l

Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1          17      136521   83  Linux
/dev/sda2              18         278     2096482+  82  Linux swap / Solaris
/dev/sda3             279        5500    41945715   83  Linux
/dev/sda4            5501       19457   112109602+   5  Extended
/dev/sda5            5501       10722    41945683+  83  Linux
vesta ~ #

- John
Back to top
View user's profile Send private message
John R. Graham
Administrator
Administrator


Joined: 08 Mar 2005
Posts: 4844
Location: Somewhere over Atlanta, Georgia

PostPosted: Fri Aug 17, 2007 3:13 pm    Post subject: Reply with quote

Some news. I acquired a Windows 98 (!) boot floppy and used
Code:
fdisk /mbr
as recommended by Hypnos to rewrite the master boot record. What this did was put the disk back in the state where the BIOS (I now realize) is saying that there's no known boot device. So, after that, I re-ran the grub setup procedure, just like I described in the original post, and this put the system back in the state that it crashes while trying to boot, just like I described in the original post. (At this point, I can boot from the "Smart Boot Manager" disk and thence into Grub and normally boot from there.) So, at least I'm no worse off. :?

At appropriate places in each of these steps, I collected forensic evidence from the MBR with dd, like this:
Code:
# mount /dev/fd0 /mnt/floppy
# dd bs=512 count=1 if=/dev/sda of=/mnt/floppy/venus_borked.txt
# umount /mnt/floppy
Here are hex dumps of the three states of the MBR:
Original Borked State:
000000 eb 48 90 d0 bc 00 7c fb 50 07 50 1f fc be 1b 7c
000010 bf 1b 06 50 57 b9 e5 01 f3 a4 cb bd be 07 b1 04
000020 38 6e 00 7c 09 75 13 83 c5 10 e2 f4 cd 18 8b f5
000030 83 c6 10 49 74 19 38 2c 74 f6 a0 b5 07 b4 03 02
000040 ff 00 00 20 01 00 00 00 00 02 fa 90 90 00 ea 53
000050 7c 00 00 31 c0 8e d8 8e d0 bc 00 20 fb a0 40 7c
000060 3c ff 74 02 88 c2 52 be 79 7d e8 34 01 f6 c2 80
000070 74 54 b4 41 bb aa 55 cd 13 5a 52 72 49 81 fb 55
000080 aa 75 43 a0 41 7c 84 c0 75 05 83 e1 01 74 37 66
000090 8b 4c 10 be 05 7c c6 44 ff 01 66 8b 1e 44 7c c7
0000a0 04 10 00 c7 44 02 01 00 66 89 5c 08 c7 44 06 00
0000b0 70 66 31 c0 89 44 04 66 89 44 0c b4 42 cd 13 72
0000c0 05 bb 00 70 eb 7d b4 08 cd 13 73 0a f6 c2 80 0f
0000d0 84 f0 00 e9 8d 00 be 05 7c c6 44 ff 00 66 31 c0
0000e0 88 f0 40 66 89 44 04 31 d2 88 ca c1 e2 02 88 e8
0000f0 88 f4 40 89 44 08 31 c0 88 d0 c0 e8 02 66 89 04
000100 66 a1 44 7c 66 31 d2 66 f7 34 88 54 0a 66 31 d2
000110 66 f7 74 04 88 54 0b 89 44 0c 3b 44 08 7d 3c 8a
000120 54 0d c0 e2 06 8a 4c 0a fe c1 08 d1 8a 6c 0c 5a
000130 8a 74 0b bb 00 70 8e c3 31 db b8 01 02 cd 13 72
000140 2a 8c c3 8e 06 48 7c 60 1e b9 00 01 8e db 31 f6
000150 31 ff fc f3 a5 1f 61 ff 26 42 7c be 7f 7d e8 40
000160 00 eb 0e be 84 7d e8 38 00 eb 06 be 8e 7d e8 30
000170 00 be 93 7d e8 2a 00 eb fe 47 52 55 42 20 00 47
000180 65 6f 6d 00 48 61 72 64 20 44 69 73 6b 00 52 65
000190 61 64 00 20 45 72 72 6f 72 00 bb 01 00 b4 0e cd
0001a0 10 ac 3c 00 75 f4 c3 00 00 00 00 00 00 00 00 00
0001b0 00 00 00 00 00 00 00 00 09 78 0b 00 00 00 00 01
0001c0 01 00 83 fe 3f 10 3f 00 00 00 92 2a 04 00 00 00
0001d0 01 11 82 fe 7f 15 d1 2a 04 00 c5 fa 3f 00 00 00
0001e0 41 16 83 fe ff ff 96 25 44 00 e6 14 00 05 00 fe
0001f0 ff ff 05 fe ff ff 7c 3a 44 05 45 50 5d 0d 55 aa
After Running Win98 fdisk /mbr:
000000 33 c0 8e d0 bc 00 7c fb 50 07 50 1f fc be 1b 7c
000010 bf 1b 06 50 57 b9 e5 01 f3 a4 cb be be 07 b1 04
000020 38 2c 7c 09 75 15 83 c6 10 e2 f5 cd 18 8b 14 8b
000030 ee 83 c6 10 49 74 16 38 2c 74 f6 be 10 07 4e ac
000040 3c 00 74 fa bb 07 00 b4 0e cd 10 eb f2 89 46 25
000050 96 8a 46 04 b4 06 3c 0e 74 11 b4 0b 3c 0c 74 05
000060 3a c4 75 2b 40 c6 46 25 06 75 24 bb aa 55 50 b4
000070 41 cd 13 58 72 16 81 fb 55 aa 75 10 f6 c1 01 74
000080 0b 8a e0 88 56 24 c7 06 a1 06 eb 1e 88 66 04 bf
000090 0a 00 b8 01 02 8b dc 33 c9 83 ff 05 7f 03 8b 4e
0000a0 25 03 4e 02 cd 13 72 29 be 46 07 81 3e fe 7d 55
0000b0 aa 74 5a 83 ef 05 7f da 85 f6 75 83 be 27 07 eb
0000c0 8a 98 91 52 99 03 46 08 13 56 0a e8 12 00 5a eb
0000d0 d5 4f 74 e4 33 c0 cd 13 eb b8 00 00 00 00 00 00
0000e0 56 33 f6 56 56 52 50 06 53 51 be 10 00 56 8b f4
0000f0 50 52 b8 00 42 8a 56 24 cd 13 5a 58 8d 64 10 72
000100 0a 40 75 01 42 80 c7 02 e2 f7 f8 5e c3 eb 74 49
000110 6e 76 61 6c 69 64 20 70 61 72 74 69 74 69 6f 6e
000120 20 74 61 62 6c 65 00 45 72 72 6f 72 20 6c 6f 61
000130 64 69 6e 67 20 6f 70 65 72 61 74 69 6e 67 20 73
000140 79 73 74 65 6d 00 4d 69 73 73 69 6e 67 20 6f 70
000150 65 72 61 74 69 6e 67 20 73 79 73 74 65 6d 00 00
000160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*
000180 00 00 00 8b fc 1e 57 8b f5 cb 00 00 00 00 00 00
000190 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*
0001b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01
0001c0 01 00 83 fe 3f 10 3f 00 00 00 92 2a 04 00 00 00
0001d0 01 11 82 fe 7f 15 d1 2a 04 00 c5 fa 3f 00 00 00
0001e0 41 16 83 fe ff ff 96 25 44 00 e6 14 00 05 00 fe
0001f0 ff ff 05 fe ff ff 7c 3a 44 05 45 50 5d 0d 55 aa
After Setting up Grub Again:
000000 eb 48 90 d0 bc 00 7c fb 50 07 50 1f fc be 1b 7c
000010 bf 1b 06 50 57 b9 e5 01 f3 a4 cb be be 07 b1 04
000020 38 2c 7c 09 75 15 83 c6 10 e2 f5 cd 18 8b 14 8b
000030 ee 83 c6 10 49 74 16 38 2c 74 f6 be 10 07 03 02
000040 ff 00 00 20 01 00 00 00 00 02 fa 90 90 00 ea 53
000050 7c 00 00 31 c0 8e d8 8e d0 bc 00 20 fb a0 40 7c
000060 3c ff 74 02 88 c2 52 be 79 7d e8 34 01 f6 c2 80
000070 74 54 b4 41 bb aa 55 cd 13 5a 52 72 49 81 fb 55
000080 aa 75 43 a0 41 7c 84 c0 75 05 83 e1 01 74 37 66
000090 8b 4c 10 be 05 7c c6 44 ff 01 66 8b 1e 44 7c c7
0000a0 04 10 00 c7 44 02 01 00 66 89 5c 08 c7 44 06 00
0000b0 70 66 31 c0 89 44 04 66 89 44 0c b4 42 cd 13 72
0000c0 05 bb 00 70 eb 7d b4 08 cd 13 73 0a f6 c2 80 0f
0000d0 84 f0 00 e9 8d 00 be 05 7c c6 44 ff 00 66 31 c0
0000e0 88 f0 40 66 89 44 04 31 d2 88 ca c1 e2 02 88 e8
0000f0 88 f4 40 89 44 08 31 c0 88 d0 c0 e8 02 66 89 04
000100 66 a1 44 7c 66 31 d2 66 f7 34 88 54 0a 66 31 d2
000110 66 f7 74 04 88 54 0b 89 44 0c 3b 44 08 7d 3c 8a
000120 54 0d c0 e2 06 8a 4c 0a fe c1 08 d1 8a 6c 0c 5a
000130 8a 74 0b bb 00 70 8e c3 31 db b8 01 02 cd 13 72
000140 2a 8c c3 8e 06 48 7c 60 1e b9 00 01 8e db 31 f6
000150 31 ff fc f3 a5 1f 61 ff 26 42 7c be 7f 7d e8 40
000160 00 eb 0e be 84 7d e8 38 00 eb 06 be 8e 7d e8 30
000170 00 be 93 7d e8 2a 00 eb fe 47 52 55 42 20 00 47
000180 65 6f 6d 00 48 61 72 64 20 44 69 73 6b 00 52 65
000190 61 64 00 20 45 72 72 6f 72 00 bb 01 00 b4 0e cd
0001a0 10 ac 3c 00 75 f4 c3 00 00 00 00 00 00 00 00 00
0001b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01
0001c0 01 00 83 fe 3f 10 3f 00 00 00 92 2a 04 00 00 00
0001d0 01 11 82 fe 7f 15 d1 2a 04 00 c5 fa 3f 00 00 00
0001e0 41 16 83 fe ff ff 96 25 44 00 e6 14 00 05 00 fe
0001f0 ff ff 05 fe ff ff 7c 3a 44 05 45 50 5d 0d 55 aa

Beyond noting that all three are different, I don't know what to make of that. I've also noted that the Grub file called /boot/grub/stage1 is different from each of those as well. I thought, perhaps, that its name implied that it was the executable portion of the MBR, but I'm not sure.

- John
Back to top
View user's profile Send private message
Hypnos
Advocate
Advocate


Joined: 18 Jul 2002
Posts: 2366
Location: Omnipresent

PostPosted: Fri Aug 17, 2007 4:29 pm    Post subject: Reply with quote

Some more trickeration:

http://neosmart.net/blog/2005/repairing-a-fubard-master-boot-record/
http://neosmart.net/blog/2005/fixing-a-broken-mbr/

If this doesn't work, I'd back up my data, then take darkphader's advice and zero out the MBR using dd. Hopefully grub would work then.
_________________
If you don't have backups, you deserve to lose your data -- read about my simple backup scheme.
Back to top
View user's profile Send private message
cyrillic
Watchman
Watchman


Joined: 19 Feb 2003
Posts: 7301
Location: Groton, Massachusetts USA

PostPosted: Fri Aug 17, 2007 4:57 pm    Post subject: Re: Failed Install of Win2k Renders Gentoo Unbootable Reply with quote

john_r_graham wrote:
... since there was unpartitioned space at the end of the drive, I thought it would be no problem. I booted my Win2k Pro install CD but was unable to install Win2k. Although the Win2k installer created the partition, it then claimed that, "...this disk does not contain a Windows 2000 compatible partition." Retrying, expectedly, didn't help.

One thing to keep in mind is : Windows cannot boot from an extended partition.

The Windows installer requires a primary partition to install NTLDR, and has been known on occasion to hijack a Linux partition for this purpose.

In your case, it looks like this didn't work, so the Windows installer just gave up.
Back to top
View user's profile Send private message
John R. Graham
Administrator
Administrator


Joined: 08 Mar 2005
Posts: 4844
Location: Somewhere over Atlanta, Georgia

PostPosted: Fri Aug 17, 2007 5:24 pm    Post subject: Reply with quote

Yes, I eventually figured that part out. I will ultimately be backing up the whole darned thing and repartitioning it so I can give Windows a primary. Still, I haven't figured out why I can't get the thing to boot on its own.

- John
Back to top
View user's profile Send private message
PhoeniXII
n00b
n00b


Joined: 23 Jun 2005
Posts: 27
Location: Holland aka "the flat country"

PostPosted: Fri Aug 17, 2007 10:43 pm    Post subject: Reply with quote

like Hu mentioned ,
if you got enough mem, an virtual pc could b just what you need to test some stuff,
i don't have any experience with the apps he mentioned but vmware-workstation and virtualbox (that one is free) works like a
charm over here while i emulate a win2k3 domain with 3 comps running for my studies.

then you wouldn't have to repartition your disk,
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum