Did you SCREW your Grub? Now stuck in Grub Rescue?
I recently totally jacked up my boot loader while doing some formatting on some other drives. I don't know how, but it took me FOREVER to find a solution that worked.
If you are using Ubuntu 9.1 and or 9.04 and need to update or restore GRUB, follow these directions. It worked for me and everything is back to normal.
https://help.ubuntu.com/community/Grub2#Resolving an "Unrecognized Device String" (Error 11)
You will want to use the LIVE CD portion of instructions. It is easy and it works.
BIG NOTE: The instructions have 2 variables listed; X and Y. The reference your hard drive such as sda1 or sdb1, etc.. X being a and Y being 1. They do not reference what you see in grub rescue. (hd0, hd0,1, etc...)
SIMPLEST - Copy GRUB 2 Files from the LiveCD
This is a quick and simple method of restoring a broken system's GRUB 2 files. The terminal is used for entering commands and the user must know the device name/partition of the installed system (sda1, sdb5, etc). The problem partition is located and mounted from the LiveCD. The files are then copied from the LiveCD libraries to the proper locations and MBR. It requires the least steps and fewer command line entries than the following methods.
1. Boot to the LiveCD Desktop (Ubuntu 9.10 or later).
2.
Open a terminal by selecting Applications, Accessories, Terminal from the menu bar.
3.
Determine the partition with the Ubuntu installation. The fdisk option "-l" is a lowercase "L".
1.
sudo fdisk -l
If the user isn't sure of the partition, look for one of the appropriate size or formatting.
Running sudo blkid may provide more information to help locate the proper partition, especially if the partitions are labeled. The device/drive is designated by sdX, with X being the device designation. sda is the first device, sdb is the second, etc. For most users the MBR will be installed to sda, the first drive on their system. The partition is designated by the Y. The first partition is 1, the second is 2. Note the devices and partitions are counted differently.
4. Mount the partition containing the Ubuntu installation.
sudo mount /dev/sdXY /mnt
Example: sudo mount /dev/sda1 Note: If the user has a separate /boot partition, this must be mounted to /mnt/boot
5.
Run the grub-install command as described below. This will reinstall the GRUB 2 files on the mounted partition to the proper location and to the MBR of the designated device.
sudo grub-install --root-directory=/mnt/ /dev/sdX
Example: sudo grub-install --root-directory=/mnt/ /dev/sda
6. Reboot
7.
Refresh the GRUB 2 menu with sudo update-grub
Comments
-
In my experiences the only one that worked every time for Grub2 was option 3, for chrooting into your existing system to re-post the grub2 image to your mbr.
As a note, the directions work for Grub2 was was included in ubuntu 9.10 and not previous releases, for previous releases that are using Grub, not grub2, refer to https://help.ubuntu.com/community/RecoveringUbuntuAfterInstallingWindows0 -
I think my Grub was not Grub2. I did a upgrade from 9.04 to 9.1. Thanks for the follow up.
-Josh0 -
Actually, the Live CD I used was 9.04.0
-
What was driving me crazy about upgrading via the update manager from 9.04 to 9.10 was that it was trying to force grub2 to install, because I have so many systems on my dual boot I am using a custom grub conf from Slackware and I did not want Ubuntu to overwrite it with the auto-detected options.0
-
One thing I am beginning to really start to notice is, Ubuntu kind of assumes you want things a certain way. As I get deeper into linux, I'm sure I will try some more advanced distros.0
-
I really like that you have said that because it is showing that you are learning to look deeper into the system and ask how things work.
I have been using Slackware since 2002 because of the lack of assumptions, there are too many distros that I am seeing that are making the assumptions which are adding too many additional points of potential failure and complexity. I give these distros credit for their goals and accomplishments, but I hope that they quickly learn their lessons before they compromise the integrity of their systems and loose the functionality that Linux based distros have always had.
As for the current state of Ubuntu, I think they rushed too much in trying to incorporate new features like adding pulse audio, removing hal and updating their package manager without fully testing them which is why in my opinion ubuntu 9.10 is the only bad release of ubuntu.0 -
Actually you can do something much more simple especially recommended for users who have dual-booted their PCs and use their windows(or other OS) much more than they use their Linux or other Linux distribution. While i was trying with the live CD all these instructions on fixing Grub, which took me nearly hours until i reach this helpful page and after desperately managed to fix it,(i am no computer expert, i just love open-source software like Linux) i thought a much more simpler solution... Why i just can install the Linux OS from the live CD and then log on my windows AND IT WORKED!
But Read this, it is very important!
-If you do this u will no longer be able to use your Linux OS.
-You have to have installed your Operating Systems on different partitions of your hard drive.
-After I did it all the files i had on the Linux OS where gone, so i deleted the whole partition.(One good solution of not losing your important files is to backup them in a USB while u are installing your Linux OS again.(Don't worry, usually when you log with your live CD you will be able to see,use and backup all the files you want from your hard drive)
This solution takes approximately 10 minutes and it is so easy that even someone who hasn't even heard of Linux can do it
You don't have to use a live CD! I didn't have a CD to use so a used a program named Unetbootin which writes ISO files on USBs! (So I wrote my Linux Distribution ISO file on my USB )
Fixing Grub included finding a way to fix it took me nearly 14 hours and it requires basic programming skills! But this solution takes 10 minutes and can be done even from a 5 year old kid...You choose which is best for you
(But still thanks to the creator of this post, really inspired me of thinking this solution0 -
This is exactly my problem. I did an unattended install using WUBI on a modern machine that has two drives, one Vista, and one Win7. There was room on the Win7 drive to shorten the partition and create an empty new partition using standard Microsoft Console Tools. I created a new NTSC partition for Ubuntu desktop and launched the installer.
It was late, and I went to bed, and the installer did its thing. In the morning Ubuntu ran perfectly!
Then a pop up appeared advising of over 200 updates. I clicked, and off it went. It stopped for input once, on the grub screen. The window had three partitions listed. The pop up text had three paragraphs appeared to say in the first paragraph to "select all of them" and in the last paragraph not to. I went with the first paragraph and clicked them all. Now Ubuntu does not work. Nothing does. In the middle of my computer's start sequence, while "Verifying DMI Pool data" an error pops up " Error: No such device.." followed by some hex code. On the next line is the grub rescue> prompt. But it does not recognize any command I give it, even the ones from various grub 2 docs.
I was delighted to see how easy the install went, but sad to see how easy it broke. Most of the instructions for making this better involve burning an ISO image of a Live CD and accessing that portion of the bootloader. But this machine has no optical drives. I do have a Terabyte USB drive, but none of the instructions cover that.
So I feel that victory was in my grasp, and after i did an upgrade, it went south. Any way to unravel that upgrade? If this were Windows, I could just go to a restore point. But of course, I can't even boot the machine now.
Help?0 -
Update--
Based on one of the other comments in this thread (Kode followed by Google), I looked at WUBI again, and the Wikipedia articles say it is pretty heavily integrated with Windows, and my not have used my new partition at all, but rather written the install to a file within Windows 7. I told the WUBI installer to put it there, but I did not verify it. If I read correctly, this may make it impossible to remove the Ubuntu with either a LiveCD or with Unetbootin. And of course, my machine won't start.
Help?0 -
Yet Another Update
1) The DMI sequence stops at ACPI controller. Some literature (Tom's hardware ACPI section) suggests that certain boot loaders overwrite a part of the MBR that is really critical to getting the machine running. May have to look at using a superboot disk to get the machine running so I can undo what the Grub update did.
2) The Grub Rescue prompt does in fact respond to valid commands. I will head back in with a list of commands on the chance that there is a fix. Any advice?0 -
If you are getting the grub prompt on startup that means that the wubi installation was not processed, it instead attempted a physical installation to the partition you created. I don't know what an NTSC partition is, so instead I will assume that you meant that you setup an NTFS partition that it then installed ubuntu into. If in fact it attempted to install ubuntu in an ntfs partition then that could be your problem since the bootloader is made to read unix type filesystems to get the configuration file.
To correct your problems you can use the windows recovery tool from boot to get into the recovery terminal and run fixmbr which will reinstall the windows bootloader, once in windows you can attempt a wubi installation inside your primary hard drive. If that is successful then ubuntu will use the windows bootloader to choose the operating system and grub will be chainloaded from within the filesystem file.0 -
Marco Braida answers a lot of questions on this matter at launchpad.net. --Question 120822. He seems to suggest the issue is related to Wubi, and urges installing on an actual partition. I am not sure where the problem lays, but somewhere in the combination of easy-to-use tools, I ran into some big trouble. If I was a Windows user "giving Linux a go", this would have been a poor beginning. :unsure:
Thanks to all who helped.
PS: NTSC is a television broadcast standard. I spent many years as a broadcast engineer. NTFS is a file system, and that is what I meant to have typed. And the Wubi install was pointed into a partition I created using the Windows Disk Manager MFC in empty space on the drive.
----snip---
This is an excellent summary. I ran into just this issue, and on researching it here and elsewhere I found the things you say about Wubi to be the case. The Wubi install is very easy. It is silent. For the most part everything autocompletes. But yes, it, or something it contributes to, can cause a problem with booting the computer, in my case, after Ubuntu offered auto updates. This was un-recoverable, so I eventually just did an install from the iso image, as you suggest above, and told it to delete and use the entire disk.
My problems focused around booting. After powerup, when the computer was running through its list of PCI connections, this process terminated early, and it changed to "Boot From CD ROM:" If the CD was in the drive, it rolled the CD. If not, it returned a "No Device Found error, and terminated the boot. The last thing in the PCI device report was ACPI, and this line was not displayed completely. Many sources recommend adding "noapci" in the bootloader file. This may help, but as my computer would not boot, I found it hard to edit that line. Some skill with using a live CD to edit files in the install will be valuable, and I intend to learn them. On the other hand, Wubi may have modified the MBR of my Win7 install, and in that case some of my helpers have suggested that the answer is to run FIXMBR using the Windows rescue disk.
There seem to be a number of people who fall into this problem, and the traffic I have found focuses on ACPI, Wubi, Ubuntu 10.4, and, again, the upgrades that are offered after you are running, which was the beginning of my problem. If Cannonical intends 10.4 to exploit the gap caused by the release of Windows Vista, then it must not be this easy to blow up a working machine.
Thank you, All.0
Categories
- All Categories
- 217 LFX Mentorship
- 217 LFX Mentorship: Linux Kernel
- 788 Linux Foundation IT Professional Programs
- 352 Cloud Engineer IT Professional Program
- 177 Advanced Cloud Engineer IT Professional Program
- 82 DevOps Engineer IT Professional Program
- 146 Cloud Native Developer IT Professional Program
- 137 Express Training Courses
- 137 Express Courses - Discussion Forum
- 6.2K Training Courses
- 46 LFC110 Class Forum - Discontinued
- 70 LFC131 Class Forum
- 42 LFD102 Class Forum
- 226 LFD103 Class Forum
- 18 LFD110 Class Forum
- 37 LFD121 Class Forum
- 18 LFD133 Class Forum
- 7 LFD134 Class Forum
- 18 LFD137 Class Forum
- 71 LFD201 Class Forum
- 4 LFD210 Class Forum
- 5 LFD210-CN Class Forum
- 2 LFD213 Class Forum - Discontinued
- 128 LFD232 Class Forum - Discontinued
- 2 LFD233 Class Forum
- 4 LFD237 Class Forum
- 24 LFD254 Class Forum
- 694 LFD259 Class Forum
- 111 LFD272 Class Forum
- 4 LFD272-JP クラス フォーラム
- 12 LFD273 Class Forum
- 146 LFS101 Class Forum
- 1 LFS111 Class Forum
- 3 LFS112 Class Forum
- 2 LFS116 Class Forum
- 4 LFS118 Class Forum
- 6 LFS142 Class Forum
- 5 LFS144 Class Forum
- 4 LFS145 Class Forum
- 2 LFS146 Class Forum
- 3 LFS147 Class Forum
- 1 LFS148 Class Forum
- 15 LFS151 Class Forum
- 2 LFS157 Class Forum
- 25 LFS158 Class Forum
- 7 LFS162 Class Forum
- 2 LFS166 Class Forum
- 4 LFS167 Class Forum
- 3 LFS170 Class Forum
- 2 LFS171 Class Forum
- 3 LFS178 Class Forum
- 3 LFS180 Class Forum
- 2 LFS182 Class Forum
- 5 LFS183 Class Forum
- 31 LFS200 Class Forum
- 737 LFS201 Class Forum - Discontinued
- 3 LFS201-JP クラス フォーラム
- 18 LFS203 Class Forum
- 130 LFS207 Class Forum
- 2 LFS207-DE-Klassenforum
- 1 LFS207-JP クラス フォーラム
- 302 LFS211 Class Forum
- 56 LFS216 Class Forum
- 52 LFS241 Class Forum
- 48 LFS242 Class Forum
- 38 LFS243 Class Forum
- 15 LFS244 Class Forum
- 2 LFS245 Class Forum
- LFS246 Class Forum
- 48 LFS250 Class Forum
- 2 LFS250-JP クラス フォーラム
- 1 LFS251 Class Forum
- 151 LFS253 Class Forum
- 1 LFS254 Class Forum
- 1 LFS255 Class Forum
- 7 LFS256 Class Forum
- 1 LFS257 Class Forum
- 1.2K LFS258 Class Forum
- 10 LFS258-JP クラス フォーラム
- 118 LFS260 Class Forum
- 159 LFS261 Class Forum
- 42 LFS262 Class Forum
- 82 LFS263 Class Forum - Discontinued
- 15 LFS264 Class Forum - Discontinued
- 11 LFS266 Class Forum - Discontinued
- 24 LFS267 Class Forum
- 22 LFS268 Class Forum
- 30 LFS269 Class Forum
- LFS270 Class Forum
- 202 LFS272 Class Forum
- 2 LFS272-JP クラス フォーラム
- 1 LFS274 Class Forum
- 4 LFS281 Class Forum
- 9 LFW111 Class Forum
- 259 LFW211 Class Forum
- 181 LFW212 Class Forum
- 13 SKF100 Class Forum
- 1 SKF200 Class Forum
- 1 SKF201 Class Forum
- 795 Hardware
- 199 Drivers
- 68 I/O Devices
- 37 Monitors
- 102 Multimedia
- 174 Networking
- 91 Printers & Scanners
- 85 Storage
- 758 Linux Distributions
- 82 Debian
- 67 Fedora
- 17 Linux Mint
- 13 Mageia
- 23 openSUSE
- 148 Red Hat Enterprise
- 31 Slackware
- 13 SUSE Enterprise
- 353 Ubuntu
- 468 Linux System Administration
- 39 Cloud Computing
- 71 Command Line/Scripting
- Github systems admin projects
- 93 Linux Security
- 78 Network Management
- 102 System Management
- 47 Web Management
- 63 Mobile Computing
- 18 Android
- 33 Development
- 1.2K New to Linux
- 1K Getting Started with Linux
- 371 Off Topic
- 114 Introductions
- 174 Small Talk
- 22 Study Material
- 805 Programming and Development
- 303 Kernel Development
- 484 Software Development
- 1.8K Software
- 261 Applications
- 183 Command Line
- 3 Compiling/Installing
- 987 Games
- 317 Installation
- 96 All In Program
- 96 All In Forum
Upcoming Training
-
August 20, 2018
Kubernetes Administration (LFS458)
-
August 20, 2018
Linux System Administration (LFS301)
-
August 27, 2018
Open Source Virtualization (LFS462)
-
August 27, 2018
Linux Kernel Debugging and Security (LFD440)