Rebuilding Chs Partition Table


Recommended Posts

Hi All,

A Bug in Fedora Core GRUB intall causes the disk geometry to be modified from LBA to CHS Format.The partition table now has both CHS & LBA value.Linux ignores CHS values but Windows messes up failing to boot.

I'm experiencing the same trouble,due to which i'm not being able to boot windows,however linux can still boot.

original disk geometry had 255 number of heads initially and was changed to 16 after the partition was corrupted by Fedora

Mentioned in Bugzilla at:https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=115980

None of the solutions suggested to the problem:

Setting BIOS setting from auto to LBA or

$ sfdisk -d /dev/hda | sfdisk --no-reread -H255 /dev/hda

is working in my case. :huh:

So, the only option remaining to me is to clear the MBR & partition table & rebuilt them again.

i plan to clear MBR using:

$ dd if=/dev/zero of=zero.img bs=512 count=1
$ dd if=zero.img of=/dev/hda

& rebuilt the partition table & MBR

Can i do this i rebuilt & restore original partition table without loosing valuable data & how?How to make a backup of partition table & MBR so that i can restore them if above process fails?

Thanks in Advance

Link to post
Share on other sites

Using Fixmbr & Fixboot or Fdisk /mbr will not help here,actually the partition table has been changed in Cylinder Head Sector (CHS) Format along with LBA Information.This has no issues with Linux as it reads only LBA ones but Windows read both & messes up.Please help me resolve this trouble.

Windows doesn't starts even on reinstall

Link to post
Share on other sites

I am no expert in this area, but the following commands should delete your partition table and set it a proper environment to reinstall windows. Run these command from any linux live cd as root

dd if=/dev/zero of=/dev/hda bs=512 count=1
parted -s /dev/hda mklabel msdos

Edited by shanenin
Link to post
Share on other sites

Thanks,but I Fear doing this will probably erase my partition table & render all data on the disk as useless.

I can understand

dd if=/dev/zero of=/dev/hda bs=512 count=1

It clears sector 0 512 bytes but please elaborate

parted -s /dev/hda mklabel msdos

I observed in BIOS setup that CHS values for drive has 16 Heads while LBA had 255 this has been mentioned as the cause of problem in bugzilla.I has tried

$ sfdisk -d /dev/hda | sfdisk --no-reread -H255 /dev/hda

for solving that but i didn't did what it was expected to do,bcoz the BIOS settings show 16 Heads instead of 255.Can't i scrap off CHS values from partition table.

I have got precious data on disk,i don't wanna loose it,will doing parted render the disk cleared of older partitions

Edited by ILoveTux
Link to post
Share on other sites

Sorry, my suggestion would have made your data inaccesable. You mentioned reinstalling, so I assumbed you were trying to format your drive. below is from the parted man page

mklabel label-type
Creates a new disklabel (partition table) of label-type.
label-type should be one of "bsd", "dvh", "gpt", "loop",
"mac", "msdos", "pc98" or "sun".

Link to post
Share on other sites

Thanks shanenin,

But i would like to rebuild my partition table excluding the CHS values w/o loosing my old partitions data.This is a serious bug & i don't think it's fixed in any of Fedora releases.

I'm not able to re-modify CHS values to 255 Heads,that's why i'm thinking of clearing it up & then restoring the old partition table now only with LBA values

Link to post
Share on other sites
But i would like to rebuild my partition table excluding the CHS values w/o loosing my old partitions data.

You can modify the partition table by hand with a hex editor if necessary. You'd need to know the correct values though and I have no idea if it would fix the problem. (Is it actually the MBR that causes the problem or the BIOS or the interaction between the two?)

Edited by jcl
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...