Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 98248

Summary: XP unbootable since last kernel update
Product: Gentoo Linux Reporter: Timo Nentwig <gentoo>
Component: [OLD] Core systemAssignee: Gentoo's Team for Core System packages <base-system>
Status: RESOLVED CANTFIX    
Severity: critical    
Priority: High    
Version: unspecified   
Hardware: x86   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Timo Nentwig 2005-07-07 10:52:40 UTC
# uname -a 
Linux notebook 2.6.11-gentoo-r11 #5 Sun Jul 3 16:16:32 GMT 2005 i686 Intel(R) 
Pentium(R) M processor 1.60GHz GenuineIntel GNU/Linux 
 
After the last kernel update gentoo did not boot no more and I had to 
re-install GRUB (and was wondering why). Now gentoo boots but XP on another 
partition does no more. This may be the same problem as described here: 
 
http://www.redhat.com/archives/fedora-devel-list/2004-May/msg00908.html 
 
I cannot even start the Windows recovery CD.  
 
This applies to Windows installed on a notebook, i.e. I have a special 
recovery partition at the very beginning of the hard drive, before the XP 
drive. This may be the cause why the simple command suggested in the redhat 
doc above does not work out-of-the-box: 
 
# sfdisk -d /dev/hda | sfdisk --no-reread -H255 /dev/hda 
 
Disk /dev/hda: 9663 cylinders, 255 heads, 63 sectors/track 
Old situation: 
Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0 
 
   Device Boot Start     End   #cyls    #blocks   Id  System 
/dev/hda1          0+      2-      3-     16384   12  Compaq diagnostics 
/dev/hda2   *      2+   4963-   4962-  39853639    7  HPFS/NTFS 
/dev/hda3       4963+   4967       5-     35405+  83  Linux 
/dev/hda4       4979    9662    4684   37624230    5  Extended 
                start: (c,h,s) expected (1023,254,63) found (1023,0,1) 
/dev/hda5       4979+   9531    4553-  36571938+  83  Linux 
                start: (c,h,s) expected (1023,254,63) found (1023,1,6) 
/dev/hda6       9532+   9662     131-   1052226   82  Linux swap / Solaris 
                start: (c,h,s) expected (1023,254,63) found (1023,1,1) 
New situation: 
Units = sectors of 512 bytes, counting from 0 
 
   Device Boot    Start       End   #sectors  Id  System 
/dev/hda1            63     32830      32768  12  Compaq diagnostics 
/dev/hda2   *     32831  79740108   79707278   7  HPFS/NTFS 
/dev/hda3      79740109  79810919      70811  83  Linux 
/dev/hda4      79987635 155236094   75248460   5  Extended 
/dev/hda5      79987703 153131579   73143877  83  Linux 
/dev/hda6     153131643 155236094    2104452  82  Linux swap / Solaris 
Warning: partition 1 does not end at a cylinder boundary 
 
sfdisk: I don't like these partitions - nothing changed. 
(If you really want this, use the --force option.) 
 

Reproducible: Always
Steps to Reproduce:
1.
2.
3.
Comment 1 Timo Nentwig 2005-07-07 12:39:23 UTC
jakub, with all due respect, I still think that this is by far not a "normal" 
problem. 
Comment 2 Daniel Drake (RETIRED) gentoo-dev 2005-07-07 14:05:05 UTC
Not a kernel problem, kernel is not involved with booting other OS.
Comment 3 Martin Schlemmer (RETIRED) gentoo-dev 2005-07-07 16:08:15 UTC
I cannot think that that link is related if you did not repartition the harddrive?
Comment 4 Joshua Kinard gentoo-dev 2005-07-07 17:06:02 UTC
To be honest, you're probably better off finding a way to do the following:
    A) Nuke the recovery partition.  A manufacturer's general idea of
       "Recovery" is format and factory reset.  These cause more problems
       than they're worth.
    B) Boot a Windows XP Setup CD, drop to Recovery Console, run "fixmbr"
       to restore the Windows XP Bootloader to the MBR.
    C) Once you've verified XP to work again, focus on fixing the
       Linux Partitions, and get Grub/Lilo to play nice with XP.

As this goes beyonds the bounds of Gentoo, I'm marking as invalid.  If you can
pin the problem to actually being caused by a Gentoo process (running lilo/grub
install, or something done via emerge, or a flaw in the documentation), then
feel free to re-open.
Comment 5 Timo Nentwig 2005-07-08 10:59:32 UTC
Yes, I also though about nuking that recovery partition but I'm not sure 
whether this will solve the problem since the XP CD does not even start right 
now, I don't even get to the recovery console. And have no idea why this is 
the case and I don't think that this problem will go awat just by nuking the 
recovery partition. 
 
What I did was 
 
# emerge -u world (actually kernel update) 
# make && make modules && make modules_install 
# cp bzImage /boot/kernel-andsoon 
# cp System.map /boot/System.map-andsoon 
# reboot 
 
-> gentoo would not boot no more (didn't try XP) 
 
# grub_install /dev/hda -dont_remember_exact_settings 
 
-> gentoo boots, XP does not 
 
I don't understand why I even had to re-install GRUB. 
 
 
Comment 6 SpanKY gentoo-dev 2005-07-08 13:40:51 UTC
if your system doesnt boot from CD that has nothing to do with linux/grub but
rather with your bios settings

us trying to debug your system remotely isnt too viable; your best bet is to
debug it locally or try and find someone who experienced a similar problem on
http://forums.gentoo.org
Comment 7 Joshua Kinard gentoo-dev 2005-07-08 17:45:39 UTC
The reason I comment that those recovery partitions are more trouble than
they're worth is usually because they're non-standard.  I've never seen a tool
that creates a "Compaq diagnostics" type of partition.  In the few systems that
I've seen them on, I've never seen a tool that activates them.  Probably because
I don't bother to read the documentation that came with the system.  AFAIAC, a
x86 box is an x86 box, and Windows XP is Windows XP.  They should behave the
same regardless of manufacturer or system design, although this is not always
the case (especially with laptops).

If you use a standard partition layout capable of dual booting, it usually looks
something like this:

Device      Boot       Start      End     Id    Type
/dev/hda1    Y          ???        ??      7     NTFS
/dev/hda2    N          ???        ??      5     Extended
/dev/hda5    N          ???        ??     83     Linux Native
/dev/hda6    N          ???        ??     82     Linux Swap

Use lilo (it's not as pretty as grub, but it gets the job done), let it override
your XP bootloader (NTLDR), and let it manage booting off of /dev/hda5 for
Linux, or chain-load /dev/hda1 for XP.  OTOH, you can install something like
lilo/grub into /dev/hda5's header (instead of /dev/hda's MBR), and use NTLDR to
chainload a linux install (by editing C:\boot.ini; google for a HOWTO on this
for better info).

With regards to the recovery CD, you're not specific on why it doesn't load, so
I surmise the following things:
        A) The CD is damaged
        B) The XP install is toasted, so Recovery Console (if you get that far)
           finds nothing to fix
        C) BIOS settings are fubar

You might also try visiting www.bootdisk.com, get 6 fresh floppy disks, and
download the WinXP bootdisk set (it takes 6 floppies).  This will boot the
equivalent of the WinXP setup program that lets you activate the Recovery Console.

Also, looking at the command listing you give, if copying System.map and
rebooting were the final two commands you did, then it's likely something ate
your MBR, bootloader, or XP partition at a previous point.  That or you just
overwrote your main, booting kernel (never a good idea, always keep a working
backup), and thus when you tried to reboot, the new kernel was bad, and didn't
boot.  The listed RedHat bug also is a year old, and I imagine is one already
squashed in the kernel, if it is a kernel problem, or was fedora-specific, and
squashed there.

If this had been a bonafinde, reproducable problem on gentoo systems, you would
not be the first to report it.
Comment 8 Timo Nentwig 2005-07-09 03:18:45 UTC
CDs are ok 
I don't get to the recovery console 
and I didn't touch BIOS settings... 
Comment 9 Martin Schlemmer (RETIRED) gentoo-dev 2005-07-09 03:31:16 UTC
I have seen XP behave like this before if it do not like something about the
partition tables ... it will just lock at a certain point (sometimes before even
getting to the 'blue setup dialog' part ... sorry, havent done it in a while).

Comment 10 Timo Nentwig 2005-07-09 05:38:37 UTC
Hmm, I cannot even mount the XP parition: 
 
notebook ~ # sfdisk -l /dev/hda 
 
Disk /dev/hda: 9663 cylinders, 255 heads, 63 sectors/track 
Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0 
 
   Device Boot Start     End   #cyls    #blocks   Id  System 
/dev/hda1          0+      2-      3-     16384   12  Compaq diagnostics 
/dev/hda2   *      2+   4963-   4962-  39853639    7  HPFS/NTFS 
/dev/hda3       4963+   4967       5-     35405+  83  Linux 
/dev/hda4       4979    9662    4684   37624230    5  Extended 
                start: (c,h,s) expected (1023,254,63) found (1023,0,1) 
/dev/hda5       4979+   9531    4553-  36571938+  83  Linux 
                start: (c,h,s) expected (1023,254,63) found (1023,1,6) 
/dev/hda6       9532+   9662     131-   1052226   82  Linux swap / Solaris 
                start: (c,h,s) expected (1023,254,63) found (1023,1,1) 
notebook ~ # mount -t ntfs /dev/hda1 /mnt/ 
mount: wrong fs type, bad option, bad superblock on /dev/hda1, 
       or too many mounted file systems 
 
Comment 11 Joshua Kinard gentoo-dev 2005-07-09 23:59:21 UTC
If the partition geometry is off, then you're really in a bind.  It's not easy
to repair that.  I tried once (long ago) to install Solaris/x86 when it was in
its initial releases, and for some odd reason, the installer touched ever so
lightly the partition layout on /dev/hda (it was supposed to install only to
/dev/hdb).  End result: Win98 didn't load automatically.

Took me 12 hours, working in partition magic and using a partition calculator to
determine what the correct offsets were and repair them.  Not fun by any means.

btw, according to your disk layout, mounting /dev/hda1 is expected to fail. 
There's nothing WinXP about it -- it's the diagnostics partition.  There's
likely no normal filesystem on it.  You should've tried mounting /dev/hda2, and
made sure your have NTFS read support built into the kernel (NTFS Write
supportis dangerous).



Comment 12 Timo Nentwig 2005-07-11 11:35:54 UTC
Partition Table for /dev/hda 
 
---Starting---      ----Ending----    Start     Number of 
# Flags Head Sect Cyl   ID  Head Sect Cyl     Sector    Sectors 
-- ----- ---- ---- ---- ---- ---- ---- ---- ----------- ----------- 
1  0x00    1    1    0 0x12   11    8    2          63       32768 
2  0x80   11    9    2 0x07  254   63 1023       32831    79707278 
3  0x00  254   63 1023 0x83  254   63 1023    79740109       70811 
4  0x00  254   63 1023 0x05  254   63 1023    79987635    75248460 
5  0x00  254   63 1023 0x83  254   63 1023          68    73143877 
6  0x00  254   63 1023 0x82  254   63 1023          63     2104452 
 
Partition Table for /dev/hda 
 
First       Last 
# Type       Sector      Sector   Offset    Length   Filesystem Type (ID) Flag 
-- ------- ----------- ----------- ------ ----------- -------------------- ---- 
1 Primary           0       32830*    63       32831*Compaq diagnost (12) None 
2 Primary       32831*   79740108*     0    79707278*HPFS/NTFS (07)       Boot 
3 Primary    79740109*   79810919      0       70811*Linux (83)           None 
Logical    79810920    79987634      0      176715 Free Space           None 
4 Primary    79987635   155236094      0    75248460 Extended (05)        None 
5 Logical    79987635   153131579     68#   73143945 Linux (83)           None 
6 Logical   153131580   155236094     63     2104515 Linux swap / So (82) None 
 
 
 
Comment 13 Timo Nentwig 2005-07-13 00:17:45 UTC
I booted from CD and when attempting to mount the NTFS partition is prints that 
the boot partition sector is invalid. So I did a mount -o errors=recover and was 
able to mount the partition.

1) regarding the above command's output: I'm not sure whether it did fix it or 
was using a backup (it seems NTFS holds an backup). Anyway, is it safe to 
execute the command with rw support for NTFS enabled in order to permanently fix 
it?

2) this doesn't work from my regular on-disk install. Mount print nothing about 
an invalid sector and -o errors=recover also doesn't work (?). Well...what is 
the difference between mount on live CD and mount on hard disk?
Comment 14 Timo Nentwig 2005-07-16 00:07:04 UTC
I was able to fix it: mount -w -o errors=recover /dev/hda2 /mnt/foo