Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
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 standard technique of rescuing a working but unbootable is to boot up a kernel, either from the Linux original CD or any Live CD, mount the Linux root partition, change root to it and do a
Before executing the grub + root + setup statements, I did try grub-install /dev/hda.
However, since my kernel detected my HD as /dev/sda and also my Linux partition was on /dev/sda6, I have tried the following and was not really successful. Dont know for what reason, but the 2.6.x kernel detect SATA HD as /dev/sda.
grub-install /dev/sda
exit and reboot, nothing was changed, still bootup to WinXP
grub-install /dev/sda6
exit and reboot, got GRUB menu back again and can see my multi-boot menu. Choose Linux, boot ok. But if I choose WinXP from the menu, it can't boot to WinXP and the grub menu keep on repeating itself going back to the grub multiboot menu.
Anyway, thanks again for your input and assistance.
Look you must be inside the Linux that you want to restore its boot loader first when issuing a grub-install because Grub fetches the information of the loaded Linux partition and put into the destination specified by you.
/dev/sda means go to MBR of 1st Sata
/dev/sda6 means inside the root partition of / if you have installed the root of the GNU/Linux there
/dev/fd0 means to put Grub into a bootable floppy.
The first and last alternative can boot the system directly. For the second choice the GNU/Linux cannot boot itself but can be "chainloaderable" by another boot loader, which can be XP'sNTldr, Lilo or another Grub.
I stated in my reply that you need to "change root" to it!
So if you boot up from a Live CD the complete instructions are
mkdir /mnt/sda6
mount /dev/sda6 /mnt/sda6
chroot /mnt/sda6
grub-install /dev/sda
If you do a grub-install from the Linux off the CD it wouldn't have the necessary files and if it has the partition reference would be nothing like sda6 so of course it wouldn't work.
Do you still have a problem?
If the answer is yes then do a fdisk -l and list its content
OK I am not here to impose whatever method a user should use to rescue a Linux. I tried to explain the steps and hope the user appreciate the commands.
Here are a few points for future reference
(1) The change root method works for all systems "including" a Linux with Lilo.
(2) You can make a bootable Grub floppy, unattacthed to a Linux, boot it up and type the same 2 lines of
grub>root (hd0,5) <-----Tell Grub the root of the partition you are interested is (hd0,5)
grub>setup(hd0) <------ Set up the Grub boot loader in (hd0) using root information obtained from above.
Try GRUB for DOS please. It is a cross-platform boot loader based on GNU GRUB. The GRUB.EXE can be started from DOS/Win9x; and GRLDR can be started from BOOT.INI of Windows NT/2K/XP/2003; and even more, the GRUB.EXE can be started from LINUX via the KEXEC tool.
By using GRUB.EXE or GRLDR, you don't have to touch your MBR. It is the safest way coexisting with DOS/Windows.
You needn't install GRUB for DOS. Just run GRUB.EXE from DOS, or append a line of "C:\GRLDR=START GRUB" into your BOOT.INI(restart and select the "START GRUB" menu item), that will do.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.