LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 04-19-2006, 09:26 PM   #1
dksmisfit
LQ Newbie
 
Registered: Nov 2004
Posts: 4

Rep: Reputation: 0
Windows cylinder problem / MBR corrupt?


Alright, this all started when I did a FreeBSD install (removed that, rockin' slack atm). It screwed up the cylinder/size of my NTFS xp partition (/dev/hda2). Basically, it wont boot. Whatever bootloader I use (including just the default of windows), it hangs. No error message. This problem is consistent with the error as can be seen here: h**p://lwn.net/Articles/86835/

Also..

bash-3.00# head /dev/hda2 | strings | grep NT
NTFS
NTLDR is missing
NTLDR is compressed


Windows doesn't like changed geometry :X

Anyways, I tried the obvious.. windows recovery disks, trying fixmbr, fixboot. tried chkdisk /R for recovery - no luck with that either..
Code:
bash-3.00# sfdisk -d /dev/hda | sfdisk --no-reread -H255 /dev/hda

Disk /dev/hda: 19457 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+    671     672-   5397808+  1b  Hidden W95 FAT32
/dev/hda2   *    672   14262-  13591- 109166400    7  HPFS/NTFS
/dev/hda3      14262+  19247-   4985   40042012+  83  Linux
/dev/hda4      19311   19456     146    1172745   82  Linux swap
New situation:
Units = sectors of 512 bytes, counting from 0

   Device Boot    Start       End   #sectors  Id  System
/dev/hda1            63  10795679   10795617  1b  Hidden W95 FAT32
/dev/hda2   *  10795680 229128479  218332800   7  HPFS/NTFS
/dev/hda3     229128480 309212504   80084025  83  Linux
/dev/hda4     310231215 312576704    2345490  82  Linux swap
Warning: partition 2 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.)

Tried with --force, still no luck.. says

Code:
....
Re-reading the partition table ...
BLKRRPART: Device or resource busy
The command to re-read the partition table failed
Reboot your system now, before using mkfs

If you created or changed a DOS partition, /dev/foo7, say, then use dd(1)
to zero the first 512 bytes:  dd if=/dev/zero of=/dev/foo7 bs=512 count=1
(See fdisk(8).)
hmm. I know it's not my bootloader anyways. All my data on hda2 is there etc, boot.ini has correct partition.


Anyone have any ideas or fixes, really need some help!!

thanks alot

leo
 
Old 04-20-2006, 04:41 AM   #2
Randux
Senior Member
 
Registered: Feb 2006
Location: Siberia
Distribution: Slackware & Slamd64. What else is there?
Posts: 1,705

Rep: Reputation: 55
You should be able to fdisk this back to the original values. Don't worry about a partition not ending on a cylinder boundary (*bloze is famous for this) but DO make sure you start new partitions on a cylinder boundary.

I like fdisk, but conventional wisdom seems to be that cfdisk is better.

If you have the printout from before (when it was correct) you can just create a new empty DOS partition table and rebuild it by hand. Then you'll have to reinstall your bootloader.

You won't lose any data as long as you don't write on your disk until you have the partition table fixed.

For boot/recovery disks, Kanotix live CD is very good, it has qtparted for resizing NTFS partitions. Slax is a good general live CD.

Last edited by Randux; 04-20-2006 at 04:44 AM.
 
Old 04-21-2006, 03:21 PM   #3
dksmisfit
LQ Newbie
 
Registered: Nov 2004
Posts: 4

Original Poster
Rep: Reputation: 0
dont have a print-out etc :x, i've reinstalled slack since the last time...
 
Old 05-06-2006, 04:02 PM   #4
dksmisfit
LQ Newbie
 
Registered: Nov 2004
Posts: 4

Original Poster
Rep: Reputation: 0
*bump* Anyone? if not, gonna reinstall
 
Old 05-06-2006, 04:30 PM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,140

Rep: Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123
That was a while ago - seem to recall it was a bad parted Fedora (and Mandriva ???) used.
The (sfdisk) commands you used were merely indicative.
As the article mentions, you should check that you don't get any error messages from the first command. Pipe it to a file, edit it appropriately, then feed it back - manually.
 
Old 05-06-2006, 06:48 PM   #6
dksmisfit
LQ Newbie
 
Registered: Nov 2004
Posts: 4

Original Poster
Rep: Reputation: 0
There are no errors to be excluded:
Code:
bash-3.00# sfdisk -d /dev/hda                                    
# partition table of /dev/hda
unit: sectors

/dev/hda1 : start=       63, size= 10795617, Id=1b
/dev/hda2 : start= 10795680, size=218332800, Id= 7, bootable
/dev/hda3 : start=229128480, size= 80084025, Id=83
/dev/hda4 : start=310231215, size=  2345490, Id=82
Tried that.
 
Old 05-06-2006, 07:51 PM   #7
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,140

Rep: Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123
Mmmmm ....
Got any free space on that disk - or a partition you can afford to lose ???.
"diskpart" from recovery console may force a re-write of the partition table that XP will use.
Might be worth a try.

Never used it, don't know, your call ... (all the normal arse-covering added) ...
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LILO problem - is my MBR corrupt? mattbenton Linux - Newbie 1 10-31-2005 05:41 PM
GRUB MBR /boot and 1024-cylinder limit tdxloki Linux - Newbie 2 10-28-2005 01:20 PM
Corrupt MBR danikdj Red Hat 15 10-29-2004 10:39 AM
MBR is corrupt GRUB is lost satish427 Linux - Newbie 3 10-09-2004 06:00 AM
1024 cylinder problem drmauro223 Linux - General 7 09-24-2004 02:57 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:33 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration