LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   MBR repair (https://www.linuxquestions.org/questions/slackware-14/mbr-repair-551484/)

K05T9 05-05-2007 08:18 AM

MBR repair
 
I was working with some mbr tools, and did something wrong. Now i can't load windows xp, from the boot menu, but i still got slackware. When i load windows, it just does not find the partition and asks to reboot. Still i can access all the windows files using slackware.
What should i do to make windows boot?

allend 05-05-2007 09:10 AM

Perhaps you have changed the Boot flag.
From Slack (as root) use cfdisk. If the Boot flag is not set on your primary NTFS partition, then change it.

In my case Windows XP boots from /dev/sda2, so the Boot flag is set on this partition.

Quote:

cfdisk 2.12r

Disk Drive: /dev/sda
Size: 250000000000 bytes, 250.0 GB
Heads: 255 Sectors per Track: 63 Cylinders: 30394

Name Flags Part Type FS Type [Label] Size (MB)
------------------------------------------------------------------------------
sda1 Primary Dell Utility 49.36
sda2 Boot Primary NTFS [^E] 42960.64
sda5 Logical NTFS [^E] 42960.64
sda6 Logical FAT16 ["] 42960.64
sda7 Logical FAT16 42960.64
sda8 Logical Linux ReiserFS 42960.64
sda9 Logical W95 FAT32 (LBA) 30153.88
sda4 Primary CP/M / CTOS / ... 4984.52
Unusable 8.23



[Bootable] [ Delete ] [ Help ] [Maximize] [ Print ]
[ Quit ] [ Type ] [ Units ] [ Write ]

Toggle bootable flag of the current partition

sydney-troz 05-05-2007 09:18 AM

Do you know what you changed when you were working with the MBR? Which boot loader are you using, and could you post its configuration file? How is your HDD partitioned?

K05T9 05-05-2007 09:20 AM

cfdisk 2.12r

Disk Drive: /dev/hdc
Size: 40060403712 bytes, 40.0 GB
Heads: 255 Sectors per Track: 63 Cylinders: 4870

Name Flags Part Type FS Type [Label] Size (MB)
---------------------------------------------------------------------------------------
hdc1 Boot Primary NTFS 7205.35
hdc5 Logical NTFS [^C] 27003.60
hdc6 Logical Linux ReiserFS 5848.18


as you can see, the flag of windows partition is set to boot

K05T9 05-05-2007 09:23 AM

Quote:

Originally Posted by sydney-troz
Do you know what you changed when you were working with the MBR? Which boot loader are you using, and could you post its configuration file? How is your HDD partitioned?

Here is the part of lilo.conf:
# Windows bootable partition config begins
other = /dev/hdc1
label = Windows
table = /dev/hdc
# Windows bootable partition config ends
# Linux bootable partition config begins
image = /boot/vmlinuz
root = /dev/hdc6
label = Linux
read-only
# Linux bootable partition config ends

I don't know what exactly i did, but i was trying to make windows rewrite mbr

allend 05-05-2007 09:40 AM

Perhaps this will help.
http://www.goodells.net/multiboot/editbini.htm

K05T9 05-05-2007 09:49 AM

I don't have DOS.

K05T9 05-05-2007 10:09 AM

Maybe there are some problems?

Device Boot Start End Blocks Id System
/dev/hdc1 * 1 876 7036438+ 7 HPFS/NTFS
/dev/hdc2 877 4870 32081805 f W95 Ext'd (LBA)
/dev/hdc5 877 4159 26370666 7 HPFS/NTFS
/dev/hdc6 4160 4870 5711076 83 Linux

allend 05-05-2007 10:21 AM

Quote:

Device Boot Start End Blocks Id System
/dev/hdc1 * 1 876 7036438+ 7 HPFS/NTFS
/dev/hdc2 877 4870 32081805 f W95 Ext'd (LBA)
/dev/hdc5 877 4159 26370666 7 HPFS/NTFS
/dev/hdc6 4160 4870 5711076 83 Linux
Yes, there is a problem.
hdc1 starts at 1 and ends at 876.
hdc2 starts at 877 and ends at 4870. - This end point is wrong.
hdc5 starts at 877 and ends at 4159. - This start point is wrong.
hdc6 starts at 4160 and ends at 4870.

K05T9 05-05-2007 10:32 AM

And how can i correct this?

allend 05-05-2007 10:43 AM

Do you know what the settings were before changes were made? If so, you can make changes with cfdisk.
Did you use the dd command to make a copy of the MBR before you started? If so, replace the copy.

What happened to hdc3 and hdc4?

K05T9 05-05-2007 11:04 AM

I damaged mbr, using the programs from usb flash boot drive. I saved backup, but then flash stopped booting, and i guess, backups are gone. I didn't have hdc3 and hdc4 partitions even before making changes to mbr, so it's not the problem.

allend 05-05-2007 11:16 AM

How valuable is the data on hdc2 and hdc5? If you have no record of the original disk partitioning, you may no choice but to reformat these partitions.

K05T9 05-05-2007 11:27 AM

Quote:

Originally Posted by allend
How valuable is the data on hdc2 and hdc5?

I have only 3 partitions:
1. windows
2. windows data
3. slackware
hdc2 is extended partition(don't know what it means) and hdc5 is windows data partition, which i can access using slackware without problems.
as u can see:
hdc1 Boot Primary NTFS 7205.35
hdc5 Logical NTFS [^C] 27003.60
hdc6 Logical Linux ReiserFS 5848.18

all is working perfectly in slackware, as cfdisk shows.
I would like to save data.

allend 05-05-2007 11:34 AM

Was your disk originally setup with three partitions? (You now have four).
If three, was the partitioning NTFS, NTFS, ReiserFS?


All times are GMT -5. The time now is 02:56 AM.