Grub rescue
I stupidly repartioned a triple-boot laptop, with the intention of creating two partitions...
However, after rebooting realised I hade inadvertently removed grub. Now the system just boots into 'Grub Rescue'. Is there anything I can do to get it booted? It won't boot from either CD or USB, but seems to see these when it starts. What commands can I use for grub rescue? Failing this might have to pull the drive and hook it up to something else and re-partition and recreate GRUB. |
Hello
If you want to boot from CD you should change the boot priority from bios of your laptop. Usually when you install win the bios option to boot from CD changes and boot from Hard-disk is the first option. Kostas |
Thanks for the advice, but I already know that. Whatever settings I make to the boot menu, this laptop will not boot from CD. I have used PLop in the past but I cannot access that at the moment either.
|
Grubrescue is 1/3 of Grub2. It can't be used for booting but typing "help" will show you the commands available.
You can use the "ls" command to find out what the partitions are and what files available. Grub2 can read ntfs partitions too. Grub2's ls command is similar to Linux's ls. The cure is to restore Grub2 and this can be done by any Linux Live CD with Grub or booted up Linux from your PC. The steps are (1) Identify the partition that has Grub2, say this is sda3 (2) Mount /dev/sda3 on /mnt/sda3 (3) Bind the /dev of the current boot up Linux with the mounted /mnt/sda3/dev (4) Do a Grub-install with the root directory pointed to the mounted partition and the destination of the MBR. Typical Commands are Code:
sudo su The reason of binding is inside /mnt/sda3/dev the deivice names will be empty as they only get populated on booting when each device can be detected. Grub-install will work if /mnt/sda3 is "empty" because it will fill it up with the needed system files but you won't get the grub.cfg. You can make a Grub2 or Grub1 (doctored version for Ext4 partition) floppy to fire up the Linux or any OS. A Linux is bootable even the Linux has no boot loader installed! |
What can be done without booting from disk? 'Help' just brings up 'unknown command' so it looks like there might not be much available.
'ls' produces the following (with USB stick in): (hd0) (hd0,2) (hd0,1) (hd1) (hd1,2) (hd1,1) Think hd1 is the stick as it doesn't appear when it is not connected. Like I said a normal boot from USB or CD is not an option. I can either find a way to boot one or other from grub rescue or pull the disk and repartition by hooking it up to another machine... |
To boot a system you need Grub2 (or Grub1) to have the ability to hand over the control to a Linux or a MS Windows.
With the former Grub2 needs the command "linux" and Grub1 needs "kernel". To do the latter you need "chainloader" command from either Grub. Grubrescue is the bit that left behind in the MBR after to nuked the partition that hold its inteeligence which is a file called "core.img". core.img can be fired up by Grub1 with the "kernel" command. If you have no bootable means of floppy, CD and USB and rely exclusively booting from a hard disk then the only way out would be to remove the disk and add a Grub partition to it to make it bootable. The ls command confirms that there are two disks; one with 1 partition and the other with 2. You can ls the content of say partition (hd1,2) by command Code:
ls (hd1,2)/ If (hd1,2) has Grub2 inside you can fire it up with Code:
set root=(hd1,2) |
Sounds like I'll have to pull the disk. :(
The grub was on a partition that was removed... |
Ever consider a USB floppy drive?
|
I haven't got one, but surely if it can't see a USB drive or CD this wouldn't work either?
Anyway, I have pulled the drive and hooked it up to another machine, hopefully I can get it sorted this way. |
http://www.makeuseof.com/tag/how-to-...t-environment/
This will save you i hope. It saved me haha. I did the same thing got aggrivated with ubuntu after trying for months to install and I deleted the partitions obviously killing my mbr. |
All times are GMT -5. The time now is 12:20 PM. |