Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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.
I have just installed Ubuntu 7.4 , I made the mistake of choosing "continue without a bootloader" because grub and lilo failed to install.. I have xp on another partition and it fails to load now.
When i start my machine I get the grub rescue command prompt.
How can I boot to Ubuntu from this prompt? and can I install grub once I boot to Ubuntu ?
If you know the name of the kernel you are using and the partition name you installed to, then you should be able to boot to Ubunut from the command line. But in your case I wonder if it wouldn't be easier to try to install GRUB from your live CD (assuming that is how you installed in the first place).
To do that, after booting the live CD, bring up a terminal window (Applications -> Accessories -> Terminal), and verify you know what partitions you have by typing (what you type is in red):
Code:
$sudo fdisk -l
You will probably see two partitions, with the first being the MS Windows (NTFS) partition and the second being your Linux installation. If so, proceed:
If all goes well, you should be able to reboot, remove the CD and boot into Ubuntu. You can then adjust /boot/grub/menu.lst (if needed) so that at boot time you choose either operating system.
Mmmm - that will (usually) recover a previously working grub. The OP said grub failed to install. Setup will only build the loader code (in the MBR with the above commands), and maybe stage 1.5
Boot will require the support files normally found in /boot/grub/*
With something like Ubuntu, probably easiest to re-install.
Yea, I wasn't sure from the first post just how far things had gotten when the failure occurred. I'll note that since XP no longer boots, the Ubuntu installation must have done something to the MBR. Since this is fresh install, a reinstall might be easier -- unless the same problem occurs again. I figured I'd wait for feedback from the OP and adjust my advice accordingly ... unless somebody beat me to it.
A reinstall would probably be easiest but if you wanted to fix it instead of startover. I would boot into the Windows Cd start the recovery console type fixmbr. That will make it so that you can boot into windows at least. Then you can boot into windows and edit the boot.ini file through msconfig. But yes the easy way is to do a reinstall.
When Ubuntu says the boot loader not installed it means only "to" the MBR or root partition. Grub is part of the kernel and will have been available regardless. blackhole54's advice is therefore the best and the one I would recommend too since the OP has already confirm Grub "is" available with a Grub prompt on booting up.
There is no necessity to go through a Linux in this case the equivalent "fdisk -l" in a Grub prompt is simply
Code:
geometry (hd0)
and so if the partition 1 of disk (hd0) is the first one with Type 83, indicating /boot or the root partition of Ubuntu, then Grub can be installed into the MBR of the first disk (hd0) by "sourcing" the files from partition (hd1,0) by command in Grub prompt
Code:
grub> root (hd0,1)
grub> setup (hd0)
It will boot immediately by command in Grub prompt
Code:
configfile (hd0,1)/boot/grub/menu.lst
or
Code:
chainloader (hd0)+1
snares's advice is the long way and IMO unnecessary because Grub is available as a Grub prompt which is the most powerful booting tool in the planet.
There is no operational PC system in existence that cannot be booted up in a Grub prompt!
To avoid it, restore Winddows' MBR to check the health of the MS Windows first and then do a re-install of the Linux second is a total disregard of what Grub can do.
OK I rephrase it. Grub or Lilo is usually built into as an optional part of the kernel commands.
Since every Linux needs a boot loader it will have either Grub or Lilo built into it. Many distros like Mandriva, Knoppix, Suse etc have both available. Slackware and Slax families are the die-hard users of Lilo but they can be booted with Grub "half-installed" (without Grub built into the kernel). There has been a significant shift toward Grub at the expenses of Lilo in the recent distributions.
OK I rephrase it. Grub or Lilo is usually built into as an optional part of the kernel commands.
Since every Linux needs a boot loader it will have either Grub or Lilo built into it.
While you need some kind of a bootloader to load the kernel and start the boot sequence, the bootloader is never a part of the kernel. (I am not sure what you mean by "kernel commands.") In addition to Lilo and GRUB, you have isolinux, syslinux, and don't forget about LOADLIN. (I've used the last to boot Damn Small Linux on an old laptop! ) While I've not used it, I believe something called the Smart Boot Loader (or something similar) can also handle the job. There may be others.
Maybe we should wait to hear from the OP again before we continue giving advice.
Hello Everyone, diging for an answer I found this thread, my problem is very similar I followed the instructions but hit a dead end and need futher help.
So my situation is that I had an WINXP partition set as primary and bootable. I then tried an install of Ubuntu 10.10 but had problems configuring the boot options and left it there. Then Install a second Ubuntu 10.10 on another partition made but the installion wizard and after that one I could use that last ubuntu installation with a boot menu and everything work fine until I decided that first ubuntu install (lets called it Ubuntu_A) had to go. So I went into the disk utilily from Ubuntu_B and deleted the linux and swap partitions of the first ubuntu install (ubuntu_A).
Today at startup my boot menu was gone and I got the same sympton described by the OP, with a grub rescue> prompt.
So in my case I need to restore the boot menu but I have a working and configured ubuntu 10.10 and a working winXP also. What I need is to restore the grub boot menu without reinstalling the ubuntu.
So far what I have done:
Loaded the Live CD
Installed Grub package on the live session
This is the output of the geometry (hd0) command:
grub> geometry (hd0)
drive 0x80: C/H/S = 60801/255/63, The number of sectors = 976773168, /dev/sda
Partition num: 0, Filesystem type unknown, partition type 0xde
Partition num: 1, Filesystem type unknown, partition type 0x7
Partition num: 4, Filesystem type is ext2fs, partition type 0x83
Partition num: 5, Filesystem type unknown, partition type 0x82
So my valid ubuntu is on partition number 4, the other ubuntu was effectively erased.
Then I run:
grub> root (hd0,4)
Then:
grub> setup (hd0)
Checking if "/boot/grub/stage1" exists... no
Checking if "/grub/stage1" exists... no
Error 15: File not found
And this is where I am right now. How can I install GRUB to partition 4 of my disk and active the boot menu to be able to access WinXP and Ubuntu 10.10?
Thanks.
Last edited by acesound; 11-03-2010 at 01:52 PM.
Reason: More info.
Are you using the Ubuntu 10.10 Live CD to run these commands?
Did you mount your Ubuntu partition from the Live CD to see if you had any Grub files on it?
If your Ubuntu partition is sda4, open a terminal from the Live CD:
Quote:
sudo mkdir /mnt/sda4
mount -t ext4 /dev/sda4 /mnt/sda4
Navigate to the /boot directory to see if you actually have any Grub files.
If not, you will have to copy them to the /boot directory on sda4.
This is what I found on the fstab file:
# /etc/fstab: static file system information.
#
# Use 'blkid -o value -s UUID' to print the universally unique identifier
# for a device; this may be used with UUID= as a more robust way to name
# devices that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc nodev,noexec,nosuid 0 0
# / was on /dev/sda7 during installation
UUID=180dcf2b-e80a-4e16-9619-d9583a013926 / ext4 errors=remount-ro 0 1
# swap was on /dev/sda8 during installation
UUID=6c0e349e-48c4-4241-8ac9-c988d96196f3 none swap sw 0 0
Here is the result for fdisk -l>
Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x3425a251
Device Boot Start End Blocks Id System
/dev/sda1 1 14 112423+ de Dell Utility
/dev/sda2 * 15 15312 122881185 7 HPFS/NTFS
/dev/sda3 15313 60802 365391873 5 Extended
/dev/sda5 19223 60037 327839744 83 Linux
/dev/sda6 60037 60802 6141952 82 Linux swap / Solaris
since you are using Ubuntu 10.10, the Grub you are using is Grub2. The files referenced in the earlier posts of this thread refer to Grub Legacy which has different files. If you have a grub.cfg file in the /boot/grub directory, that is the main configuration file. I don't have any systems using Grub2, but there should be a number of files in the /boot/grub directory.
Interesting that the geometry command output you posted earlier shows partitions starting at zero making your Linux partition #4. Your fdisk output shows your only Linux partition as sda5.
Run the same commands you did earlier with one change: root (hd0,5)
Grub 2 counts partitions from one, drives from zero.
Grub Legacy referenced in all the earlier posts counts drives AND partitions from zero.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.