Re: MBR troubles, perhaps.
From: David Efflandt (efflandt_at_xnet.com)
Date: 07/31/04
- Next message: Fredzo: "HP Scaanjet"
- Previous message: relic: "Re: Choosing a Linux printer sucks."
- In reply to: Petri Järvenpää: "MBR troubles, perhaps."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sat, 31 Jul 2004 15:13:51 +0000 (UTC)
On Fri, 30 Jul 2004, Petri Järvenpää <Petri.S.Jarvenpaa@nokia.com> wrote:
> Hello and please forgive me if this subject is already done to death, but
> I´m getting desperate.
>
> Last week I installed Fedora Core 2 on my Windows XP box, I decided to make
> it dualboot. I had heard of the famous dualboot-partition table mess that
> Fedora Core 2 makes when installing it, but I found a guide that seemed
> reasonable easy to follow, guess I was wrong.
>
> I have two hd´s in my box, other is 120GB Westerd Digital partitioned as
> follows:
> -10GB for windows (NTFS)
> -100GB for apps, games, downloads etc.(NTFS)
> -10GB for shared usage between windows and linux (FAT32)
> The second hd was(was indeed, it died) 20GB IBM Deathstar, partitioned the
> "easy" way:
> -100MB for boot
> -512MB for swap
> -rest for root
>
> Installing the fedora I followed the guide and booted from the rescue-cd and
> issued the command (fdisk -l /dev/hda and same for the other hd also). After
> that I rebooted and entered the installation with following command (linux
> hda=xxxxxx,zzz,yy hdb=xxxxxx,zzz,yy <- xzy meaning the cylinders, sectors
> and heads respectively). The installation went fine, I decided to play it
> safe and installed the bootloader on the MBR of the second hd, the
> Deathstar.
I hope you recorded all the output of fdisk -l (including Start & End of
partitions).
> After installation I noticed that I had failed and the bootloader couldn´t
> boot to windows anymore. Luckily I could boot into both OS´s just by
> changing the order in which drives boot, in BIOS.
>
> Then I decided to try and fix this with the commands found from the guide.
> first 'sfdisk -d /dev/hda | sfdisk --no-reread -H255 /dev/hda' then
> 'sfdisk -d /dev/hda' . This did not fix the issue however, I even think I
> made things worse in this part, my own fault, I agree.
The -H# should have been whatever heads 'fdisk -l /dev/hda' originally
showed, before installing Linux. If that was not originally 255 heads,
then those sfdisk commands just broke your partition table.
> After this, few days later my second HD died, it was 4 yeards old and it was
> IBM, so I was not suprised, but little disappointed since I had my Fedora
> all ready to go. This is not what I´m writing this post for.
>
> Main reason for my gripes is that now the BIOS autodetect for this first HDD
> takes very long and cant detect it half the time. Also what BIOS autodetects
> as it´s settings now are not what the command 'fdisk -l /dev/hda' told me
> earlier. Curious about that I checked the Western Digitals homepage and it
> too lists completely different values for cylinders, sectors and heads. And
> when I say completely different, I mean different from what the 'fdisk -l
> /dev/hda' reported and what the BIOS is now reporting. So now I am wandering
> which ones are the correct settings for my hdd?
With LBA translation, ide drives can act like any head/cyl. geometry they
are told, as long as total sectors do not exceed drive size. Drives may
actually have 16 heads and many cylinders, but 2.6.x kernels seem to
report them as 255 heads and less cylinders, and the partition table may
have used another number (240 heads in my case) with appropiate cylinders.
(see below)
> I tried to "cure" this odd auto-detect behaviour (which worked flawlesly
> befora btw) by removing my partitions from my 120GB drive and doing
> fdisk/mbr from windows98 bootdisk. I read this somewhere and they suggested
> this would write MBR back to its factory settings, no luck though.
Restoring the MBR just restores the MBR (first 512KB of disk). The
partition table is separate (not included in, nor restored by MBR).
If you "removed" your partition table, you will need to recreate it with
the geometry used to originally create your partitions (so partitions end
on cylinder boundaries). This would likely involve using the expert mode
of Linux fdisk to set translated heads and cylinders. Then back out of
expert mode and crank in Start and End points for your partitions (if you
have a record of what they were).
I know this can be done successfully if done right, because I managed to
restore my partition table to 240 heads and proper # of cyls. with no data
loss from Linux fdisk on a rescue CD, when 64-bit WinXP tried to change it
from 240 to 255 heads (temporarily making Windows XP Home & XP64
unbootable. So I recognized the wrong cylinder numbers SuSE 9.1 wanted to
use, and configured it to use existing partitions instead of changing
anything.
> So basically, bottom line, I messed up my partition table by giving possibly
> wrond settings during the linux installation or after it when I tried to fix
> this. How do I perform somekind of low-level-format on the drive so that the
> MBR partition table gets written back to its original form and settings?
You do _NOT_ want to do any formatting if you want to recover any existing
data from the drive. The data is likely still there intact if you can
properly recreate the partition table. There are some tools that can help
locate partitions if you do not know where they start/end (parted?), but
I have never used them.
-- David Efflandt - All spam ignored http://www.de-srv.com/
- Next message: Fredzo: "HP Scaanjet"
- Previous message: relic: "Re: Choosing a Linux printer sucks."
- In reply to: Petri Järvenpää: "MBR troubles, perhaps."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|