LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 11-30-2003, 09:23 PM   #1
wayneinmpls
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, 10:21 PM   #2
Imyrryr
Member
 
Registered: Aug 2003
Location: 3rd electron on the left getting mugged by the nutrinos at Quarks
Distribution: Pop_OS
Posts: 140

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, 12:53 AM   #3
dander062
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, 06:03 AM   #4
rallyegolfland
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, 09:46 AM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,103

Rep: Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117
wayneinmpls:
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.

rallyegolfland:
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, 11:22 AM   #6
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

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

For a Linux that uses Grub

Code:
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

Code:
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, 11:27 AM   #7
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,610
Blog Entries: 4

Rep: Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905
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
etc...


... 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.
 
  


Reply


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

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:46 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