Boot with GRUB
GRUB: it's neither larva, fast food nor the loveliest of acronyms in the GNU herd of free software. Rather, GRUB is the GNU GRand Unified Bootloader. And, it is truly the greatest loader for booting Linux and practically any other OS—open source or otherwise—you may have scattered on your platters.
GRUB is independent of any particular operating system and may be thought of as a tiny, function-specific OS. The purpose of the GRUB kernel is to recognize filesystems and load boot images, and it provides both menu-driven and command-line interfaces to perform these functions. The command-line interface in particular is quite flexible and powerful, with command history and completion features familiar to users of the bash shell.
GRUB is in its element with the multiboot, multidisk systems typical of Linux and open-source adventurers who may simultaneously test or track several Linux distributions, the BSDs, GNU/Hurd, BeOS and perhaps that vestigial partition for Mr. Bill. Even if you stick with LILO as your system's primary boot loader, it's smart to keep a GRUB boot floppy handy as the best and fastest way to get your system back if you otherwise cream your master boot record (MBR). If you have done any number of multiboot installations, you know exactly what I'm talking about. Should you need any more reasons for considering GRUB, check out the sidebar, “Why GRUB”. Let's get started!
Installation of GRUB is a two-step process. The first step is to install or build GRUB in a host OS environment, and for this we will, of course, use Linux. The second step is to install and configure GRUB as the boot loader for your system.
The first step is the usual: download the source archive, untar it, configure and make install. Assuming you have found a source mirror (see www.gnu.org/software/grub/grub.html) and downloaded the source distribution into a suitable working directory, continue with:
tar -xzvf grub-0.5.96.1.tar.gz cd grub-0.5.96.1 ./configure make make install
This should create the executables: grub, grub-install and mbchk; install support files in /usr/local/share/grub/i386-pc/, and install the GNU information manual and man pages.
For the second step of installation, we will first build and work with a GRUB boot floppy. This way we can use GRUB to learn about its features while testing various configurations for our particular system. After getting comfortable with the GRUB setup on floppy, we will then install it onto the MBR of the system's first hard disk. Even if you decide not to install GRUB on your hard disk right away, no harm done: you will now have your own GRUB boot floppy available to rescue systems with trashed boot loaders.
GRUB recognizes a number of different filesytem types, including Linux ext2fs, Reiser, MINIX, BSD's ffs, as well as FAT, so it is possible to make a GRUB boot floppy with any of these filesystems. We will stick to FAT for this example, however, because it is the lowest common denominator, and most OSes have tools for mounting and reading/writing files on FAT floppies. That way, we will always be able to get to its menu configuration file if we need to.
Scrounge around in your junk drawer for some unused floppy (a new one would be even better), and give it a fresh format and FAT filesystem:
fdformat /dev/fd0 mkfs -t msdos /dev/fd0
We are going to put some files on this disk, so go ahead and mount to your usual floppy mount point (here I use /floppy):
mount -t msdos /dev/fd0 /floppyNow install the directories and files GRUB will need:
mkdir -p /floppy/boot/grub cp /usr/local/share/grub/i386-pc/stage* /floppy/boot/grubThe floppy can then be unmounted, umount /floppy, but leave it in the drive. The GRUB floppy is prepared and ready for the final installation, which is to install the GRUB boot loader in the MBR of the floppy itself. For that, we will use the grub executable we have built with our Linux installation. Start the executable at the Linux command prompt: grub.
This brings up an emulator of GRUB's command shell environment, which looks like Figure 1. We will discuss the features of this shell in more detail a little further on. For now, enter the following series of commands at the grub prompt:
grub> root (fd0) grub> setup (fd0) grub> quit

Figure 1. GRUB in command-line mode. Note the on-line help (here the GRUB emulator is running under Linux in an xterm window).
And that's it! This sequence of commands completes the installation of GRUB on the floppy disk. It is now bootable and will allow us to boot any other OS on our system.
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Sponsored by AMD
Built-in forensics, incident response, and security with Red Hat Enterprise Linux 6
Every security policy provides guidance and requirements for ensuring adequate protection of information and data, as well as high-level technical and administrative security requirements for a system in a given environment. Traditionally, providing security for a system focuses on the confidentiality of the information on it. However, protecting the data integrity and system and data availability is just as important. For example, when processing United States intelligence information, there are three attributes that require protection: confidentiality, integrity, and availability.
Learn more about catching the bad guy in this free white paper.
Sponsored by DLT Solutions
| Designing Electronics with Linux | May 22, 2013 |
| Dynamic DNS—an Object Lesson in Problem Solving | May 21, 2013 |
| Using Salt Stack and Vagrant for Drupal Development | May 20, 2013 |
| Making Linux and Android Get Along (It's Not as Hard as It Sounds) | May 16, 2013 |
| Drupal Is a Framework: Why Everyone Needs to Understand This | May 15, 2013 |
| Home, My Backup Data Center | May 13, 2013 |
- Designing Electronics with Linux
- New Products
- Making Linux and Android Get Along (It's Not as Hard as It Sounds)
- Dynamic DNS—an Object Lesson in Problem Solving
- Linux Systems Administrator
- Senior Perl Developer
- Technical Support Rep
- UX Designer
- Web & UI Developer (JavaScript & j Query)
- Using Salt Stack and Vagrant for Drupal Development
- Reply to comment | Linux Journal
4 hours 11 min ago - Dynamic DNS
4 hours 45 min ago - Reply to comment | Linux Journal
5 hours 44 min ago - Reply to comment | Linux Journal
6 hours 34 min ago - Not free anymore
10 hours 36 min ago - Great
14 hours 23 min ago - Reply to comment | Linux Journal
14 hours 31 min ago - Understanding the Linux Kernel
16 hours 46 min ago - General
19 hours 16 min ago - Kernel Problem
1 day 5 hours ago
Enter to Win an Adafruit Pi Cobbler Breakout Kit for Raspberry Pi

It's Raspberry Pi month at Linux Journal. Each week in May, Adafruit will be giving away a Pi-related prize to a lucky, randomly drawn LJ reader. Winners will be announced weekly.
Fill out the fields below to enter to win this week's prize-- a Pi Cobbler Breakout Kit for Raspberry Pi.
Congratulations to our winners so far:
- 5-8-13, Pi Starter Pack: Jack Davis
- 5-15-13, Pi Model B 512MB RAM: Patrick Dunn
- 5-21-13, Prototyping Pi Plate Kit: Philip Kirby
- Next winner announced on 5-27-13!
Featured Jobs
| Linux Systems Administrator | Houston and Austin, Texas | Host Gator |
| Senior Perl Developer | Austin, Texas | Host Gator |
| Technical Support Rep | Houston and Austin, Texas | Host Gator |
| UX Designer | Austin, Texas | Host Gator |
| Web & UI Developer (JavaScript & j Query) | Austin, Texas | Host Gator |
Free Webinar: Hadoop
How to Build an Optimal Hadoop Cluster to Store and Maintain Unlimited Amounts of Data Using Microservers
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Some of key questions to be discussed are:
- What is the “typical” Hadoop cluster and what should be installed on the different machine types?
- Why should you consider the typical workload patterns when making your hardware decisions?
- Are all microservers created equal for Hadoop deployments?
- How do I plan for expansion if I require more compute, memory, storage or networking?




Comments
grub still left on HD after disk recovery performed
I "inherited" this computer from my son and had to perform system recovery. Now the machine does not want to reboot properly. Just after powering up instead of normal Windows XP loading process to take place all I get is a grub prompt.
I learned from this forum that Linux must have been loaded into a partition on my hard drive. And Grub must have been used to achieve this goal. Why the system recovery process does not wipe out everything clean? Why Grub persists and lingers somewhere on my machine?
I used the command chain: rootnoverify (hd0,0)/makeactive/ etc, etc and it gets me to Windows. But now i have to do it every time I start the computer.
Is there a way to get rid of Grub? I don't need it since I will only run Windows XP on this machine?
BTW, Grub does not seem to be installed properly anymore. If it is installed ok how can I get it change default=0 to default=saved as one of the post suggested to stop it from looking for other booting options.
Thanks for any help.
Paul
grub error
cannot 'unload' GRUB anymore...it ends up with ERROR 22 does not want to enter BIOS so I am pretty much stuck in here...
any hints?? please..
Linux bootloader entries
All of the boot loaders apparently add bits and pieces to the Master Boot Loader. If you have a problem with this, it is because the MBR remains even thru changes in the partition table. I finally resorted to using the disk manager for my HD to give it a new MBR and strictly avoided installation of an overlay.
Fstab
Hi Sir,
when i go to see the contents of fstab file,it gives message that "couldn't open file fstab"
sir please could u tell me the solution?
fstab
try going into termanal and useing the following commands
cd /etc (or whatever the location of your fstab)
sudo gedit fstab (if you do not use gnome replace gedit with your favorite text editor)
hope it helps!
Grub vs Lilo
The main reason I still (yes, still) stick to LILO is the test kernel feature (-R, default kernel for next reboot). The last I checked, Grub didn't support this.
Ok, not everyone needs to install new kernels on remote systems, but that feature has saved me a number of times when the new kernel failed to load and all I had to do was ask to have the machine rebooted. The spartan interface is a small price to pay for the simplicity and this feature of Lilo.
Re: Grub vs LiLo (testing new kernels)
The "Making your system robust" section of the grub manual talks about setting up fallbacks for remote booting.
grub
Exellent explanation how GRUB works, and more..
You saved a newbie from loosing his documents after a try of Linux.
I'll stay with you
gr
kees
Excellent Info
The information that was given here by Marshall was excellent. Hat's Off to Wayne Marshall. I breathe a lot easier with grub now. Happy Grubbing .....
:-)
Grub is realy the ugliest
Grub is realy the ugliest piece of software that I ever instaled on my machine. I am a "newbie" to linux and so have done a little stupid thing, adding a new partion without telling Grub. The result was that I had to reinstall that ugly shit, without having access to internet. It was not before few terrifying hours that I had a disc with linux in my hands supporting that shit Grub, so I could restore my machine and get access to my stuff...
I personalyhate that thing
Grubby li'l boot loader
I have my reservations about GRUB, too, and I'll admit, I've spent a few sessions turning the air blue after it hozed a disk.
But the previously abysmal docs are improving, and articles like this are helping a LOT!
You might try the old System Commander bootloader from VSystems, or the OS-BS Beta-2 loader found on the FreeBSD distro archives. They do a pretty good job of recognizing boot signatures, and being able to restore a munged MBR.
As for booting WinBlows, anyone THAT stupid gets no help from me.
mweep-(n):The sound of of a Sun Microsystems SPARCStation system bell.
Ugly attitudes
I'd stay anonymous too with such an attitude.
Cant Blame u. Grub is ugly
Cant Blame u. Grub is ugly but very much powerful as compared to lilo.
You should have still had the command line
I appreciate that even if I do make a mistake, I don't just get:
LI
With grub, unless I wiped out the boot sector, I still get:
grub>
any help
just screwed a HDD with grub, getting an error and want to change/delete the MBR or just simply want to boot from DVD...any chances??
Hard Road
With this attitude, learning Linux is going to be a long hard road for you. With power, comes flexibility and sometimes having to learn something new. Windows XP has it's own bootloader which has sent uncountable administrators into cardiac arrest and it's not OS independent. Your struggle with Grub might have more to do with not not yet having a good foundation in other areas. If you continue with your studies, hopefully you will one day look back and realize you just didn't have the whole picture.
grub boot floppy on Fedora
Two things you might need to know for making a boot floppy disk for Fedora Linux. Tested on Fedora Core 4, probably true for all versions.
Fedora doesn't use "menu.lst" for the menu file. It uses "grub.conf". You can't put "grub.conf" on a msdos floppy due to the 8.3 filename restrictions. So in the directions above use:
"mkfs -t ext2 /dev/fd0" instead of "mkfs -t msdos /dev/fd0"
and of course change the mount option to "-t ext2".
Then make a menu file named "grub.conf" and put it in the "/boot/grub" directory.
--
Mark Nienberg
booting
I have a problem with dual booting. I have 2 hard disks. On one I have installed win Xp and on other I have installed Fedora 4. now if want to booth either of the operating system. I go to bias settings disable the drive which has other operating system and then reboot. But this is a awkward and inconvenient all the time. I know GRUB entry can solve this problem. Could you please guide me on this? The drive on which fedora is installed is partitioned into 8 each containing /, usr, home etc… both the hard disk is 120GB. My expertise level as Linux user is beginner so please be explicit in your guidance.
Expecting your answers as soon as possible.
Thanks a lot,
Sincerely
--Pradeep
booting
I had the same problem, but I got it fixed like that.
Fedora can only be instaled on the master drive (if you have IDE) but afterwards you can plug it back to slave. Grub will be automatically installed on the drive where you have your Fedora system on.
this drive is hd0 in Grub. So trying to boot your WinXp install on the other drive needs following section in your menu.lst :
title Windows XP Pro
rootnoverify (hd1,0)
map (hd0) (hd1)
map (hd1) (hd0)
chainloader +1
I hope this also works with your system, for me it worked fine
Re booting
This might add some insight to your problem.
http://64.124.13.3/hacks/USB_Boot_using_GRUB.html
Recovering from deleting a LINUX partition from WINDOWS
Thanks Wayne. This stuff has been very useful.
I wanted to repartition the hard drive. But the existing Linux partition was after C Drive and before D drive of windows. I had deleted the linux partition via windows and claimed the space.
However this resulted in a stage2 grub boot problem.
Having struggled for 4 Hrs (I am an amateur in Linux & Grub) I figured out the following:
1) Create a partition at the end hard drive and format it to FAT32.
2) Create the following folder structure
E:/boot/grub
3) Download the STAGE1 & STAGE2 executables from the website ftp://alpha.gnu.org/gnu/grub/
grub-0.94.-i386-pc.tgz
Created the following files:
E:/boot/grub/menu.lst
Saved the following files from the zip:
E:/boot/grub/stage1
E:/boot/grub/stage2
3) Issued the following command when grub was failing to load the STAGE2
install (hd0,2)/boot/grub/stage1 (hd0,2) (hd0,2)/boot/grub/stage2 0x8000 p (hd0,2)/boot/grub/menu.lst
4) Walla!! I am up and running without floppy disks or CD's.
AJ
GRUB/ Booting changing monitor resoluton
I really screwed up -- I changed the monitor resolution settings in GNOME beyond the scan lines of the monitor attached to the box. What can I do from the grub prompt to reset the monitor resolution and boot? Anyone at all? Thanks. -J
Boot into a recovery mode
If you don't have any chance to get to the console with this problem (ctrl-alt-f1 for example) try booting into a recovery mode via Grub. If your grub menu doesn't include a recovery option, you'll have to switch to the command line. Try a kernel line like:
kernel /boot/vmlinuz-versioninfo-blah root=/dev/whateverlikehda1 ro single
The 'single' option should drop you into the console as root.
Grub and Windows XP
Getting Grub to boot XP without "dd"ing anything.
Just to share what worked for me. After moving and resizing XP and its Recovery partitions on a cheap preloaded CPU box and installing Linux RH 9 in extended partitions, Grub would not boot XP with the normal "rootnoverify ..., chainloader +1, makeactive" comamnds, like XP had to have the MBR.
I made an XP boot floppy as instructed at the MS site--"format a:" in XP--then copy the three files (ntldr, ntdetect.com, boot.ini). But sure the floppy boots XP. (XP's format command evidently puts something in the floppy's boot record.)
I moved XP partitions one more time (Partition Magic 8.0 diskettes) to make room for a small (30Meg, could be smaller) Partition 1 at the beginning of the hard file. Edit boot.ini on the floppy, bumping the "...partition(X)" number by 1. Boot XP from the floppy.
Do the same thing to tiny Partition 1 you did to the floppy, "format :", copy three files including the working boot.ini from the diskette.
Now the "rootnoverify (hd0,0), chainloader +1 ..." sequence to the tiny partition works. At some point above you may want to CD boot Linux and use "fdisk" to be sure the partitions are in consecutive order.
I welcome any comments. Someone may know a reason why this procedure is bad. Please let me know.
The GRand Unified Boot grief of GRUB
Sorry, I just can find better words to put it :-). Back in 2002 I tried Grub on a system upgrade and it totally screwed my system, no linux and no windows!!!. That happened in two ocassions in spite of me having extensive LILO experience and having done countless linux upgrades and installations.
LILO was a bit cryptic but it was relatively simple and worked all the time. GRUB has a nice interface to select but to get that working you have to endure cryptic nomenclature that is confusing considering the standard that was already set forth (HDA1, HDB2, etc.).
FDISK /MBR ? well, let me tell you, that does not always work. At least it didn't when GRUB gropped my MBR. The Windows rescue console (XP installation CD)? my God, stay away from it for your own sake! it only made things worse.
My advise: before making any Linux/Grub installation make yourself a favour, make a bootable floppy (as shown in this article), Go to the Symantec site and search for 'head.zip', download that wonderful DOS utility and use it to back up your MBR and your first head safely to the same floppy disk. If anything goes wrong (and with GRUB I would say the chances are great) you can use the same utility to put back the original MBR (and it always works).
Back then since my MBR was already fried it was "late" to use the utility. I had to use a Linux rescue CD to use the dd command to copy the backup boot sector (I forgot what the offset is) and manually copy it to the active boot sector. Then I got my Windows (and by God I was never so glad to see my WinXP boot screen, and without GRUB!!!) running, a fresh resurected MBR and used the utility to back it up just in case things turn sour one day.
NOw 2-4 years later I was hopping GRUB had overcome those things, WRONG!!! I think it only serves to scare newbies (and oldies!) away from Linux. GRUB people & DIstro makers, get that monster more fool proof.
So far I have not found answers to my new attempt: WinXP on SDA (1st SATA) and Fedora Core 4 on SDB (2nd SATA). I certainly do not want to undergo the same nightmare and grief again.
WinXP and Fedora Booting
I was wondering have you figured out to boot xp and fedora - xp on sda and fedora on sdb(2SATA drives)?
This has me stumped and I'd be grateful for any help.
Thanks.
HEAD.EXE is no longer available
The greedheads at Symantec must have gotten wind that their little utility was useful, because it is no longer available. But check around, anyway; it may be available on one or more of the MBR and partition hackers' sites. There are also several "clones" of the program that predate Symantec's use of it. Generally speaking, they're either scripts to the XNIX "dd" command, or disk image copiers.
I'm sure HEAD.EXE will be available again from Symantec as a $49.95 megaprogram with about 500 MB of bloatware.
Symantec: We know that amateurs developed it. We know it's in the public domain. But we recompiled it, so pay up, suckas!
Symantec still has HEAD.ZIP
Symantec still has HEAD.ZIP freely available:
ftp://ftp.symantec.com/public/english_us_canada/tools/pq/utilities/head.zip
The utilities folder has other former PowerQuest tools.
Want to run screaming back to LILO
Boy I am so agreeing with you about GRUB. What strangeness. I was all over setting up dual boot configs with LILO, now this. I had to work hard to change my FC5 install so that GRUB didn't eat a partition. Then there was the problem that the default boot-up after Linux install was to Linux, not XP. Because of the GRUB graphical command interface, the short default timeout of 5 seconds would expire before my LCD could sync to the image (character command interface of LILO never had this problem). I had to learn a lot about GRUB in a hurry to restore my ability to boot into XP (editing grub.conf). FC5 install never prompted me to make a boot floppy, in fact never gave me the option not to mess up my MBR, it just trashes the MBR with GRUB.
Now I would like to run screaming back to LILO, but can't seem to get it to work. Installing the LILO rpm is no problem. However, making a boot floppy with LILO seems to just put my machine into an infinite reboot loop. Using LILO on the hard drive makes Linux unbootable (and it can't be repaired without reinstalling Linux, fortunately XP is still bootable under LILO). I can't figure out what's wrong - I use the exact same LILO setup I've used a hundred times, but it leads to a kernel panic during boot. I can't run it solely from the floppy either, because vmlinuz is now too big to fit on a floppy. Fedora seems to be moving in the wrong direction on this.
Help?
WinXP on SDA (1st SATA) and Fedora Core 4 on SDB (2nd SATA)
Need to help to load WinXP on SDA (1st SATA) and Fedora Core 4 on SDB (2nd SATA). Already Win XP is up and running on SDA, having problem in installing Fedora Core 4.
Emilio Any luck on this?
could you say the bias setup
could you say the bias setup in installation of linux in sata hard disk.
WinXP on SDA (1st SATA) and Fedora Core 4 on SDB (2nd SATA)
This can be done and I just did it.
I have two SATA disks, both 250GB, and first disk is loaded with OEM Windows XP. I then add a second disk to install Fedora Core 5. FC5 was installed to the second disk without problem, but after reboot, it starts XP like there is no Linux nor GRUB installation.
In order to make it work, I did the following.
1. Install FC5 to the second disk (sdb) and put the loader to your boot partition, /dev/sdb1. Don't put it to the MBR.
2. After installation, boot with 'linux rescue'
3. Make a boot file, boot.lnx, by the following command.
dd if=/dev/sdb1 of=boot.lnx bs=512 count=1
(Note: I don't have a diskette, so (probably why) FC5 didn't ask me to make a boot disk.)
4. Make a copy of the boot.lnx to your XP file system. You can copy to a diskette if you have a diskette drive. I mount one of the FAT32 by doing 'mount /dev/sda2 /tmpmnt'. Use command 'fdisk -l' to find available devices.
5. Reboot your computer to XP.
6. Copy the boot.lnx to C:\
7. Edit c:\boot.ini file as follows from command line.
> cd\
> attrib -r -s -h boot.ini
> edit boot.ini (or your favorite editor to add the following line under [operating systems]
c:\boot.lnx="Fedora Core 5"
> attrib +r +s +h boot.ini
8. Reboot Windows and you should see the Windows Boot Manager with an option of Fedora Core 5. Select Fedora Core 5 and it'll start GRUB the FC5.
I don't usually follow this forum, contact me, violstar@gmail.com, if you still have problem.
-Ken
A little hasty on XP and Grub
The above worked, as far as it went. I said,
"Grub would not boot XP with the normal "rootnoverify ..., chainloader +1, makeactive" comamnds, like XP had to have the MBR."
and proceeded to involve another primary partition, etc.
In fact Grub will boot XP with "rootnoverify ..., chainloader +1, makeactive" you just have to update the partition numbers in XPs boot.ini after moving partions around.
To my best understanding now, an install of XP (or format /s) places a secondary boot loader on the partition BR which says, "Goto ntldr (or whatever filename) in my root," which will read boot.ini.
Normally you would think that once the boot records have found the OS's loader, you're done with partition numbers. But I understand (at least tonight) that XP also requires correct boot numbers in boot.ini. Double updating.
Booting problem
Hi,
I had a dual partition with winxp and red hat 9. My "friend" tired to remove linux with partition magic and now all the pc does is go to grub prompt. I have tried to reinstall linux after formating the whole hard disk but still face the same problem. I have also tried the commands on this page. Nothing seems to work. Please Help !!!!!
Maybe a little help
"dual partition" means at least two different partitions, one with XP, another with Linux.
"after formating the whole hard disk" would mean XP is now gone.
I think you get the Grub prompt because Gurb is still on the Master Boot Record but it can't find its "splash" screen, etc. normally in the /boot/grub directory on the partition Grub thinks is it's "root".
A clean install of Linux should fix it. This time, be sure to make the Linux boot diskette during the install. If still problems, I suggest you study the "info grub" material on a working Linux system (or on the Internet), poke around at your grub prompt with "find /gurb/grub.conf" (or "find /boot.int" if XP is still around) type "help" to the grub prompt, work out the commands which boot something from the grub prompt, then put those commands into the grub.conf file.
booting a floppy image from grub
Is it possible to boot a floppy image stored on the harddisk using grub?
The image was created from a DOS bootable floppy disk.
thanks for your help
Booting flopy Disk Image from GRUB
Use memdisk
Download SYSlinux from http://syslinux.zytor.com/download.php.Uncompress it and go to the folder memdisk ther will be a file named memdisk.it is actually a kernel that can take a floppy disk image as initrd and boot from that image.So put the file memdisk and the floppy disk image in your boot folder and add the lines:
title Smart Boot Manager
root (hd1,7)
kernel /boot/memdisk vga=0x0301
initrd /boot/sbm.img
here in this example i am using memdisk to load the "Smart Boot Manager" floppy disk image from the grub menu.
Grub booting XP on one disk, Linux on another
I was able to get Grub to work on my two drive system but I needed a trick to do it. I ran into a problem on my first attempt: On my system XP is already on hda. I loaded Linux on hdb and created the /boot partition as the first partition on hdb (hdb1). (This is a small partition entirely within the 1024 cylinder limit.) I loaded Grub on this partition, then did the dd trick to copy the boot sector of hdb1 to a file that I placed on c:\ (on hda2) and set up my boot.ini accordingly. It didn't work - it just types "GRUB" in the upper-left corner.
I got an idea for a solution after reading this great article. First, I was finally able to get my Linux installation to boot from hdb1 with the Grub boot floppy.
I happen to have a small FAT32 partition on my first drive (hda5, which I created a long time ago with Partition Magic), so I used the "Grub boot floppy" technique to make hda5 a "Grub boot partition". I then did the dd trick for hda5, and copied that boot sector file to c:\. Now I can selectively boot to XP on hda2, or to the grub boot partition on hda5. Just add menu.lst to hda5 and we have a complete working solution. Once control is with Grub the problems with the second drive go away.
Thanks for writing the article - it showed me what to do.
problem in grub
Hi!,
In my pc there is three os. linux,win98 and winxp. Now my proble
is when I start my pc there is only two option is shown.linux is not there.but linux in installed. I hope there is problem in grub or booting proble.
So, plz give me help.
Booting Linux
Yeah, I have the same problem. I installed over about four times; but still no joy. I still haven't found the resolve to this provblem.
Did you ever find the answer?
Boot Last Choice
I often walk away while my system boots up, to drink a coffee or watch some TV, especially when I have to re-boot windows, yawn!!
Is it possible to set GRUB to boot the last operating system selected when it times out each time. Or do you have to sit there with the finger on the arrow key and enter button each time regardless of operating system?
From
From http://geodsoft.com/howto/dualboot/grub.htm
You can also have GRUB save the last loaded system as the default for the next boot. Change the "default=0" line to "default=saved" and add the "savedefault" command (no arguments) as the last command in each title section. When you switch to the savedefault mode, the first title section will be the default on the first boot. GRUB saves the current selection just before initiating the boot sequence. By using the savedefault command in two or more title sections and leaving it out of one or more title sections you could create a menu that would allow the default to switch between some systems but never be set for others.
Boot last choice
There really isn't any way to boot the last entry on the list but you can change the order of the entries on the list by changing their order in the "/boot/grub/menu.lst" configuration file.
Thanks...
Wow. my computer (seemingly) randomly booted GRUB after I asked Fedora to restart. If I hadn't found this web page, I would have had to reinstall the damn thing all over again. Thanks to you for the thorough instructions on using GRUB; it was the first time I'd ever encountered it!
Signed: a (not timid enough) newbie.
grub install
I have a gentoo system running and I have a total backup of this using Bacula.Can anyone help how to perform a baremetal recovery wi8th this?
Thanks for the information
Hi Wayne Marshall
Thanks a lot this page has helped my get safe boot into windows. I am having a dual boot system with linux and windows2000. Unfortunately linux partition has been corrupted and because of this windows is not able to boot and it is stopping at "grub>" prompt. I have just used the commands you have given in this page to boot
grub> rootnoverify (hd0,0)
grub> makeactive
grub> chainloader +1
grub> boot
This has help a lot.
Thanks for a good and useful information
Chandra
GRUB - Multiboot Problem
My son installed Suse 9.1 on his Windows XP machine to test drive Linux. The dual-boot system worked great with no problems.
Then he decided to remove Linux. After removing it, he can no longer get to Windows and constantly gets the GRUB command line and we don't know what to do with it.
Can someone assist us with this problem? Thank you so much. Hassan
Use windows xp bootable cd
Use windows xp bootable cd to boot the system, when asked for, press r to enter recovery console.
Simply use bootcfg command with the proper command swtch(think should be restore) to maintain your original MBR.
some help
Hi Hassan Kasraie
I had the same problem use the following commands
grub> rootnoverify (hd0,0)
grub> makeactive
grub> chainloader +1
grub> boot
and i will let you know about how to save the configuration
Regards
Chandra
Linux Boots from Floppy but not Hard Drive
The Grub Boot Floppy I created works great. I have WinXP on the Primary Master Hard Drive and Fedora Core 3 on a separate hard drive. I did not let the Fedora install load Grub onto (hd0,0), so I followed this article's instructions and made the boot floppy. The floppy works perfectly. Here is a copy of the menu.lst file:
# /boot/grub/menu.lst
# grub boot menu configuration
# general configuration:
timeout 60
default 0
fallback 2
fallback 1
color light-gray/blue red/light-gray
# boot stanzas follow
# each is implicitly numbered from 0
# in the order of appearance below
# (0) Fedora Core 3 (default boot) Linux kernel version: /vmlinuz-2.6.11-1.14_FC3
title Fedora Core 3 [Linux kernel version: /vmlinuz-2.6.11-1.14_FC3]
root (hd1,0)
kernel /vmlinuz-2.6.11-1.14_FC3 root=/dev/VolGroup00/LogVol00
initrd /initrd-2.6.11-1.14_FC3.img
(not showing the rest of the file)
As you see, Fedora is written to a logical volume.
I copied the grub directory from the floppy to the hard drive at /boot
using cp -Rp /mnt/test/boot/grub /boot
All the files are in the correct location on the hard drive.
When I boot the computer without the floppy, I select the 2nd hard drive and it boots to the grub prompt. The menu.lst does not appear and when I try to manually enter the commands that work with the floppy, only error messages appear.
Any advice would be very much appreciated by this newbie.
Thank you