###################################################### # # Searchable Keywords: boot bootloader grub G.R.U.B. GRand, Unified, Bootloader This is the Linux bootloader. Much more flexiable files: /boot/grub/grub.conf /etc/grub.conf /etc/sysconfig/grub Example: /etc/grub.conf file this should look like the /boot/grub/grub.conf [root@host root]# more /etc/grub.conf # grub.conf generated by anaconda # # Note that you do not have to rerun grub after making changes to this file # NOTICE: You have a /boot partition. This means that # all kernel and initrd paths are relative to /boot/, eg. # root (hd0,0) # kernel /vmlinuz-version ro root=/dev/hda2 # initrd /initrd-version.img #boot=/dev/hda default=1 timeout=10 splashimage=(hd0,0)/grub/splash.xpm.gz title Fedora (2.6.3-2.1.253.2.1) root (hd0,0) kernel /vmlinuz-2.6.3-2.1.253.2.1 ro root=LABEL=/ rhgb quiet initrd /initrd-2.6.3-2.1.253.2.1.img title Win2K map (hd0) (hd1) <--- These entries are here because windows HAS to be map (hd1) (hd0) <--- the lowest numbered drive. If the windows partition root (hd1,0) <--- was really on hd0 then this would unnesseccary. rootnoverify (hd1,0) makeactive chainloader +1 There is also a grub menu.lst or something like that but I can't find it right now. ----------------- More on grub.conf configuration --------------------- Ok, here's the sitiation. hd0 has the install of linux, hd1 has the install of windows You could use a grub.conf file that looks something like this......... # more /boot/grub/grub.conf default 0 timeout 7 title= gentoo root (hd0,0) kernel (hd0,0)/boot/bzImage root=/dev/hda3 title=winblows <-- these are the important map (hd0) (hd1) <-- lines. map (hd1) (hd0) <-- these map the disk that has root (hd1,0) <-- linux on it to the disk rootnoverify (hd1,0) <-- that has windows on it and makeactive <-- the disk that has windows on chainloader +1 <-- it to the linux disk. The lines, root (hd1,0), rootnoverify (hd1,0) makeactive and chainloader +1 are stanbdard lines !! Suse grub config specific ! ! The lines above that remap drives will need to be put in the /boot/grub/menu.lst file. NOTE: Of course you ONLY need to remap drives like this if you install Linux on the the "0" numbered drive. Windows insist on being on that drive. example: This is a /boot/grub/menu.lst file that includes disk remapping. yamin:/boot/grub # more menu.lst # Modified by YaST2. Last modification on Fri Jan 14 15:55:52 2005 color white/blue black/light-gray default 0 timeout 8 gfxmenu (hd0,1)/boot/message ###Don't change this comment - YaST2 identifier: Original name: linux### title Linux kernel (hd0,1)/boot/vmlinuz root=/dev/hda2 vga=0x305 splash=silent desktop resume=/dev/hda3 showopts initrd (hd0,1)/boot/initrd ###Don't change this comment - YaST2 identifier: Original name: windows### title Windows map (hd0) (hd1) map (hd1) (hd0) root (hd1,0) rootnoverify (hd1,0) makeactive chainloader +1 ###Don't change this comment - YaST2 identifier: Original name: floppy### title Floppy root (fd0) chainloader +1 ###Don't change this comment - YaST2 identifier: Original name: failsafe### title Failsafe kernel (hd0,1)/boot/vmlinuz root=/dev/hda2 showopts ide=nodma apm=off acpi=off vga=normal noresume nosmp noapic maxcpus=0 3 initrd (hd0,1)/boot/initrd The first part defines the splash screen configuration: gfxmenu (hd0,4)/message The background image is located on /dev/hda5 and has the name message. color The color scheme: white as normal foreground, blue as normal background, black for the foreground of selected items, and light gray as the selection background. These colors do not affect the graphical splash screen as defined under gfxmenu, but the standard GRUB interface. On a SuSE Linux system, this interface can be accessed from the splash screen by pressing . default 0 The first menu entry title linux shall be booted by default. timeout 8 After 8 seconds without user input, GRUB automatically boots the default entry. The second, larger part defines the different operating systems to boot: * The first entry (title linux) is responsible for booting SuSE Linux. The kernel (vmlinuz) is located on the first hard disk on the first logical partition (which is the boot partition in this case). The appended arguments are kernel parameters to specify the root partition and the video mode. The root partition is specified according to Linux conventions (/dev/hda7), because this is a parameter to be interpreted by the Linux kernel (and not by GRUB). The initrd image is located on the same logical partition of the first hard drive. * The second entry is responsible for booting Windows, which is installed on the first partition of the first hard drive (hd0,0). The command chainloader +1 causes GRUB to read and execute the first sector of the specified partition. * The next entry enables booting from the floppy drive without changing any BIOS settings. * The failsafe entry boots a Linux kernel with a number of specific kernel parameters to make it possible to boot on systems where the hardware is causing problems. SuSE 9 is based on grub as default Linux loader. It uses YaST2 to manage it [System - BootLoader Configuration], storing general configuration data in /etc/grub.conf and information about the booting options in /boot/grub/menu.lst. The directory /boot/grub/ contains all the configuration files and the binaries. It's possible to find a copy of the MBR present on the system before the SuSE installation in the file /boot/backup_mbr. The always useful Memtest tool, which can be chosen as boot option, is placed in /boot/memtest.bin The mapping of devices and their names is in /boot/grub/device.map. ----------------------------------------------------------------------------------- grub2 specific Editing the GRUB Configuration The GRUB boot loader uses the configuration files /etc/default/grub and the scripts in etc/grub.d/. To configure GRUB to boot from the new files, add a boot stanza to /etc/grub.d/40_custom that refers to them. A minimal boot stanza looks like the following listing: menuentry "Fedora Linux" { set root=(hd0,1) linux /vmlinuz-install initrd /initrd.img-install } You will also need to specify the location of the second stage installer image by adding an option to the end of the linux line of the boot stanza. For example: linux /vmlinuz-install stage2=http://my.internal.server/17/x86_64/os/ If the second stage image and the package repositories you will be downloading from are on the same server, use the repo= option instead. You may wish to add additional options to the end of the linux line, which will set preliminary options in Anaconda that the user normally sets interactively. For a list of available installer boot options, refer to Chapter 11, Boot Options. The following options are generally useful for medialess installations: ip= repo= lang= keymap= ksdevice= (if installation requires an interface other than eth0) vnc and vncpassword= for a remote installation When you are finished, run the following command with root privileges to refresh the grub.cfg file: grub2-mkconfig --output=/boot/grub2/grub.cfg Next, open grub.cfg to view the updated configuration. Locate your new menu entry stanza and determine its place in the stanza order. Finally, change the GRUB_DEFAULT option in /etc/default/grub to point to the new stanza you added. 0 will refer to the first stanza, 1 to the second, and so on. For example: GRUB_DEFAULT=0 Alternatively, specify the menu entry title. This is particularly useful if you have a number of menu entries across the various script files. GRUB_DEFAULT="Fedora Linux" See also lilo