Автор Тема: Решение  на проблема с Dual Boot на RH и WinXP  (Прочетена 3027 пъти)

nforcer2

  • Участници
  • ***
  • Публикации: 11
    • Профил
http://www.redhat.com/archives/fedora-test-list/2004-May/msg02114.html

Fix for the XP dual boot problem
From: Radu Cornea <ccradu yahoo com>
To: For testers of Fedora Core development releases <fedora-test-list redhat com>
Subject: Fix for the XP dual boot problem
Date: Tue, 18 May 2004 22:37:57 -0700 (PDT)

Like other people on this list I was affected by the bug which makes the
XP partition in a dual boot configuration inaccessible after installing
Fedora. Below are the steps I used to restore the partition table to its
original configuration.

Some people mentioned a fix that involved setting the hard disk
configuration to LBA in the BIOS, but that may not work in some cases (I
have an old IBM Thinkpad which does not allow it).

By looking at the partition information as printed by fdisk after the
partition is corrupted, it seems that the bug affects only the C/H/S
values, the LBA are still correct. Even the fdisk manual specifies that
"DOS uses C/H/S only, Windows uses both [C/H/S and LBA], Linux never uses
C/H/S". This means that the correct information is still there but just
one copy is correct, the LBA one (most people affected said they could
access the Windows partition from Linux just fine). The procedure below
attempts to regenerate the MBR from scratch using the LBA values. In most
cases the original disk geometry had 255 (or 240) as number of heads
initially and was changed to 16 after the partition was corrupted by FC2.

More info about the bug can be found here:
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=115980
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=113201

This did work for me. I don't guarantee it will work for everyone, use it
at your own risk...

You need a bootable Linux CD (e.g. Knoppix) and a DOS system disk with
fdisk on it.
Here are the steps I followed:

1. boot from Knoppix or other bootable Linux CD (using the Fedora rescue
CD or booting in the newly installed system in single mode, ro mounted
may work too, but I haven't tried)

2. save the content of the MBR (and possibly all the boot sectors from
the partitions). This is important in case something goes wrong and you
want to restore later:
 $ dd if=/dev/hda of=mbr.img bs=512 count=1

3. run fdisk, go into expert mode and write down (or save into a file)
the starting sector (NOT block), end sector and type for each partition
(example below):
 $ fdisk /dev/hda
 Command: u (change units to sectors)
 Command: p (print)
 Example output:

   Device Boot      Start         End      Blocks   Id  System
 /dev/hda1   *          63    33732719    16866328+   7  HPFS/NTFS
 /dev/hda2        74692800    78140159     1723680   1c  Hidden W95 FAT32
(LBA)
 /dev/hda3        35834400    74692799    19429200   83  Linux
 /dev/hda4        33732720    35834399     1050840   82  Linux swap

4. completely erase the MBR by writing zeros to it (you may skip this
step, I am not sure if it is really needed, but this way it worked for
me):
 $ dd if=/dev/zero of=zero.img bs=512 count=1
 $ dd if=zero.img of=/dev/hda

5. force the original number of heads. In my case (20Gb in a Thinkpad)
this was 240, but in most other cases it would be 255. See this post for
more info:

http://groups.google.com/groups?....t&rnum=

4

Using fdisk this will also create a new DOS partition table and restore
the original partitions:

 $ fdisk -H 255 /dev/hda               # or 240 for some configurations
 Command: o (create new partition table)

6. by now you have a newly generaed partition table, with the original
disk geometry. Recreate the partitions as they were before:

 Command: n (new partition)
 Primary partition (p)
 Partition number: 1
 First cylinder: 63                      # beginning of first partition
 Last cylinder or +size[...]: 33732719   # end of first partition

 Command: t (change type)
 Partition number: 1
 Hex code: 07                            # they type of the partition

Repeat for all 4 partitions. Verify at the end that the start/end/id are
correct:

 Command: p (print)

If everything is correct, write the partition table to the disk and exit:

 Command: w (write)
 Command: q (quit)

7. in my case, I had to run an extra "fdisk /mbr" using the DOS bootdisk
(may work with a XP installation CD too, but I haven't tried). After
that, everything worked fine, the partition table was back to the
original configuration.

If you have the GRUB in the MBR, the "fdisk /mbr" will overwrite it so
you may want to restore it later (but use the Knoppix CD, not FC2,
otherwise you may end up where you started if the bug is in grub). On my
machine GRUB was installed in the Linux partition so it wasn't affected.

You can return to the original MBR at any time by writing the saved image
to the disk (in case this fix does not work for you) as long as you only
make changes to the MBR:

 $ fdisk if=mbr.img of=/dev/hda

This is it, I hope it works for others, if it does please let me know.

Ползвам няколко операционни системи и горепосочения бъг в РедХат от 9 нагоре и Федора ме отказа да ползвам тази дистрибуция .Някой хора се опитваха да ме убедят че проблема е в задклавиатурното устройство но се оказва че и други хора са имали същия проблем и че повредата не е в моя телевизор
  '<img'>  '<img'>  '<img'>  '<img'>
Активен

Подобни теми
Заглавие Започната от Отговора Прегледи Последна публикация
Мазало с lilo  & windows boot manager  - Помощ!
Настройка на програми
ven 2 6447 Последна публикация Oct 17, 2005, 14:05
от RealUseR
Dual boot от /boot. Конфигурация на GRUB.
Настройка на програми
mandor 1 4606 Последна публикация Feb 28, 2006, 09:37
от
Помогнете ми за dual boot-a
Настройка на програми
kLo 7 5948 Последна публикация Mar 23, 2006, 19:21
от holographa
Проблем с dual boot
Настройка на хардуер
ks 4 5031 Последна публикация Oct 28, 2006, 12:34
от cartman
Dual boot
Настройка на програми
freaker 3 5379 Последна публикация Jan 18, 2009, 16:32
от tokopan