-   Linux - General (
-   -   formatted my c:, linux boot data lost, how could i recover (

sas_tvr 01-18-2005 07:37 AM

formatted my c:, linux boot data lost, how could i recover

I had a dual os. Redhat 9 and win98. After sometime i formatted my primary partition C:. I lost my bootrecord about my Redhat 9.How could i recover the boot record and how could i add the previously installed Redhat 9 without reinstalling it.

Can anybody help me?

jschiwal 01-18-2005 07:56 AM

If you didn't delete the c:\ drive (hda1) then the information used for lilo or grub hasn't changed (except for the windows entry which you can remove if you want). You need to boot up into the rescue system. Then you need to mount you file system under /mnt. Mount the root partition first. Then you can read the /etc/fstab file to help you mount the other partitions needed.
2) Next, use the chroot command. chroot /mnt.
3) To set up the root accounts normal paths enter: bash -l. This starts up the login shell which will set up the aliases and paths.
4) If you want to do this now, remove the stanza for booting windows, since it no longer exists. (/etc/lilo.conf for lilo and /boot/menu.lst or /boot/grub/menu.lst for grub.
5) Execute the command to rewrite the MBR. For lilo /sbin/lilo. For grub [/b]/usr/sbin/grub-install[b].
6) Watch the output of the command. For example, if there is an error in /etc/lilo.conf, the lilo command or a drive device doesn't exist, lilo will complain and the MBR will not be replaced. So you need to make sure that the last step worked before trying to reboot.
7) Reboot and cross your fingers.

All times are GMT -5. The time now is 03:29 AM.