LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   accidentally reset master boot record (https://www.linuxquestions.org/questions/linux-hardware-18/accidentally-reset-master-boot-record-22955/)

jessiscroggins 06-08-2002 09:57 PM

accidentally reset master boot record
 
I'm a newbie, so forgive me for my stupidity. I bought a second hard drive and had installed RedHat 7.2 on it. I used to have a duel boot screen where I picked which OS to start up with. About 6 months after I installed Linux, I got an error message (in windows ) saying that something (possibly a virus) had changed my master boot record and asked if I wanted to ignore the change or restore it to the previous master boot record. I clicked restore and it restored it to the point before I had installed linux and set up my second hard drive. Is there any way to fix it back without reinstalling the software and reformatting the second hard drive?

finegan 06-09-2002 01:18 AM

If you can boot that second drive, hopefully with a Linux boot disk that you made during install, then its easy. Just use that to boot into linux, and then re-run the boot loader. Either from the command line with: /sbin/lilo, or /sbin/grub (depending on the boot loader).

If you don't have the boot disk, use an install CD and boot with that. Ignore the graphical cute install crap and hit ctrl+F2+alt and you've got a shell. Then you have to mount the Linux drive's root partition. Assuming its the second hard drive on the first IDE controller and that the root partition, / is the first partition:

mount /dev/hdb1 /mnt

chroot /mnt

Now you've mounted the Linux drive and switched to it being your root partition. Now you should be able to re-run the boot loader. It'll write the boot loader back to whatever it was.

Cheers,

Finegan

Half_Elf 06-11-2002 01:26 PM

Quote:

Ignore the graphical cute install crap and hit ctrl+F2+alt
LOL nice Finegan :D
I like my Slack install disk without all these cuty crappy GUI

sewer_monkey 06-11-2002 01:32 PM

With RedHat 7.2 you'll probably want to install GRUB, so follow Finegan's instructions, then run the command grub-install /dev/hd? where /dev/hd? is the hard drive whose Master Boot Record you want GRUB to be installed on.


All times are GMT -5. The time now is 02:26 PM.