1 |
On Sun, Apr 08, 2007 at 11:17:47AM +0100, Peter Humphrey wrote: |
2 |
> Watch this: |
3 |
> |
4 |
> # fdisk -l /dev/hda |
5 |
> [...] |
6 |
> Device Boot Start End Blocks Id System |
7 |
> /dev/hda1 * 1 7 56196 83 Linux |
8 |
> [...] |
9 |
> |
10 |
> # emerge grub-static |
11 |
> Calculating dependencies ..... ..... ..... .... done! |
12 |
> >>> Verifying ebuild Manifests... |
13 |
> |
14 |
> >>> Emerging (1 of 1) sys-boot/grub-static-0.97 to / |
15 |
> [...] |
16 |
> >>> sys-boot/grub-static-0.97 merged. |
17 |
> [...] |
18 |
> # fdisk -l /dev/hda |
19 |
> |
20 |
> Disk /dev/hda: 80.0 GB, 80026361856 bytes |
21 |
> [...] |
22 |
> Device Boot Start End Blocks Id System |
23 |
> /dev/hda1 1 7 56196 93 Amoeba |
24 |
> [...] |
25 |
|
26 |
ok.. that's insane. Looking at the ebuild, the only thing I see that |
27 |
could do that is the call to grub itself, and it's probably a serious |
28 |
bug, possibly writing a bit or byte to the wrong block of the drive. |
29 |
This looks similar: |
30 |
http://www.computing.net/linux/wwwboard/forum/28589.html |
31 |
I would suggest narrowing it down by running 'fsdisk' in the ebuild |
32 |
directly before and after the grub invocation: |
33 |
|
34 |
fdisk -l /dev/hda; sleep 3 |
35 |
/sbin/grub --batch \ |
36 |
--device-map="${dir}"/grub/device.map \ |
37 |
> /dev/null |
38 |
fdisk -l /dev/hda; sleep 3 |
39 |
|
40 |
and if that does, indeed, change the partition table, then file a bug |
41 |
with the grub: |
42 |
http://www.gnu.org/software/grub/grub-legacy-bugs.en.html |
43 |
|
44 |
> Now I'm going to have to boot a CD and run fdisk to delete and |
45 |
> re-create /dev/hda1, then chroot to the root partition and run grub to |
46 |
> reinstall itself. |
47 |
|
48 |
So long as you don't restart, just running 'fdisk' and resetting the |
49 |
type should do the trick. The kernel won't recognize the change |
50 |
immediately, but that's ok -- it will be written to disk (for better or |
51 |
worse, this is exactly what grub's doing). So you should be able to |
52 |
test this without having to restart. |
53 |
|
54 |
> I haven't thought of doing that; perhaps I should try it. I used to use |
55 |
> grub-static a few years ago when 64-bit grub had not yet been developed, in |
56 |
> accordance with the standard installation instructions of the time; I |
57 |
> suppose I've just stuck with it. |
58 |
|
59 |
>From the look of the ebuild, there is no 64-bit version -- it builds a |
60 |
32-bit version unconditionally. I may be misreading that, though. |
61 |
|
62 |
> It turns out that 'world' does have grub-static, not grub. Sorry I was |
63 |
> unclear about that. How would I arrange package.* to pass --usepkg to |
64 |
> emerge? Maybe I won't have to if your suggestion works (USE=static emerge |
65 |
> grub). |
66 |
|
67 |
--usepkg just uses a previously compiled package somewhere on your |
68 |
system. My point was not to cause portage to automatically use that |
69 |
package, but to cause it to recompile the package with exactly the same |
70 |
parameters as those used to create the package. You may have to |
71 |
mask/unmask versions to lock into the right one. |
72 |
|
73 |
Dustin |
74 |
-- |
75 |
gentoo-amd64@g.o mailing list |