LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 05-05-2007, 08:18 AM   #1
K05T9
Member
 
Registered: Nov 2006
Location: Latvia
Distribution: Slackware 11.0
Posts: 49

Rep: Reputation: 15
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?

Last edited by K05T9; 05-05-2007 at 08:19 AM.
 
Old 05-05-2007, 09:10 AM   #2
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,371

Rep: Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749
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
 
Old 05-05-2007, 09:18 AM   #3
sydney-troz
Member
 
Registered: Feb 2007
Distribution: Kubuntu, it's obese barely-usable sibling, Ubuntu
Posts: 142

Rep: Reputation: 15
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?
 
Old 05-05-2007, 09:20 AM   #4
K05T9
Member
 
Registered: Nov 2006
Location: Latvia
Distribution: Slackware 11.0
Posts: 49

Original Poster
Rep: Reputation: 15
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
 
Old 05-05-2007, 09:23 AM   #5
K05T9
Member
 
Registered: Nov 2006
Location: Latvia
Distribution: Slackware 11.0
Posts: 49

Original Poster
Rep: Reputation: 15
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

Last edited by K05T9; 05-05-2007 at 09:24 AM.
 
Old 05-05-2007, 09:40 AM   #6
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,371

Rep: Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749
Perhaps this will help.
http://www.goodells.net/multiboot/editbini.htm
 
Old 05-05-2007, 09:49 AM   #7
K05T9
Member
 
Registered: Nov 2006
Location: Latvia
Distribution: Slackware 11.0
Posts: 49

Original Poster
Rep: Reputation: 15
I don't have DOS.
 
Old 05-05-2007, 10:09 AM   #8
K05T9
Member
 
Registered: Nov 2006
Location: Latvia
Distribution: Slackware 11.0
Posts: 49

Original Poster
Rep: Reputation: 15
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
 
Old 05-05-2007, 10:21 AM   #9
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,371

Rep: Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749
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.
 
Old 05-05-2007, 10:32 AM   #10
K05T9
Member
 
Registered: Nov 2006
Location: Latvia
Distribution: Slackware 11.0
Posts: 49

Original Poster
Rep: Reputation: 15
And how can i correct this?
 
Old 05-05-2007, 10:43 AM   #11
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,371

Rep: Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749
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?
 
Old 05-05-2007, 11:04 AM   #12
K05T9
Member
 
Registered: Nov 2006
Location: Latvia
Distribution: Slackware 11.0
Posts: 49

Original Poster
Rep: Reputation: 15
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.
 
Old 05-05-2007, 11:16 AM   #13
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,371

Rep: Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749
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.
 
Old 05-05-2007, 11:27 AM   #14
K05T9
Member
 
Registered: Nov 2006
Location: Latvia
Distribution: Slackware 11.0
Posts: 49

Original Poster
Rep: Reputation: 15
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.
 
Old 05-05-2007, 11:34 AM   #15
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,371

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


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Does a Windows XP repair install overwrite the MBR? BigFoot13 Linux - General 11 05-06-2007 01:40 PM
want to nuke the MBR & create new MBR di11rod Linux - Software 9 12-30-2006 08:25 AM
Restoring MBR :partitions are detected only after the reboot after MBR restoration? sharathksin Linux - Newbie 2 04-14-2006 07:48 AM
Using the installation CD to boot and repair the MBR in Mandrake 10 dvela Mandriva 5 08-19-2004 09:17 AM
How to repair win-destroyed MBR without a floppy J_Szucs Linux - Newbie 7 12-25-2002 05:51 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 12:10 AM.

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