Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then 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.
The easiest way is to boot the machine to a DOS floppy and run "fdisk /mbr".
Not necessarily going to work for all newer Windows installs (XP).
Basically, unless you took a backup of your MBR before doing something to it, you can't "recover" it except for overwriting. So decide which bootloader you want to install there (Windows', GRUB, LILO, some 3rd-party bootloader, ...?), then install and configure it to be able to boot your operating systems (one or more).
Windows bootloader can be tricky sometimes, especially that of XPs. I know machines where 'fixboot' and 'fixmbr' don't do anything but trash the already-wrecked MBR (or a working Linux bootloader from it), so they're useless - basically copying an image of a working MBR (512 bytes, if with partition table, or perhaps without the partition table) might work, but I've seen and heard more failed attempts there than successful ones, so I don't recommend it.
If you are going to have a Linux on the disk, I suggest installing GRUB. It's easy to install, configre and especially maintain/update in case of changes to the boot configurations (compared to LILO which needs to be re-copied to MBR each time altered) and can easily be made boot non-Linux operating systems (like LILO also). If you're going to only use Windows or some other non-Linux system, your best choice is to take the original setup disk of that operating system, boot from it and hope that there is a restore/fix utility for reinstalling it's bootloader. XP's disc has that "Recovery Console" which is sometimes installed on harddisk too, but like I said, it's not always working.
Not necessarily going to work for all newer Windows installs (XP).
NTLDR is not saved in the MBR itself, the MBR simply contains a command to load and launch NTLDR from the disk. So you can write a MBR for a XP system through DOS, since the functionality has not changed since NTLDR was introduced. I have personally done this dozens of times without incident.
This won't work on Vista however, because Vista uses an entirely different bootloader than previous Windows versions.
NTLDR is not saved in the MBR itself, the MBR simply contains a command to load and launch NTLDR from the disk. So you can write a MBR for a XP system through DOS, since the functionality has not changed since NTLDR was introduced. I have personally done this dozens of times without incident.
This won't work on Vista however, because Vista uses an entirely different bootloader than previous Windows versions.
Last link of my signature has the commands for restoring MBR for Windows, Vista, Lilo and Grub.
You can only restore a MBR if there is an operating system that has been arranged to go into the MBR. Grub is the standard boot loader used by EHEL. Therefore Fraginhell has already given you the correct answer. I describe it as Task B6.
How would you get around the problem of the console requiring an administrator password and the password is not accepted?
And:
For some reason, the laptop cannot read from the usb floppy drive even though "legacy" was enabled from the bios and the boot order was changed to boot from the floppy.
This is for my son-in-law's computer. He wanted to have a dual boot with Kubuntu on it and most of the apps worked but when he went to boot into the Windows partition, it could not boot at all. So panic set in and in effort to give Window's control of the mbr back, he deleted the Linux partition and tried the recovery disk. Then he ran into the problem that I described above. I feel so bad about this.
Quote:
The easiest way is to boot the machine to a DOS floppy and run "fdisk /mbr".
Can't do that, the computer can't read it. It gives an I/O error message even though the floppy disk is fine and can be read from another computer.
Quote:
If that isn't an option (no floppy drive, SATA drives, etc) then you can do it from the XP install CD's Recovery Console.
Can't do that either. When we try it, the computer demands a password just to get to the recovery console and it is not accepting it.
Last edited by gymnart; 03-31-2008 at 08:46 AM.
Reason: more info
Well the first thing to check is that you are using the correct password. You need to use the local administrator password that you specified when you installed Windows, not the Windows login password (though of course, they could be the same password). If you don't recall setting one or this is a OEM install, then it is probably just blank (from personal experience I would say 80% of Windows machines have blank local Admin passwords).
If that still isn't working, you might try booting to ntpasswd to change the Administrator password, and then retry the Recovery Console.
Alternately you could use the Ultimate Boot CD which includes tools to work with the MBR, in addition to being able to boot an image of the MS-DOS boot floppy from your CD-ROM (though you have to provide the image for licensing reasons).
If all else fails, you can just copy off his important data with a live CD and reinstall Windows/Linux however you like, this time having a bit of hindsight to guide you.
The way my son-in-law had his Windows set up, there was a hidden administrator account that has to be in SafeMode in order to change the password (or to get rid of it). I hope that when we can get it booted that we would be able to get into that SafeMode and get rid of that password so that if this were to happen again, then we would be able to use the recovery console if necessary!
Progress so far:
MS3FGX that password blanking tool worked and we tried the fixmbr command in the recovery console BUT now when we try to boot into Windows, we get an "Operating System not found" error message.
When my son-in-law did a dir command in the dos window, all his files and Windows itself was still there. He is now trying the fix boot commands on the Windows installation disk.
Edit (from son-in-law):
I've blanked all user's passwords and got in recovery console. Used fixboot and fixmbr. I checked the MSKB and found that maybe I need to tell Windows what my active partition is (since kubunto changed it and therefore after finding out Windows wouldn't boot, I deleted the partition ^.^; ) but what it says here in Method 3... using diskpart to set active partition where my Windows directory is. One problem: the commands the KB states aren't the same as what I have; I can just add/delete partitions, both via command-line and GUI.
Last edited by gymnart; 04-02-2008 at 12:19 PM.
Reason: Son-in-law edited
It sounds like the Windows partition is not where the bootloader expects it. Is it on the first partition of the primary drive, or somewhere else?
You might also need to repair/replace the actual bootloader as well. You have run "fixmbr" from the Recovery Console to fix the MBR, if you go back into the Recovery Console and run "fixboot" this should place a new bootloader binary into your recently restored MBR.
You might also want to check around with the "bootcfg" program in the Recovery Console. This is used to read and edit Boot.ini, the file that tells which OS's the bootloader is aware of. Try a command like "bootcfg /scan" and verify that it lists your Windows installation (and only that).
I've did fixmbr first, then fixboot (it gave me a message stating: "fixboot cannot find the system drive", so I tried "fixboot c:"). Finally bootcfg /scan and it gave me 1 Windows installation...
Robert decided to go totally Linux and installed Sabayon Linux which was able to use his sound chip and had no problem with his graphics card. It even had "Beryl" and that was a definite "selling point" for him. He loved that eye candy! (there is a demo of it on youtube, http://www.youtube.com/watch?v=xC5uEe5OzNQ It's got cool music in the video. I like it.)
Anyway,
The cracking program that you recommended, "Windows NT Passsword & Registry Editor" worked, we were able to use that to Blank the problematic password. Then we were able to get into the recovery console. After trying in vain to get Windows to boot, we put in the KUbuntu live CD and poked around with it and Robert found out how to mount his Windows partition to Linux and it worked, he was able to read the Window's files. (This he did when I was out at a meeting last night -- I'm so proud of him for figuring out how to find and use the mount command. ). So, when I got home, I got out his DVD's and told him to open up K3B and he just dragged and dropped what he wanted to back up onto the DVD and it worked.
Then, he found "Parted" (on the KUbuntu live CD) and noticed that the Windows partition was listed but it said that it was not the "Active Partition" and there was a tool to make it active. He chose that and it worked! Windows booted! However -- the stuff we had done that first night when we chose the option to "repair windows" well, the problem was that Robert had Service Pack 2 and the CD we were using for repair was Windows XP but with Service Pack 1 so the SP2 system files were overwritten with SP1 stuff so the installation had been corrupted.
Well, that's when Robert decided to go all Linux and after playing around with the Sabayon Live DVD that my friend gave me, he loved what he saw. He had it format the harddrive and installed it - no partition. Now he is learning how to install apps from source. So far, he has installed Extreme Tux Racer and Wine.
Anyway, Robert went with KDE for his default desktop environment. I guess he prefers that because that is what I use.
*What kind of packages does Sabayon use? Is it .deb? or does it use .rpm?*
In Gnome, what is the keyboard shortcut to get to the T.O.P.? In KDE I know it's CTRL + ESC.
OK, now for his future plans:
He wants to get a much larger Harddrive and install Windows XP on it and then when he wants to switch between the two OS's, he plans to open up his lap top and take the one HD out and put the other one in. *Would that work?*
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.