Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
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.
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
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.