Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 11-30-2003, 10:23 PM   #1
LQ Newbie
Registered: Nov 2003
Location: Minneapolis
Distribution: Slackware
Posts: 23

Rep: Reputation: 15
fdisk /mbr in Linux?

Newbie question, to be sure! I can't find an equivalent to fdisk /mbr in liunx. I tried to install a second distro on my #2 hdd and it messed up the mbr and now my main distro won't boot because it thinks the disk is hosed.
I tried cleaning off the second disk with mke2fs and fdisk, but the 1st distro still won't boot because it thinks the #2 hdd is bad. Any suggestions?
Old 11-30-2003, 11:21 PM   #2
Registered: Aug 2003
Location: 3rd electron on the left getting mugged by the nutrinos at Quarks
Distribution: Slackware 13.37, Slackware 14.0, Mint
Posts: 138

Rep: Reputation: 17
a boot disk created from your first distro and once you're in that run lilo will fix that
Old 12-01-2003, 01:53 AM   #3
LQ Newbie
Registered: Nov 2003
Location: Connecticut
Distribution: Debian 8.5
Posts: 27

Rep: Reputation: 15
You did not say what distribution or boot loader is used, lilo/grub. In SUSE 9.0 booting from the dvd has a new system fixer. Hard disk scans and auto suggestive fixes. Worked well with my messed /boot.
Old 12-20-2005, 07:03 AM   #4
LQ Newbie
Registered: Dec 2005
Posts: 1

Rep: Reputation: 0
delete mbr by mistake, want have data back

Dear Linux userīs, i have problem, i installed UBUNTU after having WIN XP and WIN 2K on HD with 1 partition, the problem was that UBUNTU not work after installation and have also installed boot manager from ubuntu. Then maybe i delete MBR by mistake, but now all data gone, can you please help me to restore mbr but not loosing data from HD, THANK you so much Mandi
Old 12-20-2005, 10:46 AM   #5
LQ Veteran
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 17,379

Rep: Reputation: 2708Reputation: 2708Reputation: 2708Reputation: 2708Reputation: 2708Reputation: 2708Reputation: 2708Reputation: 2708Reputation: 2708Reputation: 2708Reputation: 2708
Depends on distro and on loader used - so there is no "one answer" as in Windoze. Most distros have a recovery mode where you can rerun the appropriate command to reinstall the loader.
For Slack you can boot your HD installed Slack from the CD, and rerun the grub-install or lilo command.

Insufficient info. Do you merely want to get Windoze back, do you want to get Ubuntu working, what did you do (deleted partitions ???).
Maybe you should start your own thread.
Old 12-20-2005, 12:22 PM   #6
Senior Member
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 112Reputation: 112
Instruction equivalent to Windows fdisk /mbr in Linux

For a Linux that uses Grub

grub-install /dev/hda (for IDE disk being the first bootable disk) or

grub-install /dev/sda (for Sata being the first bootable disk)
If the above fails to work it is because you may have connected the disk at the wrong position, say hdb, hdc or hdd. Just specify the whatever is your first bootable disk in place of hda.

For a LInux that uses Lilo it is

lilo -b /dev/hda
The same argument of sda for Sata and disk order apply.

The above instructions need to be issued as a root user (needs admin right) and inside the actual Linux.
Old 12-20-2005, 12:27 PM   #7
LQ Guru
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 9,078
Blog Entries: 4

Rep: Reputation: 3173Reputation: 3173Reputation: 3173Reputation: 3173Reputation: 3173Reputation: 3173Reputation: 3173Reputation: 3173Reputation: 3173Reputation: 3173Reputation: 3173
You probably did not delete the MBR. You probably replaced it with the one that boots Umbutu's loader, and there is something wrong with it.

Boot up a LiveCD.

Now you can mount the drive:
mkdir /mnt/hda1
mount /dev/hda1 /mnt/hda1

... and take a look at it.

Let's say that you find that yes, the information is there. All you need to do now is to replace the MBR. It makes a difference now whether you're using Lilo or Grub, as others have already said.

Notice also exactly where and how it fails when you try to start up. If you see a boot-loader starting at all, then the MBR is present; the problem's in the boot-loader somewhere. If you see Linux starting at all, the prob might be in Linux.

Yes, you get really good at reading text that's whizzing by very fast.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Fdisk /MBR Eugney Slackware 39 08-23-2011 10:30 AM
Grub - fdisk /MBR lucho707 Linux - Software 1 12-01-2005 12:07 AM
fdisk /mbr rharvey@cox Linux - Software 2 02-16-2004 01:19 PM
why won't my mbr fdisk /mbr? jamessp007 Mandriva 13 01-03-2004 02:41 AM
Life after fdisk /mbr amijinx Linux - Hardware 3 10-01-2003 07:34 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:34 AM.

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