Автор Тема: Windows + Linux  (Прочетена 3459 пъти)

nforcer

  • Напреднали
  • *****
  • Публикации: 213
    • Профил
Windows + Linux
« Отговор #15 -: Jan 08, 2006, 22:16 »
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?....&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.


--
Radu
Активен

No Microsoft products were used in any way for the creation of this message.
If you are using a Microsoft product to view it, BEWARE!
I'm not responsible for any harm you might encounter as a result.

nforcer

  • Напреднали
  • *****
  • Публикации: 213
    • Профил
Windows + Linux
« Отговор #16 -: Jan 08, 2006, 22:21 »
Човека пише че ако диска ти е на LBA може и да няма проблеми изглежда при теб е така затова си нямал проблем.Колкото пъти съм се опитвал да инсталира федора с линукс едно че не е тръгвал линукса а второ че се  налагала и преинсталация на Windows.Аз и на двата си компютъра имам дуал boot на единия с SUse на другия с Slackware и при тях няма подобни проблеми.
Активен

No Microsoft products were used in any way for the creation of this message.
If you are using a Microsoft product to view it, BEWARE!
I'm not responsible for any harm you might encounter as a result.

aaaaaa

  • Напреднали
  • *****
  • Публикации: 971
    • Профил
Windows + Linux
« Отговор #17 -: Jan 08, 2006, 22:39 »
Сигурно е така. Аз не съм ползвал fedora особено много, така че опита ми не е особено показателен.
Активен

...to boldly go where no one has gone before...

MetalIvo

  • Напреднали
  • *****
  • Публикации: 24
    • Профил
Windows + Linux
« Отговор #18 -: Jan 09, 2006, 03:16 »
Като фен и потребител на Mac мога да кажя следното:

Това е една прекрасна ОС. Сьчетава всичко хубаво от света на Windows & Linux. Това е ОС базирана на NetBSD, което носи всички хубави неща от UNIX. От друга страна е платформа сьщо като Windows - програмистите правят всичко за да улеснят потребителя.

И за сьрвьр е страхотна '<img'> ... естествено с линукс може да се направи и сьрвьр без да е плаща, но ако искаш да работи както трябва си копуваш ОС (СЬПОРТА по точно) ...

Поздрав.
( Един свят се срина за мен като разбрах че Apple ще минават на  Intel, сега трябва да рзкарам табелката от вратата си ( Intel Inside / Idiot outside ) ...
Активен

Подобни теми
Заглавие Започната от Отговора Прегледи Последна публикация
Windows XP i LInux
Настройка на програми
DJSlavchik 1 3717 Последна публикация Oct 29, 2002, 20:24
от Tonych
За Windows-ките файлове под Linux
Настройка на програми
ext6 4 5044 Последна публикация Dec 31, 2008, 07:30
от satir
ot windows kam linux!
Настройка на програми
detelin 3 2976 Последна публикация May 28, 2003, 19:15
от detelin
windows i linux
Настройка на програми
aragorn 4 3145 Последна публикация Oct 12, 2003, 19:06
от paveldikov
Linux-Windows
Настройка на програми
thegreen 3 4243 Последна публикация Nov 02, 2003, 17:19
от thegreen