Gentoo Archives: gentoo-user

From: Mick <michaelkintzios@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Why grub can't load win kernel
Date: Wed, 05 Oct 2011 19:54:40
Message-Id: 201110052053.42066.michaelkintzios@gmail.com
In Reply to: [gentoo-user] Why grub can't load win kernel by Lavender <448463782@qq.com>
1 On Wednesday 05 Oct 2011 16:32:10 Lavender wrote:
2 > The configuration of win kernel in grub.conf is like below:
3 >
4 > rootnoverify (hd0,0)
5 > makeactive
6 > chainloader +1
7
8 Assuming that your MSWindows OS is on the first partition of the first (master)
9 disk then the above is correct and grub should boot it fine; i.e. MSWindows is
10 on /dev/sda1
11
12
13 > It worked yesterday , but after I rebuilding grub software, it can't work.
14 > I don't know why, it still can boot gentoo kernel, I am confused,because
15 > grub only can do operations to MBR, it can not influence contents on
16 > windows partition.
17
18 This is not entirely correct. GRUB will write its boot code where-ever *you*
19 tell it to write it ...
20
21 For example if you installed it on MSWindows' partition - instead of the disk
22 MBR - you will most likely not be able to boot MSWindows! This is because you
23 have overwritten the partition table with GRUB's code and GRUB cannot natively
24 boot MSWindows.
25
26 If for example you ran:
27
28 grub-install /dev/sda1
29
30 instead of the correct stanza of:
31
32 grub-install /dev/sda
33
34 you would have written GRUB on the wrong place, the first partition boot
35 record, instead of the disk's Master Boot Record. Of course your old GRUB
36 code in the MBR is still there and it happily boots Linux.
37
38
39 > I also tried boot manually in grub command interface, but after showing
40 > "load stage2" it goes back to grub > .... I'm gonna pissed..... I have
41 > many important things in windows system, will someone figure it out?
42
43 Calm down.
44
45 Your data is still there. Just the partition table has been overwritten - if
46 indeed you typed the wrong device as I suspect above. So the command you need
47 is fixboot and you need to run this from a MSWindows installation CD/USB stick
48 on the first partition.
49
50 Have a look on the Internet for more details on the fixboot command and its
51 modern equivalent (if you're running Windows7). Also have a look on the
52 Internet for MSWindows CDs or USB sticks to be able to run the command if you
53 don't have one handy.
54
55 HTH.
56 --
57 Regards,
58 Mick

Attachments

File name MIME type
signature.asc application/pgp-signature