1*1b8adde7SWilliam KucharskiThis is grub.info, produced by makeinfo version 4.0 from grub.texi. 2*1b8adde7SWilliam Kucharski 3*1b8adde7SWilliam KucharskiINFO-DIR-SECTION Kernel 4*1b8adde7SWilliam KucharskiSTART-INFO-DIR-ENTRY 5*1b8adde7SWilliam Kucharski* GRUB: (grub). The GRand Unified Bootloader 6*1b8adde7SWilliam Kucharski* grub-install: (grub)Invoking grub-install. Install GRUB on your drive 7*1b8adde7SWilliam Kucharski* grub-md5-crypt: (grub)Invoking grub-md5-crypt. Encrypt a password 8*1b8adde7SWilliam Kucharski in MD5 format 9*1b8adde7SWilliam Kucharski* grub-terminfo: (grub)Invoking grub-terminfo. Generate a terminfo 10*1b8adde7SWilliam Kucharski command from a 11*1b8adde7SWilliam Kucharski terminfo name 12*1b8adde7SWilliam Kucharski* grub-set-default: (grub)Invoking grub-set-default. Set a default boot 13*1b8adde7SWilliam Kucharski entry 14*1b8adde7SWilliam Kucharski* mbchk: (grub)Invoking mbchk. Check for the format of a Multiboot kernel 15*1b8adde7SWilliam KucharskiEND-INFO-DIR-ENTRY 16*1b8adde7SWilliam Kucharski 17*1b8adde7SWilliam Kucharski Copyright (C) 1999,2000,2001,2002,2004 Free Software Foundation, Inc. 18*1b8adde7SWilliam Kucharski 19*1b8adde7SWilliam Kucharski Permission is granted to make and distribute verbatim copies of this 20*1b8adde7SWilliam Kucharskimanual provided the copyright notice and this permission notice are 21*1b8adde7SWilliam Kucharskipreserved on all copies. 22*1b8adde7SWilliam Kucharski 23*1b8adde7SWilliam Kucharski Permission is granted to copy and distribute modified versions of 24*1b8adde7SWilliam Kucharskithis manual under the conditions for verbatim copying, provided also 25*1b8adde7SWilliam Kucharskithat the entire resulting derived work is distributed under the terms 26*1b8adde7SWilliam Kucharskiof a permission notice identical to this one. 27*1b8adde7SWilliam Kucharski 28*1b8adde7SWilliam Kucharski Permission is granted to copy and distribute translations of this 29*1b8adde7SWilliam Kucharskimanual into another language, under the above conditions for modified 30*1b8adde7SWilliam Kucharskiversions. 31*1b8adde7SWilliam Kucharski 32*1b8adde7SWilliam Kucharski 33*1b8adde7SWilliam KucharskiFile: grub.info, Node: Top, Next: Introduction, Up: (dir) 34*1b8adde7SWilliam Kucharski 35*1b8adde7SWilliam KucharskiGRUB manual 36*1b8adde7SWilliam Kucharski*********** 37*1b8adde7SWilliam Kucharski 38*1b8adde7SWilliam Kucharski This is the documentation of GNU GRUB, the GRand Unified Bootloader, 39*1b8adde7SWilliam Kucharskia flexible and powerful boot loader program for PCs. 40*1b8adde7SWilliam Kucharski 41*1b8adde7SWilliam Kucharski This edition documents version 0.95. 42*1b8adde7SWilliam Kucharski 43*1b8adde7SWilliam Kucharski* Menu: 44*1b8adde7SWilliam Kucharski 45*1b8adde7SWilliam Kucharski* Introduction:: Capturing the spirit of GRUB 46*1b8adde7SWilliam Kucharski* Naming convention:: Names of your drives in GRUB 47*1b8adde7SWilliam Kucharski* Installation:: Installing GRUB on your drive 48*1b8adde7SWilliam Kucharski* Booting:: How to boot different operating systems 49*1b8adde7SWilliam Kucharski* Configuration:: Writing your own configuration file 50*1b8adde7SWilliam Kucharski* Network:: Downloading OS images from a network 51*1b8adde7SWilliam Kucharski* Serial terminal:: Using GRUB via a serial line 52*1b8adde7SWilliam Kucharski* Preset Menu:: Embedding a configuration file into GRUB 53*1b8adde7SWilliam Kucharski* Security:: Improving the security 54*1b8adde7SWilliam Kucharski* Images:: GRUB image files 55*1b8adde7SWilliam Kucharski* Filesystem:: Filesystem syntax and semantics 56*1b8adde7SWilliam Kucharski* Interface:: The menu and the command-line 57*1b8adde7SWilliam Kucharski* Commands:: The list of available builtin commands 58*1b8adde7SWilliam Kucharski* Troubleshooting:: Error messages produced by GRUB 59*1b8adde7SWilliam Kucharski* Invoking the grub shell:: How to use the grub shell 60*1b8adde7SWilliam Kucharski* Invoking grub-install:: How to use the GRUB installer 61*1b8adde7SWilliam Kucharski* Invoking grub-md5-crypt:: How to generate a cryptic password 62*1b8adde7SWilliam Kucharski* Invoking grub-terminfo:: How to generate a terminfo command 63*1b8adde7SWilliam Kucharski* Invoking grub-set-default:: How to set a default boot entry 64*1b8adde7SWilliam Kucharski* Invoking mbchk:: How to use the Multiboot checker 65*1b8adde7SWilliam Kucharski* Obtaining and Building GRUB:: How to obtain and build GRUB 66*1b8adde7SWilliam Kucharski* Reporting bugs:: Where you should send a bug report 67*1b8adde7SWilliam Kucharski* Future:: Some future plans on GRUB 68*1b8adde7SWilliam Kucharski* Internals:: Hacking GRUB 69*1b8adde7SWilliam Kucharski* Index:: 70*1b8adde7SWilliam Kucharski 71*1b8adde7SWilliam Kucharski 72*1b8adde7SWilliam KucharskiFile: grub.info, Node: Introduction, Next: Naming convention, Prev: Top, Up: Top 73*1b8adde7SWilliam Kucharski 74*1b8adde7SWilliam KucharskiIntroduction to GRUB 75*1b8adde7SWilliam Kucharski******************** 76*1b8adde7SWilliam Kucharski 77*1b8adde7SWilliam Kucharski* Menu: 78*1b8adde7SWilliam Kucharski 79*1b8adde7SWilliam Kucharski* Overview:: What exactly GRUB is and how to use it 80*1b8adde7SWilliam Kucharski* History:: From maggot to house fly 81*1b8adde7SWilliam Kucharski* Features:: GRUB features 82*1b8adde7SWilliam Kucharski* Role of a boot loader:: The role of a boot loader 83*1b8adde7SWilliam Kucharski 84*1b8adde7SWilliam Kucharski 85*1b8adde7SWilliam KucharskiFile: grub.info, Node: Overview, Next: History, Up: Introduction 86*1b8adde7SWilliam Kucharski 87*1b8adde7SWilliam KucharskiOverview 88*1b8adde7SWilliam Kucharski======== 89*1b8adde7SWilliam Kucharski 90*1b8adde7SWilliam Kucharski Briefly, a "boot loader" is the first software program that runs when 91*1b8adde7SWilliam Kucharskia computer starts. It is responsible for loading and transferring 92*1b8adde7SWilliam Kucharskicontrol to an operating system "kernel" software (such as Linux or GNU 93*1b8adde7SWilliam KucharskiMach). The kernel, in turn, initializes the rest of the operating 94*1b8adde7SWilliam Kucharskisystem (e.g. a GNU system). 95*1b8adde7SWilliam Kucharski 96*1b8adde7SWilliam Kucharski GNU GRUB is a very powerful boot loader, which can load a wide 97*1b8adde7SWilliam Kucharskivariety of free operating systems, as well as proprietary operating 98*1b8adde7SWilliam Kucharskisystems with chain-loading(1) (*note Overview-Footnote-1::). GRUB is 99*1b8adde7SWilliam Kucharskidesigned to address the complexity of booting a personal computer; both 100*1b8adde7SWilliam Kucharskithe program and this manual are tightly bound to that computer platform, 101*1b8adde7SWilliam Kucharskialthough porting to other platforms may be addressed in the future. 102*1b8adde7SWilliam Kucharski 103*1b8adde7SWilliam Kucharski One of the important features in GRUB is flexibility; GRUB 104*1b8adde7SWilliam Kucharskiunderstands filesystems and kernel executable formats, so you can load 105*1b8adde7SWilliam Kucharskian arbitrary operating system the way you like, without recording the 106*1b8adde7SWilliam Kucharskiphysical position of your kernel on the disk. Thus you can load the 107*1b8adde7SWilliam Kucharskikernel just by specifying its file name and the drive and partition 108*1b8adde7SWilliam Kucharskiwhere the kernel resides. 109*1b8adde7SWilliam Kucharski 110*1b8adde7SWilliam Kucharski When booting with GRUB, you can use either a command-line interface 111*1b8adde7SWilliam Kucharski(*note Command-line interface::), or a menu interface (*note Menu 112*1b8adde7SWilliam Kucharskiinterface::). Using the command-line interface, you type the drive 113*1b8adde7SWilliam Kucharskispecification and file name of the kernel manually. In the menu 114*1b8adde7SWilliam Kucharskiinterface, you just select an OS using the arrow keys. The menu is 115*1b8adde7SWilliam Kucharskibased on a configuration file which you prepare beforehand (*note 116*1b8adde7SWilliam KucharskiConfiguration::). While in the menu, you can switch to the command-line 117*1b8adde7SWilliam Kucharskimode, and vice-versa. You can even edit menu entries before using them. 118*1b8adde7SWilliam Kucharski 119*1b8adde7SWilliam Kucharski In the following chapters, you will learn how to specify a drive, a 120*1b8adde7SWilliam Kucharskipartition, and a file name (*note Naming convention::) to GRUB, how to 121*1b8adde7SWilliam Kucharskiinstall GRUB on your drive (*note Installation::), and how to boot your 122*1b8adde7SWilliam KucharskiOSes (*note Booting::), step by step. 123*1b8adde7SWilliam Kucharski 124*1b8adde7SWilliam Kucharski Besides the GRUB boot loader itself, there is a "grub shell" `grub' 125*1b8adde7SWilliam Kucharski(*note Invoking the grub shell::) which can be run when you are in your 126*1b8adde7SWilliam Kucharskioperating system. It emulates the boot loader and can be used for 127*1b8adde7SWilliam Kucharskiinstalling the boot loader. 128*1b8adde7SWilliam Kucharski 129*1b8adde7SWilliam Kucharski 130*1b8adde7SWilliam KucharskiFile: grub.info, Node: Overview-Footnotes, Up: Overview 131*1b8adde7SWilliam Kucharski 132*1b8adde7SWilliam Kucharski (1) "chain-load" is the mechanism for loading unsupported operating 133*1b8adde7SWilliam Kucharskisystems by loading another boot loader. It is typically used for 134*1b8adde7SWilliam Kucharskiloading DOS or Windows. 135*1b8adde7SWilliam Kucharski 136*1b8adde7SWilliam Kucharski 137*1b8adde7SWilliam KucharskiFile: grub.info, Node: History, Next: Features, Prev: Overview, Up: Introduction 138*1b8adde7SWilliam Kucharski 139*1b8adde7SWilliam KucharskiHistory of GRUB 140*1b8adde7SWilliam Kucharski=============== 141*1b8adde7SWilliam Kucharski 142*1b8adde7SWilliam Kucharski GRUB originated in 1995 when Erich Boleyn was trying to boot the GNU 143*1b8adde7SWilliam KucharskiHurd with the University of Utah's Mach 4 microkernel (now known as GNU 144*1b8adde7SWilliam KucharskiMach). Erich and Brian Ford designed the Multiboot Specification 145*1b8adde7SWilliam Kucharski(*note Multiboot Specification: (multiboot)Top.), because they were 146*1b8adde7SWilliam Kucharskidetermined not to add to the large number of mutually-incompatible PC 147*1b8adde7SWilliam Kucharskiboot methods. 148*1b8adde7SWilliam Kucharski 149*1b8adde7SWilliam Kucharski Erich then began modifying the FreeBSD boot loader so that it would 150*1b8adde7SWilliam Kucharskiunderstand Multiboot. He soon realized that it would be a lot easier to 151*1b8adde7SWilliam Kucharskiwrite his own boot loader from scratch than to keep working on the 152*1b8adde7SWilliam KucharskiFreeBSD boot loader, and so GRUB was born. 153*1b8adde7SWilliam Kucharski 154*1b8adde7SWilliam Kucharski Erich added many features to GRUB, but other priorities prevented him 155*1b8adde7SWilliam Kucharskifrom keeping up with the demands of its quickly-expanding user base. In 156*1b8adde7SWilliam Kucharski1999, Gordon Matzigkeit and Yoshinori K. Okuji adopted GRUB as an 157*1b8adde7SWilliam Kucharskiofficial GNU package, and opened its development by making the latest 158*1b8adde7SWilliam Kucharskisources available via anonymous CVS. *Note Obtaining and Building 159*1b8adde7SWilliam KucharskiGRUB::, for more information. 160*1b8adde7SWilliam Kucharski 161*1b8adde7SWilliam Kucharski 162*1b8adde7SWilliam KucharskiFile: grub.info, Node: Features, Next: Role of a boot loader, Prev: History, Up: Introduction 163*1b8adde7SWilliam Kucharski 164*1b8adde7SWilliam KucharskiGRUB features 165*1b8adde7SWilliam Kucharski============= 166*1b8adde7SWilliam Kucharski 167*1b8adde7SWilliam Kucharski The primary requirement for GRUB is that it be compliant with the 168*1b8adde7SWilliam Kucharski"Multiboot Specification", which is described in *Note Multiboot 169*1b8adde7SWilliam KucharskiSpecification: (multiboot)Top. 170*1b8adde7SWilliam Kucharski 171*1b8adde7SWilliam Kucharski The other goals, listed in approximate order of importance, are: 172*1b8adde7SWilliam Kucharski 173*1b8adde7SWilliam Kucharski * Basic functions must be straightforward for end-users. 174*1b8adde7SWilliam Kucharski 175*1b8adde7SWilliam Kucharski * Rich functionality to support kernel experts and designers. 176*1b8adde7SWilliam Kucharski 177*1b8adde7SWilliam Kucharski * Backward compatibility for booting FreeBSD, NetBSD, OpenBSD, and 178*1b8adde7SWilliam Kucharski Linux. Proprietary kernels (such as DOS, Windows NT, and OS/2) are 179*1b8adde7SWilliam Kucharski supported via a chain-loading function. 180*1b8adde7SWilliam Kucharski 181*1b8adde7SWilliam Kucharski Except for specific compatibility modes (chain-loading and the Linux 182*1b8adde7SWilliam Kucharski"piggyback" format), all kernels will be started in much the same state 183*1b8adde7SWilliam Kucharskias in the Multiboot Specification. Only kernels loaded at 1 megabyte or 184*1b8adde7SWilliam Kucharskiabove are presently supported. Any attempt to load below that boundary 185*1b8adde7SWilliam Kucharskiwill simply result in immediate failure and an error message reporting 186*1b8adde7SWilliam Kucharskithe problem. 187*1b8adde7SWilliam Kucharski 188*1b8adde7SWilliam Kucharski In addition to the requirements above, GRUB has the following 189*1b8adde7SWilliam Kucharskifeatures (note that the Multiboot Specification doesn't require all the 190*1b8adde7SWilliam Kucharskifeatures that GRUB supports): 191*1b8adde7SWilliam Kucharski 192*1b8adde7SWilliam KucharskiRecognize multiple executable formats 193*1b8adde7SWilliam Kucharski Support many of the "a.out" variants plus "ELF". Symbol tables are 194*1b8adde7SWilliam Kucharski also loaded. 195*1b8adde7SWilliam Kucharski 196*1b8adde7SWilliam KucharskiSupport non-Multiboot kernels 197*1b8adde7SWilliam Kucharski Support many of the various free 32-bit kernels that lack Multiboot 198*1b8adde7SWilliam Kucharski compliance (primarily FreeBSD, NetBSD, OpenBSD, and Linux). 199*1b8adde7SWilliam Kucharski Chain-loading of other boot loaders is also supported. 200*1b8adde7SWilliam Kucharski 201*1b8adde7SWilliam KucharskiLoad multiples modules 202*1b8adde7SWilliam Kucharski Fully support the Multiboot feature of loading multiple modules. 203*1b8adde7SWilliam Kucharski 204*1b8adde7SWilliam KucharskiLoad a configuration file 205*1b8adde7SWilliam Kucharski Support a human-readable text configuration file with preset boot 206*1b8adde7SWilliam Kucharski commands. You can also load another configuration file dynamically 207*1b8adde7SWilliam Kucharski and embed a preset configuration file in a GRUB image file. The 208*1b8adde7SWilliam Kucharski list of commands (*note Commands::) are a superset of those 209*1b8adde7SWilliam Kucharski supported on the command-line. An example configuration file is 210*1b8adde7SWilliam Kucharski provided in *Note Configuration::. 211*1b8adde7SWilliam Kucharski 212*1b8adde7SWilliam KucharskiProvide a menu interface 213*1b8adde7SWilliam Kucharski A menu interface listing preset boot commands, with a programmable 214*1b8adde7SWilliam Kucharski timeout, is available. There is no fixed limit on the number of 215*1b8adde7SWilliam Kucharski boot entries, and the current implementation has space for several 216*1b8adde7SWilliam Kucharski hundred. 217*1b8adde7SWilliam Kucharski 218*1b8adde7SWilliam KucharskiHave a flexible command-line interface 219*1b8adde7SWilliam Kucharski A fairly flexible command-line interface, accessible from the menu, 220*1b8adde7SWilliam Kucharski is available to edit any preset commands, or write a new boot 221*1b8adde7SWilliam Kucharski command set from scratch. If no configuration file is present, 222*1b8adde7SWilliam Kucharski GRUB drops to the command-line. 223*1b8adde7SWilliam Kucharski 224*1b8adde7SWilliam Kucharski The list of commands (*note Commands::) are a subset of those 225*1b8adde7SWilliam Kucharski supported for configuration files. Editing commands closely 226*1b8adde7SWilliam Kucharski resembles the Bash command-line (*note Bash: (features)Command 227*1b8adde7SWilliam Kucharski Line Editing.), with <TAB>-completion of commands, devices, 228*1b8adde7SWilliam Kucharski partitions, and files in a directory depending on context. 229*1b8adde7SWilliam Kucharski 230*1b8adde7SWilliam KucharskiSupport multiple filesystem types 231*1b8adde7SWilliam Kucharski Support multiple filesystem types transparently, plus a useful 232*1b8adde7SWilliam Kucharski explicit blocklist notation. The currently supported filesystem 233*1b8adde7SWilliam Kucharski types are "BSD FFS", "DOS FAT16 and FAT32", "Minix fs", "Linux 234*1b8adde7SWilliam Kucharski ext2fs", "ReiserFS", "JFS", "XFS", and "VSTa fs". *Note 235*1b8adde7SWilliam Kucharski Filesystem::, for more information. 236*1b8adde7SWilliam Kucharski 237*1b8adde7SWilliam KucharskiSupport automatic decompression 238*1b8adde7SWilliam Kucharski Can decompress files which were compressed by `gzip'. This 239*1b8adde7SWilliam Kucharski function is both automatic and transparent to the user (i.e. all 240*1b8adde7SWilliam Kucharski functions operate upon the uncompressed contents of the specified 241*1b8adde7SWilliam Kucharski files). This greatly reduces a file size and loading time, a 242*1b8adde7SWilliam Kucharski particularly great benefit for floppies.(1) (*note 243*1b8adde7SWilliam Kucharski Features-Footnote-1::) 244*1b8adde7SWilliam Kucharski 245*1b8adde7SWilliam Kucharski It is conceivable that some kernel modules should be loaded in a 246*1b8adde7SWilliam Kucharski compressed state, so a different module-loading command can be 247*1b8adde7SWilliam Kucharski specified to avoid uncompressing the modules. 248*1b8adde7SWilliam Kucharski 249*1b8adde7SWilliam KucharskiAccess data on any installed device 250*1b8adde7SWilliam Kucharski Support reading data from any or all floppies or hard disk(s) 251*1b8adde7SWilliam Kucharski recognized by the BIOS, independent of the setting of the root 252*1b8adde7SWilliam Kucharski device. 253*1b8adde7SWilliam Kucharski 254*1b8adde7SWilliam KucharskiBe independent of drive geometry translations 255*1b8adde7SWilliam Kucharski Unlike many other boot loaders, GRUB makes the particular drive 256*1b8adde7SWilliam Kucharski translation irrelevant. A drive installed and running with one 257*1b8adde7SWilliam Kucharski translation may be converted to another translation without any 258*1b8adde7SWilliam Kucharski adverse effects or changes in GRUB's configuration. 259*1b8adde7SWilliam Kucharski 260*1b8adde7SWilliam KucharskiDetect all installed RAM 261*1b8adde7SWilliam Kucharski GRUB can generally find all the installed RAM on a PC-compatible 262*1b8adde7SWilliam Kucharski machine. It uses an advanced BIOS query technique for finding all 263*1b8adde7SWilliam Kucharski memory regions. As described on the Multiboot Specification (*note 264*1b8adde7SWilliam Kucharski Multiboot Specification: (multiboot)Top.), not all kernels make 265*1b8adde7SWilliam Kucharski use of this information, but GRUB provides it for those who do. 266*1b8adde7SWilliam Kucharski 267*1b8adde7SWilliam KucharskiSupport Logical Block Address mode 268*1b8adde7SWilliam Kucharski In traditional disk calls (called "CHS mode"), there is a geometry 269*1b8adde7SWilliam Kucharski translation problem, that is, the BIOS cannot access over 1024 270*1b8adde7SWilliam Kucharski cylinders, so the accessible space is limited to at least 508 MB 271*1b8adde7SWilliam Kucharski and to at most 8GB. GRUB can't universally solve this problem, as 272*1b8adde7SWilliam Kucharski there is no standard interface used in all machines. However, 273*1b8adde7SWilliam Kucharski several newer machines have the new interface, Logical Block 274*1b8adde7SWilliam Kucharski Address ("LBA") mode. GRUB automatically detects if LBA mode is 275*1b8adde7SWilliam Kucharski available and uses it if available. In LBA mode, GRUB can access 276*1b8adde7SWilliam Kucharski the entire disk. 277*1b8adde7SWilliam Kucharski 278*1b8adde7SWilliam KucharskiSupport network booting 279*1b8adde7SWilliam Kucharski GRUB is basically a disk-based boot loader but also has network 280*1b8adde7SWilliam Kucharski support. You can load OS images from a network by using the "TFTP" 281*1b8adde7SWilliam Kucharski protocol. 282*1b8adde7SWilliam Kucharski 283*1b8adde7SWilliam KucharskiSupport remote terminals 284*1b8adde7SWilliam Kucharski To support computers with no console, GRUB provides remote terminal 285*1b8adde7SWilliam Kucharski support, so that you can control GRUB from a remote host. Only 286*1b8adde7SWilliam Kucharski serial terminal support is implemented at the moment. 287*1b8adde7SWilliam Kucharski 288*1b8adde7SWilliam Kucharski 289*1b8adde7SWilliam KucharskiFile: grub.info, Node: Features-Footnotes, Up: Features 290*1b8adde7SWilliam Kucharski 291*1b8adde7SWilliam Kucharski (1) There are a few pathological cases where loading a very badly 292*1b8adde7SWilliam Kucharskiorganized ELF kernel might take longer, but in practice this never 293*1b8adde7SWilliam Kucharskihappen. 294*1b8adde7SWilliam Kucharski 295*1b8adde7SWilliam Kucharski 296*1b8adde7SWilliam KucharskiFile: grub.info, Node: Role of a boot loader, Prev: Features, Up: Introduction 297*1b8adde7SWilliam Kucharski 298*1b8adde7SWilliam KucharskiThe role of a boot loader 299*1b8adde7SWilliam Kucharski========================= 300*1b8adde7SWilliam Kucharski 301*1b8adde7SWilliam Kucharski The following is a quotation from Gordon Matzigkeit, a GRUB fanatic: 302*1b8adde7SWilliam Kucharski 303*1b8adde7SWilliam Kucharski Some people like to acknowledge both the operating system and 304*1b8adde7SWilliam Kucharski kernel when they talk about their computers, so they might say 305*1b8adde7SWilliam Kucharski they use "GNU/Linux" or "GNU/Hurd". Other people seem to think 306*1b8adde7SWilliam Kucharski that the kernel is the most important part of the system, so they 307*1b8adde7SWilliam Kucharski like to call their GNU operating systems "Linux systems." 308*1b8adde7SWilliam Kucharski 309*1b8adde7SWilliam Kucharski I, personally, believe that this is a grave injustice, because the 310*1b8adde7SWilliam Kucharski _boot loader_ is the most important software of all. I used to 311*1b8adde7SWilliam Kucharski refer to the above systems as either "LILO"(1) (*note Role of a 312*1b8adde7SWilliam Kucharski boot loader-Footnote-1::) or "GRUB" systems. 313*1b8adde7SWilliam Kucharski 314*1b8adde7SWilliam Kucharski Unfortunately, nobody ever understood what I was talking about; 315*1b8adde7SWilliam Kucharski now I just use the word "GNU" as a pseudonym for GRUB. 316*1b8adde7SWilliam Kucharski 317*1b8adde7SWilliam Kucharski So, if you ever hear people talking about their alleged "GNU" 318*1b8adde7SWilliam Kucharski systems, remember that they are actually paying homage to the best 319*1b8adde7SWilliam Kucharski boot loader around... GRUB! 320*1b8adde7SWilliam Kucharski 321*1b8adde7SWilliam Kucharski We, the GRUB maintainers, do not (usually) encourage Gordon's level 322*1b8adde7SWilliam Kucharskiof fanaticism, but it helps to remember that boot loaders deserve 323*1b8adde7SWilliam Kucharskirecognition. We hope that you enjoy using GNU GRUB as much as we did 324*1b8adde7SWilliam Kucharskiwriting it. 325*1b8adde7SWilliam Kucharski 326*1b8adde7SWilliam Kucharski 327*1b8adde7SWilliam KucharskiFile: grub.info, Node: Role of a boot loader-Footnotes, Up: Role of a boot loader 328*1b8adde7SWilliam Kucharski 329*1b8adde7SWilliam Kucharski (1) The LInux LOader, a boot loader that everybody uses, but nobody 330*1b8adde7SWilliam Kucharskilikes. 331*1b8adde7SWilliam Kucharski 332*1b8adde7SWilliam Kucharski 333*1b8adde7SWilliam KucharskiFile: grub.info, Node: Naming convention, Next: Installation, Prev: Introduction, Up: Top 334*1b8adde7SWilliam Kucharski 335*1b8adde7SWilliam KucharskiNaming convention 336*1b8adde7SWilliam Kucharski***************** 337*1b8adde7SWilliam Kucharski 338*1b8adde7SWilliam Kucharski The device syntax used in GRUB is a wee bit different from what you 339*1b8adde7SWilliam Kucharskimay have seen before in your operating system(s), and you need to know 340*1b8adde7SWilliam Kucharskiit so that you can specify a drive/partition. 341*1b8adde7SWilliam Kucharski 342*1b8adde7SWilliam Kucharski Look at the following examples and explanations: 343*1b8adde7SWilliam Kucharski 344*1b8adde7SWilliam Kucharski (fd0) 345*1b8adde7SWilliam Kucharski 346*1b8adde7SWilliam Kucharski First of all, GRUB requires that the device name be enclosed with 347*1b8adde7SWilliam Kucharski`(' and `)'. The `fd' part means that it is a floppy disk. The number 348*1b8adde7SWilliam Kucharski`0' is the drive number, which is counted from _zero_. This expression 349*1b8adde7SWilliam Kucharskimeans that GRUB will use the whole floppy disk. 350*1b8adde7SWilliam Kucharski 351*1b8adde7SWilliam Kucharski (hd0,1) 352*1b8adde7SWilliam Kucharski 353*1b8adde7SWilliam Kucharski Here, `hd' means it is a hard disk drive. The first integer `0' 354*1b8adde7SWilliam Kucharskiindicates the drive number, that is, the first hard disk, while the 355*1b8adde7SWilliam Kucharskisecond integer, `1', indicates the partition number (or the PC slice 356*1b8adde7SWilliam Kucharskinumber in the BSD terminology). Once again, please note that the 357*1b8adde7SWilliam Kucharskipartition numbers are counted from _zero_, not from one. This 358*1b8adde7SWilliam Kucharskiexpression means the second partition of the first hard disk drive. In 359*1b8adde7SWilliam Kucharskithis case, GRUB uses one partition of the disk, instead of the whole 360*1b8adde7SWilliam Kucharskidisk. 361*1b8adde7SWilliam Kucharski 362*1b8adde7SWilliam Kucharski (hd0,4) 363*1b8adde7SWilliam Kucharski 364*1b8adde7SWilliam Kucharski This specifies the first "extended partition" of the first hard disk 365*1b8adde7SWilliam Kucharskidrive. Note that the partition numbers for extended partitions are 366*1b8adde7SWilliam Kucharskicounted from `4', regardless of the actual number of primary partitions 367*1b8adde7SWilliam Kucharskion your hard disk. 368*1b8adde7SWilliam Kucharski 369*1b8adde7SWilliam Kucharski (hd1,a) 370*1b8adde7SWilliam Kucharski 371*1b8adde7SWilliam Kucharski This means the BSD `a' partition of the second hard disk. If you 372*1b8adde7SWilliam Kucharskineed to specify which PC slice number should be used, use something 373*1b8adde7SWilliam Kucharskilike this: `(hd1,0,a)'. If the PC slice number is omitted, GRUB 374*1b8adde7SWilliam Kucharskisearches for the first PC slice which has a BSD `a' partition. 375*1b8adde7SWilliam Kucharski 376*1b8adde7SWilliam Kucharski Of course, to actually access the disks or partitions with GRUB, you 377*1b8adde7SWilliam Kucharskineed to use the device specification in a command, like `root (fd0)' or 378*1b8adde7SWilliam Kucharski`unhide (hd0,2)'. To help you find out which number specifies a 379*1b8adde7SWilliam Kucharskipartition you want, the GRUB command-line (*note Command-line 380*1b8adde7SWilliam Kucharskiinterface::) options have argument completion. This means that, for 381*1b8adde7SWilliam Kucharskiexample, you only need to type 382*1b8adde7SWilliam Kucharski 383*1b8adde7SWilliam Kucharski root ( 384*1b8adde7SWilliam Kucharski 385*1b8adde7SWilliam Kucharski followed by a <TAB>, and GRUB will display the list of drives, 386*1b8adde7SWilliam Kucharskipartitions, or file names. So it should be quite easy to determine the 387*1b8adde7SWilliam Kucharskiname of your target partition, even with minimal knowledge of the 388*1b8adde7SWilliam Kucharskisyntax. 389*1b8adde7SWilliam Kucharski 390*1b8adde7SWilliam Kucharski Note that GRUB does _not_ distinguish IDE from SCSI - it simply 391*1b8adde7SWilliam Kucharskicounts the drive numbers from zero, regardless of their type. Normally, 392*1b8adde7SWilliam Kucharskiany IDE drive number is less than any SCSI drive number, although that 393*1b8adde7SWilliam Kucharskiis not true if you change the boot sequence by swapping IDE and SCSI 394*1b8adde7SWilliam Kucharskidrives in your BIOS. 395*1b8adde7SWilliam Kucharski 396*1b8adde7SWilliam Kucharski Now the question is, how to specify a file? Again, consider an 397*1b8adde7SWilliam Kucharskiexample: 398*1b8adde7SWilliam Kucharski 399*1b8adde7SWilliam Kucharski (hd0,0)/vmlinuz 400*1b8adde7SWilliam Kucharski 401*1b8adde7SWilliam Kucharski This specifies the file named `vmlinuz', found on the first 402*1b8adde7SWilliam Kucharskipartition of the first hard disk drive. Note that the argument 403*1b8adde7SWilliam Kucharskicompletion works with file names, too. 404*1b8adde7SWilliam Kucharski 405*1b8adde7SWilliam Kucharski That was easy, admit it. Now read the next chapter, to find out how 406*1b8adde7SWilliam Kucharskito actually install GRUB on your drive. 407*1b8adde7SWilliam Kucharski 408*1b8adde7SWilliam Kucharski 409*1b8adde7SWilliam KucharskiFile: grub.info, Node: Installation, Next: Booting, Prev: Naming convention, Up: Top 410*1b8adde7SWilliam Kucharski 411*1b8adde7SWilliam KucharskiInstallation 412*1b8adde7SWilliam Kucharski************ 413*1b8adde7SWilliam Kucharski 414*1b8adde7SWilliam Kucharski In order to install GRUB as your boot loader, you need to first 415*1b8adde7SWilliam Kucharskiinstall the GRUB system and utilities under your UNIX-like operating 416*1b8adde7SWilliam Kucharskisystem (*note Obtaining and Building GRUB::). You can do this either 417*1b8adde7SWilliam Kucharskifrom the source tarball, or as a package for your OS. 418*1b8adde7SWilliam Kucharski 419*1b8adde7SWilliam Kucharski After you have done that, you need to install the boot loader on a 420*1b8adde7SWilliam Kucharskidrive (floppy or hard disk). There are two ways of doing that - either 421*1b8adde7SWilliam Kucharskiusing the utility `grub-install' (*note Invoking grub-install::) on a 422*1b8adde7SWilliam KucharskiUNIX-like OS, or by running GRUB itself from a floppy. These are quite 423*1b8adde7SWilliam Kucharskisimilar, however the utility might probe a wrong BIOS drive, so you 424*1b8adde7SWilliam Kucharskishould be careful. 425*1b8adde7SWilliam Kucharski 426*1b8adde7SWilliam Kucharski Also, if you install GRUB on a UNIX-like OS, please make sure that 427*1b8adde7SWilliam Kucharskiyou have an emergency boot disk ready, so that you can rescue your 428*1b8adde7SWilliam Kucharskicomputer if, by any chance, your hard drive becomes unusable 429*1b8adde7SWilliam Kucharski(unbootable). 430*1b8adde7SWilliam Kucharski 431*1b8adde7SWilliam Kucharski GRUB comes with boot images, which are normally put in the directory 432*1b8adde7SWilliam Kucharski`/usr/lib/grub/i386-pc'. If you do not use grub-install, then you need 433*1b8adde7SWilliam Kucharskito copy the files `stage1', `stage2', and `*stage1_5' to the directory 434*1b8adde7SWilliam Kucharski`/boot/grub', and run the `grub-set-default' (*note Invoking 435*1b8adde7SWilliam Kucharskigrub-set-default::) if you intend to use `default saved' (*note 436*1b8adde7SWilliam Kucharskidefault::) in your configuration file. Hereafter, the directory where 437*1b8adde7SWilliam KucharskiGRUB images are initially placed (normally `/usr/lib/grub/i386-pc') 438*1b8adde7SWilliam Kucharskiwill be called the "image directory", and the directory where the boot 439*1b8adde7SWilliam Kucharskiloader needs to find them (usually `/boot/grub') will be called the 440*1b8adde7SWilliam Kucharski"boot directory". 441*1b8adde7SWilliam Kucharski 442*1b8adde7SWilliam Kucharski* Menu: 443*1b8adde7SWilliam Kucharski 444*1b8adde7SWilliam Kucharski* Creating a GRUB boot floppy:: 445*1b8adde7SWilliam Kucharski* Installing GRUB natively:: 446*1b8adde7SWilliam Kucharski* Installing GRUB using grub-install:: 447*1b8adde7SWilliam Kucharski* Making a GRUB bootable CD-ROM:: 448*1b8adde7SWilliam Kucharski 449*1b8adde7SWilliam Kucharski 450*1b8adde7SWilliam KucharskiFile: grub.info, Node: Creating a GRUB boot floppy, Next: Installing GRUB natively, Up: Installation 451*1b8adde7SWilliam Kucharski 452*1b8adde7SWilliam KucharskiCreating a GRUB boot floppy 453*1b8adde7SWilliam Kucharski=========================== 454*1b8adde7SWilliam Kucharski 455*1b8adde7SWilliam Kucharski To create a GRUB boot floppy, you need to take the files `stage1' 456*1b8adde7SWilliam Kucharskiand `stage2' from the image directory, and write them to the first and 457*1b8adde7SWilliam Kucharskithe second block of the floppy disk, respectively. 458*1b8adde7SWilliam Kucharski 459*1b8adde7SWilliam Kucharski *Caution:* This procedure will destroy any data currently stored on 460*1b8adde7SWilliam Kucharskithe floppy. 461*1b8adde7SWilliam Kucharski 462*1b8adde7SWilliam Kucharski On a UNIX-like operating system, that is done with the following 463*1b8adde7SWilliam Kucharskicommands: 464*1b8adde7SWilliam Kucharski 465*1b8adde7SWilliam Kucharski # cd /usr/lib/grub/i386-pc 466*1b8adde7SWilliam Kucharski # dd if=stage1 of=/dev/fd0 bs=512 count=1 467*1b8adde7SWilliam Kucharski 1+0 records in 468*1b8adde7SWilliam Kucharski 1+0 records out 469*1b8adde7SWilliam Kucharski # dd if=stage2 of=/dev/fd0 bs=512 seek=1 470*1b8adde7SWilliam Kucharski 153+1 records in 471*1b8adde7SWilliam Kucharski 153+1 records out 472*1b8adde7SWilliam Kucharski # 473*1b8adde7SWilliam Kucharski 474*1b8adde7SWilliam Kucharski The device file name may be different. Consult the manual for your 475*1b8adde7SWilliam KucharskiOS. 476*1b8adde7SWilliam Kucharski 477*1b8adde7SWilliam Kucharski 478*1b8adde7SWilliam KucharskiFile: grub.info, Node: Installing GRUB natively, Next: Installing GRUB using grub-install, Prev: Creating a GRUB boot floppy, Up: Installation 479*1b8adde7SWilliam Kucharski 480*1b8adde7SWilliam KucharskiInstalling GRUB natively 481*1b8adde7SWilliam Kucharski======================== 482*1b8adde7SWilliam Kucharski 483*1b8adde7SWilliam Kucharski *Caution:* Installing GRUB's stage1 in this manner will erase the 484*1b8adde7SWilliam Kucharskinormal boot-sector used by an OS. 485*1b8adde7SWilliam Kucharski 486*1b8adde7SWilliam Kucharski GRUB can currently boot GNU Mach, Linux, FreeBSD, NetBSD, and OpenBSD 487*1b8adde7SWilliam Kucharskidirectly, so using it on a boot sector (the first sector of a 488*1b8adde7SWilliam Kucharskipartition) should be okay. But generally, it would be a good idea to 489*1b8adde7SWilliam Kucharskiback up the first sector of the partition on which you are installing 490*1b8adde7SWilliam KucharskiGRUB's stage1. This isn't as important if you are installing GRUB on 491*1b8adde7SWilliam Kucharskithe first sector of a hard disk, since it's easy to reinitialize it 492*1b8adde7SWilliam Kucharski(e.g. by running `FDISK /MBR' from DOS). 493*1b8adde7SWilliam Kucharski 494*1b8adde7SWilliam Kucharski If you decide to install GRUB in the native environment, which is 495*1b8adde7SWilliam Kucharskidefinitely desirable, you'll need to create a GRUB boot disk, and 496*1b8adde7SWilliam Kucharskireboot your computer with it. Otherwise, see *Note Installing GRUB 497*1b8adde7SWilliam Kucharskiusing grub-install::. 498*1b8adde7SWilliam Kucharski 499*1b8adde7SWilliam Kucharski Once started, GRUB will show the command-line interface (*note 500*1b8adde7SWilliam KucharskiCommand-line interface::). First, set the GRUB's "root device"(1) 501*1b8adde7SWilliam Kucharski(*note Installing GRUB natively-Footnote-1::) to the partition 502*1b8adde7SWilliam Kucharskicontaining the boot directory, like this: 503*1b8adde7SWilliam Kucharski 504*1b8adde7SWilliam Kucharski grub> root (hd0,0) 505*1b8adde7SWilliam Kucharski 506*1b8adde7SWilliam Kucharski If you are not sure which partition actually holds this directory, 507*1b8adde7SWilliam Kucharskiuse the command `find' (*note find::), like this: 508*1b8adde7SWilliam Kucharski 509*1b8adde7SWilliam Kucharski grub> find /boot/grub/stage1 510*1b8adde7SWilliam Kucharski 511*1b8adde7SWilliam Kucharski This will search for the file name `/boot/grub/stage1' and show the 512*1b8adde7SWilliam Kucharskidevices which contain the file. 513*1b8adde7SWilliam Kucharski 514*1b8adde7SWilliam Kucharski Once you've set the root device correctly, run the command `setup' 515*1b8adde7SWilliam Kucharski(*note setup::): 516*1b8adde7SWilliam Kucharski 517*1b8adde7SWilliam Kucharski grub> setup (hd0) 518*1b8adde7SWilliam Kucharski 519*1b8adde7SWilliam Kucharski This command will install the GRUB boot loader on the Master Boot 520*1b8adde7SWilliam KucharskiRecord (MBR) of the first drive. If you want to put GRUB into the boot 521*1b8adde7SWilliam Kucharskisector of a partition instead of putting it in the MBR, specify the 522*1b8adde7SWilliam Kucharskipartition into which you want to install GRUB: 523*1b8adde7SWilliam Kucharski 524*1b8adde7SWilliam Kucharski grub> setup (hd0,0) 525*1b8adde7SWilliam Kucharski 526*1b8adde7SWilliam Kucharski If you install GRUB into a partition or a drive other than the first 527*1b8adde7SWilliam Kucharskione, you must chain-load GRUB from another boot loader. Refer to the 528*1b8adde7SWilliam Kucharskimanual for the boot loader to know how to chain-load GRUB. 529*1b8adde7SWilliam Kucharski 530*1b8adde7SWilliam Kucharski After using the setup command, you will boot into GRUB without the 531*1b8adde7SWilliam KucharskiGRUB floppy. See the chapter *Note Booting:: to find out how to boot 532*1b8adde7SWilliam Kucharskiyour operating systems from GRUB. 533*1b8adde7SWilliam Kucharski 534*1b8adde7SWilliam Kucharski 535*1b8adde7SWilliam KucharskiFile: grub.info, Node: Installing GRUB natively-Footnotes, Up: Installing GRUB natively 536*1b8adde7SWilliam Kucharski 537*1b8adde7SWilliam Kucharski (1) Note that GRUB's root device doesn't necessarily mean your OS's 538*1b8adde7SWilliam Kucharskiroot partition; if you need to specify a root partition for your OS, 539*1b8adde7SWilliam Kucharskiadd the argument into the command `kernel'. 540*1b8adde7SWilliam Kucharski 541*1b8adde7SWilliam Kucharski 542*1b8adde7SWilliam KucharskiFile: grub.info, Node: Installing GRUB using grub-install, Next: Making a GRUB bootable CD-ROM, Prev: Installing GRUB natively, Up: Installation 543*1b8adde7SWilliam Kucharski 544*1b8adde7SWilliam KucharskiInstalling GRUB using grub-install 545*1b8adde7SWilliam Kucharski================================== 546*1b8adde7SWilliam Kucharski 547*1b8adde7SWilliam Kucharski *Caution:* This procedure is definitely less safe, because there are 548*1b8adde7SWilliam Kucharskiseveral ways in which your computer can become unbootable. For example, 549*1b8adde7SWilliam Kucharskimost operating systems don't tell GRUB how to map BIOS drives to OS 550*1b8adde7SWilliam Kucharskidevices correctly--GRUB merely "guesses" the mapping. This will succeed 551*1b8adde7SWilliam Kucharskiin most cases, but not always. Therefore, GRUB provides you with a map 552*1b8adde7SWilliam Kucharskifile called the "device map", which you must fix if it is wrong. *Note 553*1b8adde7SWilliam KucharskiDevice map::, for more details. 554*1b8adde7SWilliam Kucharski 555*1b8adde7SWilliam Kucharski If you still do want to install GRUB under a UNIX-like OS (such as 556*1b8adde7SWilliam KucharskiGNU), invoke the program `grub-install' (*note Invoking grub-install::) 557*1b8adde7SWilliam Kucharskias the superuser ("root"). 558*1b8adde7SWilliam Kucharski 559*1b8adde7SWilliam Kucharski The usage is basically very simple. You only need to specify one 560*1b8adde7SWilliam Kucharskiargument to the program, namely, where to install the boot loader. The 561*1b8adde7SWilliam Kucharskiargument can be either a device file (like `/dev/hda') or a partition 562*1b8adde7SWilliam Kucharskispecified in GRUB's notation. For example, under Linux the following 563*1b8adde7SWilliam Kucharskiwill install GRUB into the MBR of the first IDE disk: 564*1b8adde7SWilliam Kucharski 565*1b8adde7SWilliam Kucharski # grub-install /dev/hda 566*1b8adde7SWilliam Kucharski 567*1b8adde7SWilliam Kucharski Likewise, under GNU/Hurd, this has the same effect: 568*1b8adde7SWilliam Kucharski 569*1b8adde7SWilliam Kucharski # grub-install /dev/hd0 570*1b8adde7SWilliam Kucharski 571*1b8adde7SWilliam Kucharski If it is the first BIOS drive, this is the same as well: 572*1b8adde7SWilliam Kucharski 573*1b8adde7SWilliam Kucharski # grub-install '(hd0)' 574*1b8adde7SWilliam Kucharski 575*1b8adde7SWilliam Kucharski Or you can omit the parentheses: 576*1b8adde7SWilliam Kucharski 577*1b8adde7SWilliam Kucharski # grub-install hd0 578*1b8adde7SWilliam Kucharski 579*1b8adde7SWilliam Kucharski But all the above examples assume that GRUB should use images under 580*1b8adde7SWilliam Kucharskithe root directory. If you want GRUB to use images under a directory 581*1b8adde7SWilliam Kucharskiother than the root directory, you need to specify the option 582*1b8adde7SWilliam Kucharski`--root-directory'. The typical usage is that you create a GRUB boot 583*1b8adde7SWilliam Kucharskifloppy with a filesystem. Here is an example: 584*1b8adde7SWilliam Kucharski 585*1b8adde7SWilliam Kucharski # mke2fs /dev/fd0 586*1b8adde7SWilliam Kucharski # mount -t ext2 /dev/fd0 /mnt 587*1b8adde7SWilliam Kucharski # grub-install --root-directory=/mnt fd0 588*1b8adde7SWilliam Kucharski # umount /mnt 589*1b8adde7SWilliam Kucharski 590*1b8adde7SWilliam Kucharski Another example is when you have a separate boot partition which is 591*1b8adde7SWilliam Kucharskimounted at `/boot'. Since GRUB is a boot loader, it doesn't know 592*1b8adde7SWilliam Kucharskianything about mountpoints at all. Thus, you need to run `grub-install' 593*1b8adde7SWilliam Kucharskilike this: 594*1b8adde7SWilliam Kucharski 595*1b8adde7SWilliam Kucharski # grub-install --root-directory=/boot /dev/hda 596*1b8adde7SWilliam Kucharski 597*1b8adde7SWilliam Kucharski By the way, as noted above, it is quite difficult to guess BIOS 598*1b8adde7SWilliam Kucharskidrives correctly under a UNIX-like OS. Thus, `grub-install' will prompt 599*1b8adde7SWilliam Kucharskiyou to check if it could really guess the correct mappings, after the 600*1b8adde7SWilliam Kucharskiinstallation. The format is defined in *Note Device map::. Please be 601*1b8adde7SWilliam Kucharskiquite careful. If the output is wrong, it is unlikely that your 602*1b8adde7SWilliam Kucharskicomputer will be able to boot with no problem. 603*1b8adde7SWilliam Kucharski 604*1b8adde7SWilliam Kucharski Note that `grub-install' is actually just a shell script and the 605*1b8adde7SWilliam Kucharskireal task is done by the grub shell `grub' (*note Invoking the grub 606*1b8adde7SWilliam Kucharskishell::). Therefore, you may run `grub' directly to install GRUB, 607*1b8adde7SWilliam Kucharskiwithout using `grub-install'. Don't do that, however, unless you are 608*1b8adde7SWilliam Kucharskivery familiar with the internals of GRUB. Installing a boot loader on a 609*1b8adde7SWilliam Kucharskirunning OS may be extremely dangerous. 610*1b8adde7SWilliam Kucharski 611*1b8adde7SWilliam Kucharski 612*1b8adde7SWilliam KucharskiFile: grub.info, Node: Making a GRUB bootable CD-ROM, Prev: Installing GRUB using grub-install, Up: Installation 613*1b8adde7SWilliam Kucharski 614*1b8adde7SWilliam KucharskiMaking a GRUB bootable CD-ROM 615*1b8adde7SWilliam Kucharski============================= 616*1b8adde7SWilliam Kucharski 617*1b8adde7SWilliam Kucharski GRUB supports the "no emulation mode" in the El Torito 618*1b8adde7SWilliam Kucharskispecification(1) (*note Making a GRUB bootable CD-ROM-Footnote-1::). 619*1b8adde7SWilliam KucharskiThis means that you can use the whole CD-ROM from GRUB and you don't 620*1b8adde7SWilliam Kucharskihave to make a floppy or hard disk image file, which can cause 621*1b8adde7SWilliam Kucharskicompatibility problems. 622*1b8adde7SWilliam Kucharski 623*1b8adde7SWilliam Kucharski For booting from a CD-ROM, GRUB uses a special Stage 2 called 624*1b8adde7SWilliam Kucharski`stage2_eltorito'. The only GRUB files you need to have in your 625*1b8adde7SWilliam Kucharskibootable CD-ROM are this `stage2_eltorito' and optionally a config file 626*1b8adde7SWilliam Kucharski`menu.lst'. You don't need to use `stage1' or `stage2', because El 627*1b8adde7SWilliam KucharskiTorito is quite different from the standard boot process. 628*1b8adde7SWilliam Kucharski 629*1b8adde7SWilliam Kucharski Here is an example of procedures to make a bootable CD-ROM image. 630*1b8adde7SWilliam KucharskiFirst, make a top directory for the bootable image, say, `iso': 631*1b8adde7SWilliam Kucharski 632*1b8adde7SWilliam Kucharski $ mkdir iso 633*1b8adde7SWilliam Kucharski 634*1b8adde7SWilliam Kucharski Make a directory for GRUB: 635*1b8adde7SWilliam Kucharski 636*1b8adde7SWilliam Kucharski $ mkdir -p iso/boot/grub 637*1b8adde7SWilliam Kucharski 638*1b8adde7SWilliam Kucharski Copy the file `stage2_eltorito': 639*1b8adde7SWilliam Kucharski 640*1b8adde7SWilliam Kucharski $ cp /usr/lib/grub/i386-pc/stage2_eltorito iso/boot/grub 641*1b8adde7SWilliam Kucharski 642*1b8adde7SWilliam Kucharski If desired, make the config file `menu.lst' under `iso/boot/grub' 643*1b8adde7SWilliam Kucharski(*note Configuration::), and copy any files and directories for the 644*1b8adde7SWilliam Kucharskidisc to the directory `iso/'. 645*1b8adde7SWilliam Kucharski 646*1b8adde7SWilliam Kucharski Finally, make a ISO9660 image file like this: 647*1b8adde7SWilliam Kucharski 648*1b8adde7SWilliam Kucharski $ mkisofs -R -b boot/grub/stage2_eltorito -no-emul-boot \ 649*1b8adde7SWilliam Kucharski -boot-load-size 4 -boot-info-table -o grub.iso iso 650*1b8adde7SWilliam Kucharski 651*1b8adde7SWilliam Kucharski This produces a file named `grub.iso', which then can be burned into 652*1b8adde7SWilliam Kucharskia CD (or a DVD). `mkisofs' has already set up the disc to boot from 653*1b8adde7SWilliam Kucharskithe `boot/grub/stage2_eltorito' file, so there is no need to setup GRUB 654*1b8adde7SWilliam Kucharskion the disc. (Note that the `-boot-load-size 4' bit is required for 655*1b8adde7SWilliam Kucharskicompatibility with the BIOS on many older machines.) 656*1b8adde7SWilliam Kucharski 657*1b8adde7SWilliam Kucharski You can use the device `(cd)' to access a CD-ROM in your config 658*1b8adde7SWilliam Kucharskifile. This is not required; GRUB automatically sets the root device to 659*1b8adde7SWilliam Kucharski`(cd)' when booted from a CD-ROM. It is only necessary to refer to 660*1b8adde7SWilliam Kucharski`(cd)' if you want to access other drives as well. 661*1b8adde7SWilliam Kucharski 662*1b8adde7SWilliam Kucharski 663*1b8adde7SWilliam KucharskiFile: grub.info, Node: Making a GRUB bootable CD-ROM-Footnotes, Up: Making a GRUB bootable CD-ROM 664*1b8adde7SWilliam Kucharski 665*1b8adde7SWilliam Kucharski (1) El Torito is a specification for bootable CD using BIOS 666*1b8adde7SWilliam Kucharskifunctions. 667*1b8adde7SWilliam Kucharski 668*1b8adde7SWilliam Kucharski 669*1b8adde7SWilliam KucharskiFile: grub.info, Node: Booting, Next: Configuration, Prev: Installation, Up: Top 670*1b8adde7SWilliam Kucharski 671*1b8adde7SWilliam KucharskiBooting 672*1b8adde7SWilliam Kucharski******* 673*1b8adde7SWilliam Kucharski 674*1b8adde7SWilliam Kucharski GRUB can load Multiboot-compliant kernels in a consistent way, but 675*1b8adde7SWilliam Kucharskifor some free operating systems you need to use some OS-specific magic. 676*1b8adde7SWilliam Kucharski 677*1b8adde7SWilliam Kucharski* Menu: 678*1b8adde7SWilliam Kucharski 679*1b8adde7SWilliam Kucharski* General boot methods:: How to boot OSes with GRUB generally 680*1b8adde7SWilliam Kucharski* OS-specific notes:: Notes on some operating systems 681*1b8adde7SWilliam Kucharski* Making your system robust:: How to make your system robust 682*1b8adde7SWilliam Kucharski 683*1b8adde7SWilliam Kucharski 684*1b8adde7SWilliam KucharskiFile: grub.info, Node: General boot methods, Next: OS-specific notes, Up: Booting 685*1b8adde7SWilliam Kucharski 686*1b8adde7SWilliam KucharskiHow to boot operating systems 687*1b8adde7SWilliam Kucharski============================= 688*1b8adde7SWilliam Kucharski 689*1b8adde7SWilliam Kucharski GRUB has two distinct boot methods. One of the two is to load an 690*1b8adde7SWilliam Kucharskioperating system directly, and the other is to chain-load another boot 691*1b8adde7SWilliam Kucharskiloader which then will load an operating system actually. Generally 692*1b8adde7SWilliam Kucharskispeaking, the former is more desirable, because you don't need to 693*1b8adde7SWilliam Kucharskiinstall or maintain other boot loaders and GRUB is flexible enough to 694*1b8adde7SWilliam Kucharskiload an operating system from an arbitrary disk/partition. However, the 695*1b8adde7SWilliam Kucharskilatter is sometimes required, since GRUB doesn't support all the 696*1b8adde7SWilliam Kucharskiexisting operating systems natively. 697*1b8adde7SWilliam Kucharski 698*1b8adde7SWilliam Kucharski* Menu: 699*1b8adde7SWilliam Kucharski 700*1b8adde7SWilliam Kucharski* Loading an operating system directly:: 701*1b8adde7SWilliam Kucharski* Chain-loading:: 702*1b8adde7SWilliam Kucharski 703*1b8adde7SWilliam Kucharski 704*1b8adde7SWilliam KucharskiFile: grub.info, Node: Loading an operating system directly, Next: Chain-loading, Up: General boot methods 705*1b8adde7SWilliam Kucharski 706*1b8adde7SWilliam KucharskiHow to boot an OS directly with GRUB 707*1b8adde7SWilliam Kucharski------------------------------------ 708*1b8adde7SWilliam Kucharski 709*1b8adde7SWilliam Kucharski Multiboot (*note Multiboot Specification: (multiboot)Top.) is the 710*1b8adde7SWilliam Kucharskinative format supported by GRUB. For the sake of convenience, there is 711*1b8adde7SWilliam Kucharskialso support for Linux, FreeBSD, NetBSD and OpenBSD. If you want to 712*1b8adde7SWilliam Kucharskiboot other operating systems, you will have to chain-load them (*note 713*1b8adde7SWilliam KucharskiChain-loading::). 714*1b8adde7SWilliam Kucharski 715*1b8adde7SWilliam Kucharski Generally, GRUB can boot any Multiboot-compliant OS in the following 716*1b8adde7SWilliam Kucharskisteps: 717*1b8adde7SWilliam Kucharski 718*1b8adde7SWilliam Kucharski 1. Set GRUB's root device to the drive where the OS images are stored 719*1b8adde7SWilliam Kucharski with the command `root' (*note root::). 720*1b8adde7SWilliam Kucharski 721*1b8adde7SWilliam Kucharski 2. Load the kernel image with the command `kernel' (*note kernel::). 722*1b8adde7SWilliam Kucharski 723*1b8adde7SWilliam Kucharski 3. If you need modules, load them with the command `module' (*note 724*1b8adde7SWilliam Kucharski module::) or `modulenounzip' (*note modulenounzip::). 725*1b8adde7SWilliam Kucharski 726*1b8adde7SWilliam Kucharski 4. Run the command `boot' (*note boot::). 727*1b8adde7SWilliam Kucharski 728*1b8adde7SWilliam Kucharski Linux, FreeBSD, NetBSD and OpenBSD can be booted in a similar 729*1b8adde7SWilliam Kucharskimanner. You load a kernel image with the command `kernel' and then run 730*1b8adde7SWilliam Kucharskithe command `boot'. If the kernel requires some parameters, just append 731*1b8adde7SWilliam Kucharskithe parameters to `kernel', after the file name of the kernel. Also, 732*1b8adde7SWilliam Kucharskiplease refer to *Note OS-specific notes::, for information on your 733*1b8adde7SWilliam KucharskiOS-specific issues. 734*1b8adde7SWilliam Kucharski 735*1b8adde7SWilliam Kucharski 736*1b8adde7SWilliam KucharskiFile: grub.info, Node: Chain-loading, Prev: Loading an operating system directly, Up: General boot methods 737*1b8adde7SWilliam Kucharski 738*1b8adde7SWilliam KucharskiLoad another boot loader to boot unsupported operating systems 739*1b8adde7SWilliam Kucharski-------------------------------------------------------------- 740*1b8adde7SWilliam Kucharski 741*1b8adde7SWilliam Kucharski If you want to boot an unsupported operating system (e.g. Windows 742*1b8adde7SWilliam Kucharski95), chain-load a boot loader for the operating system. Normally, the 743*1b8adde7SWilliam Kucharskiboot loader is embedded in the "boot sector" of the partition on which 744*1b8adde7SWilliam Kucharskithe operating system is installed. 745*1b8adde7SWilliam Kucharski 746*1b8adde7SWilliam Kucharski 1. Set GRUB's root device to the partition by the command 747*1b8adde7SWilliam Kucharski `rootnoverify' (*note rootnoverify::): 748*1b8adde7SWilliam Kucharski 749*1b8adde7SWilliam Kucharski grub> rootnoverify (hd0,0) 750*1b8adde7SWilliam Kucharski 751*1b8adde7SWilliam Kucharski 2. Set the "active" flag in the partition using the command 752*1b8adde7SWilliam Kucharski `makeactive'(1) (*note Chain-loading-Footnote-1::) (*note 753*1b8adde7SWilliam Kucharski makeactive::): 754*1b8adde7SWilliam Kucharski 755*1b8adde7SWilliam Kucharski grub> makeactive 756*1b8adde7SWilliam Kucharski 757*1b8adde7SWilliam Kucharski 3. Load the boot loader with the command `chainloader' (*note 758*1b8adde7SWilliam Kucharski chainloader::): 759*1b8adde7SWilliam Kucharski 760*1b8adde7SWilliam Kucharski grub> chainloader +1 761*1b8adde7SWilliam Kucharski 762*1b8adde7SWilliam Kucharski `+1' indicates that GRUB should read one sector from the start of 763*1b8adde7SWilliam Kucharski the partition. The complete description about this syntax can be 764*1b8adde7SWilliam Kucharski found in *Note Block list syntax::. 765*1b8adde7SWilliam Kucharski 766*1b8adde7SWilliam Kucharski 4. Run the command `boot' (*note boot::). 767*1b8adde7SWilliam Kucharski 768*1b8adde7SWilliam Kucharski However, DOS and Windows have some deficiencies, so you might have to 769*1b8adde7SWilliam Kucharskiuse more complicated instructions. *Note DOS/Windows::, for more 770*1b8adde7SWilliam Kucharskiinformation. 771*1b8adde7SWilliam Kucharski 772*1b8adde7SWilliam Kucharski 773*1b8adde7SWilliam KucharskiFile: grub.info, Node: Chain-loading-Footnotes, Up: Chain-loading 774*1b8adde7SWilliam Kucharski 775*1b8adde7SWilliam Kucharski (1) This is not necessary for most of the modern operating systems. 776*1b8adde7SWilliam Kucharski 777*1b8adde7SWilliam Kucharski 778*1b8adde7SWilliam KucharskiFile: grub.info, Node: OS-specific notes, Next: Making your system robust, Prev: General boot methods, Up: Booting 779*1b8adde7SWilliam Kucharski 780*1b8adde7SWilliam KucharskiSome caveats on OS-specific issues 781*1b8adde7SWilliam Kucharski================================== 782*1b8adde7SWilliam Kucharski 783*1b8adde7SWilliam Kucharski Here, we describe some caveats on several operating systems. 784*1b8adde7SWilliam Kucharski 785*1b8adde7SWilliam Kucharski* Menu: 786*1b8adde7SWilliam Kucharski 787*1b8adde7SWilliam Kucharski* GNU/Hurd:: 788*1b8adde7SWilliam Kucharski* GNU/Linux:: 789*1b8adde7SWilliam Kucharski* FreeBSD:: 790*1b8adde7SWilliam Kucharski* NetBSD:: 791*1b8adde7SWilliam Kucharski* OpenBSD:: 792*1b8adde7SWilliam Kucharski* DOS/Windows:: 793*1b8adde7SWilliam Kucharski* SCO UnixWare:: 794*1b8adde7SWilliam Kucharski* QNX:: 795*1b8adde7SWilliam Kucharski 796*1b8adde7SWilliam Kucharski 797*1b8adde7SWilliam KucharskiFile: grub.info, Node: GNU/Hurd, Next: GNU/Linux, Up: OS-specific notes 798*1b8adde7SWilliam Kucharski 799*1b8adde7SWilliam KucharskiGNU/Hurd 800*1b8adde7SWilliam Kucharski-------- 801*1b8adde7SWilliam Kucharski 802*1b8adde7SWilliam Kucharski Since GNU/Hurd is Multiboot-compliant, it is easy to boot it; there 803*1b8adde7SWilliam Kucharskiis nothing special about it. But do not forget that you have to specify 804*1b8adde7SWilliam Kucharskia root partition to the kernel. 805*1b8adde7SWilliam Kucharski 806*1b8adde7SWilliam Kucharski 1. Set GRUB's root device to the same drive as GNU/Hurd's. Probably 807*1b8adde7SWilliam Kucharski the command `find /boot/gnumach' or similar can help you (*note 808*1b8adde7SWilliam Kucharski find::). 809*1b8adde7SWilliam Kucharski 810*1b8adde7SWilliam Kucharski 2. Load the kernel and the module, like this: 811*1b8adde7SWilliam Kucharski 812*1b8adde7SWilliam Kucharski grub> kernel /boot/gnumach root=hd0s1 813*1b8adde7SWilliam Kucharski grub> module /boot/serverboot 814*1b8adde7SWilliam Kucharski 815*1b8adde7SWilliam Kucharski 3. Run the command `boot' (*note boot::). 816*1b8adde7SWilliam Kucharski 817*1b8adde7SWilliam Kucharski 818*1b8adde7SWilliam KucharskiFile: grub.info, Node: GNU/Linux, Next: FreeBSD, Prev: GNU/Hurd, Up: OS-specific notes 819*1b8adde7SWilliam Kucharski 820*1b8adde7SWilliam KucharskiGNU/Linux 821*1b8adde7SWilliam Kucharski--------- 822*1b8adde7SWilliam Kucharski 823*1b8adde7SWilliam Kucharski It is relatively easy to boot GNU/Linux from GRUB, because it 824*1b8adde7SWilliam Kucharskisomewhat resembles to boot a Multiboot-compliant OS. 825*1b8adde7SWilliam Kucharski 826*1b8adde7SWilliam Kucharski 1. Set GRUB's root device to the same drive as GNU/Linux's. Probably 827*1b8adde7SWilliam Kucharski the command `find /vmlinuz' or similar can help you (*note find::). 828*1b8adde7SWilliam Kucharski 829*1b8adde7SWilliam Kucharski 2. Load the kernel: 830*1b8adde7SWilliam Kucharski 831*1b8adde7SWilliam Kucharski grub> kernel /vmlinuz root=/dev/hda1 832*1b8adde7SWilliam Kucharski 833*1b8adde7SWilliam Kucharski If you need to specify some kernel parameters, just append them to 834*1b8adde7SWilliam Kucharski the command. For example, to set `vga' to `ext', do this: 835*1b8adde7SWilliam Kucharski 836*1b8adde7SWilliam Kucharski grub> kernel /vmlinuz root=/dev/hda1 vga=ext 837*1b8adde7SWilliam Kucharski 838*1b8adde7SWilliam Kucharski See the documentation in the Linux source tree for complete 839*1b8adde7SWilliam Kucharski information on the available options. 840*1b8adde7SWilliam Kucharski 841*1b8adde7SWilliam Kucharski 3. If you use an initrd, execute the command `initrd' (*note 842*1b8adde7SWilliam Kucharski initrd::) after `kernel': 843*1b8adde7SWilliam Kucharski 844*1b8adde7SWilliam Kucharski grub> initrd /initrd 845*1b8adde7SWilliam Kucharski 846*1b8adde7SWilliam Kucharski 4. Finally, run the command `boot' (*note boot::). 847*1b8adde7SWilliam Kucharski 848*1b8adde7SWilliam Kucharski *Caution:* If you use an initrd and specify the `mem=' option to the 849*1b8adde7SWilliam Kucharskikernel to let it use less than actual memory size, you will also have 850*1b8adde7SWilliam Kucharskito specify the same memory size to GRUB. To let GRUB know the size, run 851*1b8adde7SWilliam Kucharskithe command `uppermem' _before_ loading the kernel. *Note uppermem::, 852*1b8adde7SWilliam Kucharskifor more information. 853*1b8adde7SWilliam Kucharski 854*1b8adde7SWilliam Kucharski 855*1b8adde7SWilliam KucharskiFile: grub.info, Node: FreeBSD, Next: NetBSD, Prev: GNU/Linux, Up: OS-specific notes 856*1b8adde7SWilliam Kucharski 857*1b8adde7SWilliam KucharskiFreeBSD 858*1b8adde7SWilliam Kucharski------- 859*1b8adde7SWilliam Kucharski 860*1b8adde7SWilliam Kucharski GRUB can load the kernel directly, either in ELF or a.out format. But 861*1b8adde7SWilliam Kucharskithis is not recommended, since FreeBSD's bootstrap interface sometimes 862*1b8adde7SWilliam Kucharskichanges heavily, so GRUB can't guarantee to pass kernel parameters 863*1b8adde7SWilliam Kucharskicorrectly. 864*1b8adde7SWilliam Kucharski 865*1b8adde7SWilliam Kucharski Thus, we'd recommend loading the very flexible loader `/boot/loader' 866*1b8adde7SWilliam Kucharskiinstead. See this example: 867*1b8adde7SWilliam Kucharski 868*1b8adde7SWilliam Kucharski grub> root (hd0,a) 869*1b8adde7SWilliam Kucharski grub> kernel /boot/loader 870*1b8adde7SWilliam Kucharski grub> boot 871*1b8adde7SWilliam Kucharski 872*1b8adde7SWilliam Kucharski 873*1b8adde7SWilliam KucharskiFile: grub.info, Node: NetBSD, Next: OpenBSD, Prev: FreeBSD, Up: OS-specific notes 874*1b8adde7SWilliam Kucharski 875*1b8adde7SWilliam KucharskiNetBSD 876*1b8adde7SWilliam Kucharski------ 877*1b8adde7SWilliam Kucharski 878*1b8adde7SWilliam Kucharski GRUB can load NetBSD a.out and ELF directly, follow these steps: 879*1b8adde7SWilliam Kucharski 880*1b8adde7SWilliam Kucharski 1. Set GRUB's root device with `root' (*note root::). 881*1b8adde7SWilliam Kucharski 882*1b8adde7SWilliam Kucharski 2. Load the kernel with `kernel' (*note kernel::). You should append 883*1b8adde7SWilliam Kucharski the ugly option `--type=netbsd', if you want to load an ELF 884*1b8adde7SWilliam Kucharski kernel, like this: 885*1b8adde7SWilliam Kucharski 886*1b8adde7SWilliam Kucharski grub> kernel --type=netbsd /netbsd-elf 887*1b8adde7SWilliam Kucharski 888*1b8adde7SWilliam Kucharski 3. Run `boot' (*note boot::). 889*1b8adde7SWilliam Kucharski 890*1b8adde7SWilliam Kucharski For now, however, GRUB doesn't allow you to pass kernel parameters, 891*1b8adde7SWilliam Kucharskiso it may be better to chain-load it instead. For more information, 892*1b8adde7SWilliam Kucharskiplease see *Note Chain-loading::. 893*1b8adde7SWilliam Kucharski 894*1b8adde7SWilliam Kucharski 895*1b8adde7SWilliam KucharskiFile: grub.info, Node: OpenBSD, Next: DOS/Windows, Prev: NetBSD, Up: OS-specific notes 896*1b8adde7SWilliam Kucharski 897*1b8adde7SWilliam KucharskiOpenBSD 898*1b8adde7SWilliam Kucharski------- 899*1b8adde7SWilliam Kucharski 900*1b8adde7SWilliam Kucharski The booting instruction is exactly the same as for NetBSD (*note 901*1b8adde7SWilliam KucharskiNetBSD::). 902*1b8adde7SWilliam Kucharski 903*1b8adde7SWilliam Kucharski 904*1b8adde7SWilliam KucharskiFile: grub.info, Node: DOS/Windows, Next: SCO UnixWare, Prev: OpenBSD, Up: OS-specific notes 905*1b8adde7SWilliam Kucharski 906*1b8adde7SWilliam KucharskiDOS/Windows 907*1b8adde7SWilliam Kucharski----------- 908*1b8adde7SWilliam Kucharski 909*1b8adde7SWilliam Kucharski GRUB cannot boot DOS or Windows directly, so you must chain-load them 910*1b8adde7SWilliam Kucharski(*note Chain-loading::). However, their boot loaders have some critical 911*1b8adde7SWilliam Kucharskideficiencies, so it may not work to just chain-load them. To overcome 912*1b8adde7SWilliam Kucharskithe problems, GRUB provides you with two helper functions. 913*1b8adde7SWilliam Kucharski 914*1b8adde7SWilliam Kucharski If you have installed DOS (or Windows) on a non-first hard disk, you 915*1b8adde7SWilliam Kucharskihave to use the disk swapping technique, because that OS cannot boot 916*1b8adde7SWilliam Kucharskifrom any disks but the first one. The workaround used in GRUB is the 917*1b8adde7SWilliam Kucharskicommand `map' (*note map::), like this: 918*1b8adde7SWilliam Kucharski 919*1b8adde7SWilliam Kucharski grub> map (hd0) (hd1) 920*1b8adde7SWilliam Kucharski grub> map (hd1) (hd0) 921*1b8adde7SWilliam Kucharski 922*1b8adde7SWilliam Kucharski This performs a "virtual" swap between your first and second hard 923*1b8adde7SWilliam Kucharskidrive. 924*1b8adde7SWilliam Kucharski 925*1b8adde7SWilliam Kucharski *Caution:* This is effective only if DOS (or Windows) uses BIOS to 926*1b8adde7SWilliam Kucharskiaccess the swapped disks. If that OS uses a special driver for the 927*1b8adde7SWilliam Kucharskidisks, this probably won't work. 928*1b8adde7SWilliam Kucharski 929*1b8adde7SWilliam Kucharski Another problem arises if you installed more than one set of 930*1b8adde7SWilliam KucharskiDOS/Windows onto one disk, because they could be confused if there are 931*1b8adde7SWilliam Kucharskimore than one primary partitions for DOS/Windows. Certainly you should 932*1b8adde7SWilliam Kucharskiavoid doing this, but there is a solution if you do want to do so. Use 933*1b8adde7SWilliam Kucharskithe partition hiding/unhiding technique. 934*1b8adde7SWilliam Kucharski 935*1b8adde7SWilliam Kucharski If GRUB "hide"s a DOS (or Windows) partition (*note hide::), DOS (or 936*1b8adde7SWilliam KucharskiWindows) will ignore the partition. If GRUB "unhide"s a DOS (or 937*1b8adde7SWilliam KucharskiWindows) partition (*note unhide::), DOS (or Windows) will detect the 938*1b8adde7SWilliam Kucharskipartition. Thus, if you have installed DOS (or Windows) on the first 939*1b8adde7SWilliam Kucharskiand the second partition of the first hard disk, and you want to boot 940*1b8adde7SWilliam Kucharskithe copy on the first partition, do the following: 941*1b8adde7SWilliam Kucharski 942*1b8adde7SWilliam Kucharski grub> unhide (hd0,0) 943*1b8adde7SWilliam Kucharski grub> hide (hd0,1) 944*1b8adde7SWilliam Kucharski grub> rootnoverify (hd0,0) 945*1b8adde7SWilliam Kucharski grub> chainloader +1 946*1b8adde7SWilliam Kucharski grub> makeactive 947*1b8adde7SWilliam Kucharski grub> boot 948*1b8adde7SWilliam Kucharski 949*1b8adde7SWilliam Kucharski 950*1b8adde7SWilliam KucharskiFile: grub.info, Node: SCO UnixWare, Next: QNX, Prev: DOS/Windows, Up: OS-specific notes 951*1b8adde7SWilliam Kucharski 952*1b8adde7SWilliam KucharskiSCO UnixWare 953*1b8adde7SWilliam Kucharski------------ 954*1b8adde7SWilliam Kucharski 955*1b8adde7SWilliam Kucharski It is known that the signature in the boot loader for SCO UnixWare is 956*1b8adde7SWilliam Kucharskiwrong, so you will have to specify the option `--force' to 957*1b8adde7SWilliam Kucharski`chainloader' (*note chainloader::), like this: 958*1b8adde7SWilliam Kucharski 959*1b8adde7SWilliam Kucharski grub> rootnoverify (hd1,0) 960*1b8adde7SWilliam Kucharski grub> chainloader --force +1 961*1b8adde7SWilliam Kucharski grub> makeactive 962*1b8adde7SWilliam Kucharski grub> boot 963*1b8adde7SWilliam Kucharski 964*1b8adde7SWilliam Kucharski 965*1b8adde7SWilliam KucharskiFile: grub.info, Node: QNX, Prev: SCO UnixWare, Up: OS-specific notes 966*1b8adde7SWilliam Kucharski 967*1b8adde7SWilliam KucharskiQNX 968*1b8adde7SWilliam Kucharski--- 969*1b8adde7SWilliam Kucharski 970*1b8adde7SWilliam Kucharski QNX seems to use a bigger boot loader, so you need to boot it up, 971*1b8adde7SWilliam Kucharskilike this: 972*1b8adde7SWilliam Kucharski 973*1b8adde7SWilliam Kucharski grub> rootnoverify (hd1,1) 974*1b8adde7SWilliam Kucharski grub> chainloader +4 975*1b8adde7SWilliam Kucharski grub> boot 976*1b8adde7SWilliam Kucharski 977*1b8adde7SWilliam Kucharski 978*1b8adde7SWilliam KucharskiFile: grub.info, Node: Making your system robust, Prev: OS-specific notes, Up: Booting 979*1b8adde7SWilliam Kucharski 980*1b8adde7SWilliam KucharskiHow to make your system robust 981*1b8adde7SWilliam Kucharski============================== 982*1b8adde7SWilliam Kucharski 983*1b8adde7SWilliam Kucharski When you test a new kernel or a new OS, it is important to make sure 984*1b8adde7SWilliam Kucharskithat your computer can boot even if the new system is unbootable. This 985*1b8adde7SWilliam Kucharskiis crucial especially if you maintain servers or remote systems. To 986*1b8adde7SWilliam Kucharskiaccomplish this goal, you need to set up two things: 987*1b8adde7SWilliam Kucharski 988*1b8adde7SWilliam Kucharski 1. You must maintain a system which is always bootable. For instance, 989*1b8adde7SWilliam Kucharski if you test a new kernel, you need to keep a working kernel in a 990*1b8adde7SWilliam Kucharski different place. And, it would sometimes be very nice to even have 991*1b8adde7SWilliam Kucharski a complete copy of a working system in a different partition or 992*1b8adde7SWilliam Kucharski disk. 993*1b8adde7SWilliam Kucharski 994*1b8adde7SWilliam Kucharski 2. You must direct GRUB to boot a working system when the new system 995*1b8adde7SWilliam Kucharski fails. This is possible with the "fallback" system in GRUB. 996*1b8adde7SWilliam Kucharski 997*1b8adde7SWilliam Kucharski The former requirement is very specific to each OS, so this 998*1b8adde7SWilliam Kucharskidocumentation does not cover that topic. It is better to consult some 999*1b8adde7SWilliam Kucharskibackup tools. 1000*1b8adde7SWilliam Kucharski 1001*1b8adde7SWilliam Kucharski So let's see the GRUB part. There are two possibilities: one of them 1002*1b8adde7SWilliam Kucharskiis quite simple but not very robust, and the other is a bit complex to 1003*1b8adde7SWilliam Kucharskiset up but probably the best solution to make sure that your system can 1004*1b8adde7SWilliam Kucharskistart as long as GRUB itself is bootable. 1005*1b8adde7SWilliam Kucharski 1006*1b8adde7SWilliam Kucharski* Menu: 1007*1b8adde7SWilliam Kucharski 1008*1b8adde7SWilliam Kucharski* Booting once-only:: 1009*1b8adde7SWilliam Kucharski* Booting fallback systems:: 1010*1b8adde7SWilliam Kucharski 1011*1b8adde7SWilliam Kucharski 1012*1b8adde7SWilliam KucharskiFile: grub.info, Node: Booting once-only, Next: Booting fallback systems, Up: Making your system robust 1013*1b8adde7SWilliam Kucharski 1014*1b8adde7SWilliam KucharskiBooting once-only 1015*1b8adde7SWilliam Kucharski----------------- 1016*1b8adde7SWilliam Kucharski 1017*1b8adde7SWilliam Kucharski You can teach GRUB to boot an entry only at next boot time. Suppose 1018*1b8adde7SWilliam Kucharskithat your have an old kernel `old_kernel' and a new kernel 1019*1b8adde7SWilliam Kucharski`new_kernel'. You know that `old_kernel' can boot your system 1020*1b8adde7SWilliam Kucharskicorrectly, and you want to test `new_kernel'. 1021*1b8adde7SWilliam Kucharski 1022*1b8adde7SWilliam Kucharski To ensure that your system will go back to the old kernel even if the 1023*1b8adde7SWilliam Kucharskinew kernel fails (e.g. it panics), you can specify that GRUB should try 1024*1b8adde7SWilliam Kucharskithe new kernel only once and boot the old kernel after that. 1025*1b8adde7SWilliam Kucharski 1026*1b8adde7SWilliam Kucharski First, modify your configuration file. Here is an example: 1027*1b8adde7SWilliam Kucharski 1028*1b8adde7SWilliam Kucharski default saved # This is important!!! 1029*1b8adde7SWilliam Kucharski timeout 10 1030*1b8adde7SWilliam Kucharski 1031*1b8adde7SWilliam Kucharski title the old kernel 1032*1b8adde7SWilliam Kucharski root (hd0,0) 1033*1b8adde7SWilliam Kucharski kernel /old_kernel 1034*1b8adde7SWilliam Kucharski savedefault 1035*1b8adde7SWilliam Kucharski 1036*1b8adde7SWilliam Kucharski title the new kernel 1037*1b8adde7SWilliam Kucharski root (hd0,0) 1038*1b8adde7SWilliam Kucharski kernel /new_kernel 1039*1b8adde7SWilliam Kucharski savedefault 0 # This is important!!! 1040*1b8adde7SWilliam Kucharski 1041*1b8adde7SWilliam Kucharski Note that this configuration file uses `default saved' (*note 1042*1b8adde7SWilliam Kucharskidefault::) at the head and `savedefault 0' (*note savedefault::) in the 1043*1b8adde7SWilliam Kucharskientry for the new kernel. This means that GRUB boots a saved entry by 1044*1b8adde7SWilliam Kucharskidefault, and booting the entry for the new kernel saves `0' as the 1045*1b8adde7SWilliam Kucharskisaved entry. 1046*1b8adde7SWilliam Kucharski 1047*1b8adde7SWilliam Kucharski With this configuration file, after all, GRUB always tries to boot 1048*1b8adde7SWilliam Kucharskithe old kernel after it booted the new one, because `0' is the entry of 1049*1b8adde7SWilliam Kucharski`the old kernel'. 1050*1b8adde7SWilliam Kucharski 1051*1b8adde7SWilliam Kucharski The next step is to tell GRUB to boot the new kernel at next boot 1052*1b8adde7SWilliam Kucharskitime. For this, execute `grub-set-default' (*note Invoking 1053*1b8adde7SWilliam Kucharskigrub-set-default::): 1054*1b8adde7SWilliam Kucharski 1055*1b8adde7SWilliam Kucharski # grub-set-default 1 1056*1b8adde7SWilliam Kucharski 1057*1b8adde7SWilliam Kucharski This command sets the saved entry to `1', that is, to the new kernel. 1058*1b8adde7SWilliam Kucharski 1059*1b8adde7SWilliam Kucharski This method is useful, but still not very robust, because GRUB stops 1060*1b8adde7SWilliam Kucharskibooting, if there is any error in the boot entry, such that the new 1061*1b8adde7SWilliam Kucharskikernel has an invalid executable format. Thus, it it even better to use 1062*1b8adde7SWilliam Kucharskithe "fallback" mechanism of GRUB. Look at next subsection for this 1063*1b8adde7SWilliam Kucharskifeature. 1064*1b8adde7SWilliam Kucharski 1065*1b8adde7SWilliam Kucharski 1066*1b8adde7SWilliam KucharskiFile: grub.info, Node: Booting fallback systems, Prev: Booting once-only, Up: Making your system robust 1067*1b8adde7SWilliam Kucharski 1068*1b8adde7SWilliam KucharskiBooting fallback systems 1069*1b8adde7SWilliam Kucharski------------------------ 1070*1b8adde7SWilliam Kucharski 1071*1b8adde7SWilliam Kucharski GRUB supports a fallback mechanism of booting one or more other 1072*1b8adde7SWilliam Kucharskientries if a default boot entry fails. You can specify multiple 1073*1b8adde7SWilliam Kucharskifallback entries if you wish. 1074*1b8adde7SWilliam Kucharski 1075*1b8adde7SWilliam Kucharski Suppose that you have three systems, `A', `B' and `C'. `A' is a 1076*1b8adde7SWilliam Kucharskisystem which you want to boot by default. `B' is a backup system which 1077*1b8adde7SWilliam Kucharskiis supposed to boot safely. `C' is another backup system which is used 1078*1b8adde7SWilliam Kucharskiin case where `B' is broken. 1079*1b8adde7SWilliam Kucharski 1080*1b8adde7SWilliam Kucharski Then you may want GRUB to boot the first system which is bootable 1081*1b8adde7SWilliam Kucharskiamong `A', `B' and `C'. A configuration file can be written in this way: 1082*1b8adde7SWilliam Kucharski 1083*1b8adde7SWilliam Kucharski default saved # This is important!!! 1084*1b8adde7SWilliam Kucharski timeout 10 1085*1b8adde7SWilliam Kucharski fallback 1 2 # This is important!!! 1086*1b8adde7SWilliam Kucharski 1087*1b8adde7SWilliam Kucharski title A 1088*1b8adde7SWilliam Kucharski root (hd0,0) 1089*1b8adde7SWilliam Kucharski kernel /kernel 1090*1b8adde7SWilliam Kucharski savedefault fallback # This is important!!! 1091*1b8adde7SWilliam Kucharski 1092*1b8adde7SWilliam Kucharski title B 1093*1b8adde7SWilliam Kucharski root (hd1,0) 1094*1b8adde7SWilliam Kucharski kernel /kernel 1095*1b8adde7SWilliam Kucharski savedefault fallback # This is important!!! 1096*1b8adde7SWilliam Kucharski 1097*1b8adde7SWilliam Kucharski title C 1098*1b8adde7SWilliam Kucharski root (hd2,0) 1099*1b8adde7SWilliam Kucharski kernel /kernel 1100*1b8adde7SWilliam Kucharski savedefault 1101*1b8adde7SWilliam Kucharski 1102*1b8adde7SWilliam Kucharski Note that `default saved' (*note default::), `fallback 1 2' and 1103*1b8adde7SWilliam Kucharski`savedefault fallback' are used. GRUB will boot a saved entry by 1104*1b8adde7SWilliam Kucharskidefault and save a fallback entry as next boot entry with this 1105*1b8adde7SWilliam Kucharskiconfiguration. 1106*1b8adde7SWilliam Kucharski 1107*1b8adde7SWilliam Kucharski When GRUB tries to boot `A', GRUB saves `1' as next boot entry, 1108*1b8adde7SWilliam Kucharskibecause the command `fallback' specifies that `1' is the first fallback 1109*1b8adde7SWilliam Kucharskientry. The entry `1' is `B', so GRUB will try to boot `B' at next boot 1110*1b8adde7SWilliam Kucharskitime. 1111*1b8adde7SWilliam Kucharski 1112*1b8adde7SWilliam Kucharski Likewise, when GRUB tries to boot `B', GRUB saves `2' as next boot 1113*1b8adde7SWilliam Kucharskientry, because `fallback' specifies `2' as next fallback entry. This 1114*1b8adde7SWilliam Kucharskimakes sure that GRUB will boot `C' after booting `B'. 1115*1b8adde7SWilliam Kucharski 1116*1b8adde7SWilliam Kucharski It is noteworthy that GRUB uses fallback entries both when GRUB 1117*1b8adde7SWilliam Kucharskiitself fails in booting an entry and when `A' or `B' fails in starting 1118*1b8adde7SWilliam Kucharskiup your system. So this solution ensures that your system is started 1119*1b8adde7SWilliam Kucharskieven if GRUB cannot find your kernel or if your kernel panics. 1120*1b8adde7SWilliam Kucharski 1121*1b8adde7SWilliam Kucharski However, you need to run `grub-set-default' (*note Invoking 1122*1b8adde7SWilliam Kucharskigrub-set-default::) when `A' starts correctly or you fix `A' after it 1123*1b8adde7SWilliam Kucharskicrashes, since GRUB always sets next boot entry to a fallback entry. 1124*1b8adde7SWilliam KucharskiYou should run this command in a startup script such as `rc.local' to 1125*1b8adde7SWilliam Kucharskiboot `A' by default: 1126*1b8adde7SWilliam Kucharski 1127*1b8adde7SWilliam Kucharski # grub-set-default 0 1128*1b8adde7SWilliam Kucharski 1129*1b8adde7SWilliam Kucharski where `0' is the number of the boot entry for the system `A'. 1130*1b8adde7SWilliam Kucharski 1131*1b8adde7SWilliam Kucharski If you want to see what is current default entry, you can look at the 1132*1b8adde7SWilliam Kucharskifile `/boot/grub/default' (or `/grub/default' in some systems). Because 1133*1b8adde7SWilliam Kucharskithis file is plain-text, you can just `cat' this file. But it is 1134*1b8adde7SWilliam Kucharskistrongly recommended *not to modify this file directly*, because GRUB 1135*1b8adde7SWilliam Kucharskimay fail in saving a default entry in this file, if you change this 1136*1b8adde7SWilliam Kucharskifile in an unintended manner. Therefore, you should use 1137*1b8adde7SWilliam Kucharski`grub-set-default' when you need to change the default entry. 1138*1b8adde7SWilliam Kucharski 1139*1b8adde7SWilliam Kucharski 1140*1b8adde7SWilliam KucharskiFile: grub.info, Node: Configuration, Next: Network, Prev: Booting, Up: Top 1141*1b8adde7SWilliam Kucharski 1142*1b8adde7SWilliam KucharskiConfiguration 1143*1b8adde7SWilliam Kucharski************* 1144*1b8adde7SWilliam Kucharski 1145*1b8adde7SWilliam Kucharski You've probably noticed that you need to type several commands to 1146*1b8adde7SWilliam Kucharskiboot your OS. There's a solution to that - GRUB provides a menu 1147*1b8adde7SWilliam Kucharskiinterface (*note Menu interface::) from which you can select an item 1148*1b8adde7SWilliam Kucharski(using arrow keys) that will do everything to boot an OS. 1149*1b8adde7SWilliam Kucharski 1150*1b8adde7SWilliam Kucharski To enable the menu, you need a configuration file, `menu.lst' under 1151*1b8adde7SWilliam Kucharskithe boot directory. We'll analyze an example file. 1152*1b8adde7SWilliam Kucharski 1153*1b8adde7SWilliam Kucharski The file first contains some general settings, the menu interface 1154*1b8adde7SWilliam Kucharskirelated options. You can put these commands (*note Menu-specific 1155*1b8adde7SWilliam Kucharskicommands::) before any of the items (starting with `title' (*note 1156*1b8adde7SWilliam Kucharskititle::)). 1157*1b8adde7SWilliam Kucharski 1158*1b8adde7SWilliam Kucharski # 1159*1b8adde7SWilliam Kucharski # Sample boot menu configuration file 1160*1b8adde7SWilliam Kucharski # 1161*1b8adde7SWilliam Kucharski 1162*1b8adde7SWilliam Kucharski As you may have guessed, these lines are comments. Lines starting 1163*1b8adde7SWilliam Kucharskiwith a hash character (`#'), and blank lines, are ignored by GRUB. 1164*1b8adde7SWilliam Kucharski 1165*1b8adde7SWilliam Kucharski # By default, boot the first entry. 1166*1b8adde7SWilliam Kucharski default 0 1167*1b8adde7SWilliam Kucharski 1168*1b8adde7SWilliam Kucharski The first entry (here, counting starts with number zero, not one!) 1169*1b8adde7SWilliam Kucharskiwill be the default choice. 1170*1b8adde7SWilliam Kucharski 1171*1b8adde7SWilliam Kucharski # Boot automatically after 30 secs. 1172*1b8adde7SWilliam Kucharski timeout 30 1173*1b8adde7SWilliam Kucharski 1174*1b8adde7SWilliam Kucharski As the comment says, GRUB will boot automatically in 30 seconds, 1175*1b8adde7SWilliam Kucharskiunless interrupted with a keypress. 1176*1b8adde7SWilliam Kucharski 1177*1b8adde7SWilliam Kucharski # Fallback to the second entry. 1178*1b8adde7SWilliam Kucharski fallback 1 1179*1b8adde7SWilliam Kucharski 1180*1b8adde7SWilliam Kucharski If, for any reason, the default entry doesn't work, fall back to the 1181*1b8adde7SWilliam Kucharskisecond one (this is rarely used, for obvious reasons). 1182*1b8adde7SWilliam Kucharski 1183*1b8adde7SWilliam Kucharski Note that the complete descriptions of these commands, which are menu 1184*1b8adde7SWilliam Kucharskiinterface specific, can be found in *Note Menu-specific commands::. 1185*1b8adde7SWilliam KucharskiOther descriptions can be found in *Note Commands::. 1186*1b8adde7SWilliam Kucharski 1187*1b8adde7SWilliam Kucharski Now, on to the actual OS definitions. You will see that each entry 1188*1b8adde7SWilliam Kucharskibegins with a special command, `title' (*note title::), and the action 1189*1b8adde7SWilliam Kucharskiis described after it. Note that there is no command `boot' (*note 1190*1b8adde7SWilliam Kucharskiboot::) at the end of each item. That is because GRUB automatically 1191*1b8adde7SWilliam Kucharskiexecutes `boot' if it loads other commands successfully. 1192*1b8adde7SWilliam Kucharski 1193*1b8adde7SWilliam Kucharski The argument for the command `title' is used to display a short 1194*1b8adde7SWilliam Kucharskititle/description of the entry in the menu. Since `title' displays the 1195*1b8adde7SWilliam Kucharskiargument as is, you can write basically anything there. 1196*1b8adde7SWilliam Kucharski 1197*1b8adde7SWilliam Kucharski # For booting GNU/Hurd 1198*1b8adde7SWilliam Kucharski title GNU/Hurd 1199*1b8adde7SWilliam Kucharski root (hd0,0) 1200*1b8adde7SWilliam Kucharski kernel /boot/gnumach.gz root=hd0s1 1201*1b8adde7SWilliam Kucharski module /boot/serverboot.gz 1202*1b8adde7SWilliam Kucharski 1203*1b8adde7SWilliam Kucharski This boots GNU/Hurd from the first hard disk. 1204*1b8adde7SWilliam Kucharski 1205*1b8adde7SWilliam Kucharski # For booting GNU/Linux 1206*1b8adde7SWilliam Kucharski title GNU/Linux 1207*1b8adde7SWilliam Kucharski kernel (hd1,0)/vmlinuz root=/dev/hdb1 1208*1b8adde7SWilliam Kucharski 1209*1b8adde7SWilliam Kucharski This boots GNU/Linux, but from the second hard disk. 1210*1b8adde7SWilliam Kucharski 1211*1b8adde7SWilliam Kucharski # For booting Mach (getting kernel from floppy) 1212*1b8adde7SWilliam Kucharski title Utah Mach4 multiboot 1213*1b8adde7SWilliam Kucharski root (hd0,2) 1214*1b8adde7SWilliam Kucharski pause Insert the diskette now^G!! 1215*1b8adde7SWilliam Kucharski kernel (fd0)/boot/kernel root=hd0s3 1216*1b8adde7SWilliam Kucharski module (fd0)/boot/bootstrap 1217*1b8adde7SWilliam Kucharski 1218*1b8adde7SWilliam Kucharski This boots Mach with a kernel on a floppy, but the root filesystem at 1219*1b8adde7SWilliam Kucharskihd0s3. It also contains a `pause' line (*note pause::), which will 1220*1b8adde7SWilliam Kucharskicause GRUB to display a prompt and delay, before actually executing the 1221*1b8adde7SWilliam Kucharskirest of the commands and booting. 1222*1b8adde7SWilliam Kucharski 1223*1b8adde7SWilliam Kucharski # For booting FreeBSD 1224*1b8adde7SWilliam Kucharski title FreeBSD 1225*1b8adde7SWilliam Kucharski root (hd0,2,a) 1226*1b8adde7SWilliam Kucharski kernel /boot/loader 1227*1b8adde7SWilliam Kucharski 1228*1b8adde7SWilliam Kucharski This item will boot FreeBSD kernel loaded from the `a' partition of 1229*1b8adde7SWilliam Kucharskithe third PC slice of the first hard disk. 1230*1b8adde7SWilliam Kucharski 1231*1b8adde7SWilliam Kucharski # For booting OS/2 1232*1b8adde7SWilliam Kucharski title OS/2 1233*1b8adde7SWilliam Kucharski root (hd0,1) 1234*1b8adde7SWilliam Kucharski makeactive 1235*1b8adde7SWilliam Kucharski # chainload OS/2 bootloader from the first sector 1236*1b8adde7SWilliam Kucharski chainloader +1 1237*1b8adde7SWilliam Kucharski # This is similar to "chainload", but loads a specific file 1238*1b8adde7SWilliam Kucharski #chainloader /boot/chain.os2 1239*1b8adde7SWilliam Kucharski 1240*1b8adde7SWilliam Kucharski This will boot OS/2, using a chain-loader (*note Chain-loading::). 1241*1b8adde7SWilliam Kucharski 1242*1b8adde7SWilliam Kucharski # For booting Windows NT or Windows95 1243*1b8adde7SWilliam Kucharski title Windows NT / Windows 95 boot menu 1244*1b8adde7SWilliam Kucharski root (hd0,0) 1245*1b8adde7SWilliam Kucharski makeactive 1246*1b8adde7SWilliam Kucharski chainloader +1 1247*1b8adde7SWilliam Kucharski # For loading DOS if Windows NT is installed 1248*1b8adde7SWilliam Kucharski # chainload /bootsect.dos 1249*1b8adde7SWilliam Kucharski 1250*1b8adde7SWilliam Kucharski The same as the above, but for Windows. 1251*1b8adde7SWilliam Kucharski 1252*1b8adde7SWilliam Kucharski # For installing GRUB into the hard disk 1253*1b8adde7SWilliam Kucharski title Install GRUB into the hard disk 1254*1b8adde7SWilliam Kucharski root (hd0,0) 1255*1b8adde7SWilliam Kucharski setup (hd0) 1256*1b8adde7SWilliam Kucharski 1257*1b8adde7SWilliam Kucharski This will just (re)install GRUB onto the hard disk. 1258*1b8adde7SWilliam Kucharski 1259*1b8adde7SWilliam Kucharski # Change the colors. 1260*1b8adde7SWilliam Kucharski title Change the colors 1261*1b8adde7SWilliam Kucharski color light-green/brown blink-red/blue 1262*1b8adde7SWilliam Kucharski 1263*1b8adde7SWilliam Kucharski In the last entry, the command `color' is used (*note color::), to 1264*1b8adde7SWilliam Kucharskichange the menu colors (try it!). This command is somewhat special, 1265*1b8adde7SWilliam Kucharskibecause it can be used both in the command-line and in the menu. GRUB 1266*1b8adde7SWilliam Kucharskihas several such commands, see *Note General commands::. 1267*1b8adde7SWilliam Kucharski 1268*1b8adde7SWilliam Kucharski We hope that you now understand how to use the basic features of 1269*1b8adde7SWilliam KucharskiGRUB. To learn more about GRUB, see the following chapters. 1270*1b8adde7SWilliam Kucharski 1271*1b8adde7SWilliam Kucharski 1272*1b8adde7SWilliam KucharskiFile: grub.info, Node: Network, Next: Serial terminal, Prev: Configuration, Up: Top 1273*1b8adde7SWilliam Kucharski 1274*1b8adde7SWilliam KucharskiDownloading OS images from a network 1275*1b8adde7SWilliam Kucharski************************************ 1276*1b8adde7SWilliam Kucharski 1277*1b8adde7SWilliam Kucharski Although GRUB is a disk-based boot loader, it does provide network 1278*1b8adde7SWilliam Kucharskisupport. To use the network support, you need to enable at least one 1279*1b8adde7SWilliam Kucharskinetwork driver in the GRUB build process. For more information please 1280*1b8adde7SWilliam Kucharskisee `netboot/README.netboot' in the source distribution. 1281*1b8adde7SWilliam Kucharski 1282*1b8adde7SWilliam Kucharski* Menu: 1283*1b8adde7SWilliam Kucharski 1284*1b8adde7SWilliam Kucharski* General usage of network support:: 1285*1b8adde7SWilliam Kucharski* Diskless:: 1286*1b8adde7SWilliam Kucharski 1287*1b8adde7SWilliam Kucharski 1288*1b8adde7SWilliam KucharskiFile: grub.info, Node: General usage of network support, Next: Diskless, Up: Network 1289*1b8adde7SWilliam Kucharski 1290*1b8adde7SWilliam KucharskiHow to set up your network 1291*1b8adde7SWilliam Kucharski========================== 1292*1b8adde7SWilliam Kucharski 1293*1b8adde7SWilliam Kucharski GRUB requires a file server and optionally a server that will assign 1294*1b8adde7SWilliam Kucharskian IP address to the machine on which GRUB is running. For the former, 1295*1b8adde7SWilliam Kucharskionly TFTP is supported at the moment. The latter is either BOOTP, DHCP 1296*1b8adde7SWilliam Kucharskior a RARP server(1) (*note General usage of network 1297*1b8adde7SWilliam Kucharskisupport-Footnote-1::). It is not necessary to run both the servers on 1298*1b8adde7SWilliam Kucharskione computer. How to configure these servers is beyond the scope of this 1299*1b8adde7SWilliam Kucharskidocument, so please refer to the manuals specific to those 1300*1b8adde7SWilliam Kucharskiprotocols/servers. 1301*1b8adde7SWilliam Kucharski 1302*1b8adde7SWilliam Kucharski If you decided to use a server to assign an IP address, set up the 1303*1b8adde7SWilliam Kucharskiserver and run `bootp' (*note bootp::), `dhcp' (*note dhcp::) or `rarp' 1304*1b8adde7SWilliam Kucharski(*note rarp::) for BOOTP, DHCP or RARP, respectively. Each command will 1305*1b8adde7SWilliam Kucharskishow an assigned IP address, a netmask, an IP address for your TFTP 1306*1b8adde7SWilliam Kucharskiserver and a gateway. If any of the addresses is wrong or it causes an 1307*1b8adde7SWilliam Kucharskierror, probably the configuration of your servers isn't set up properly. 1308*1b8adde7SWilliam Kucharski 1309*1b8adde7SWilliam Kucharski Otherwise, run `ifconfig', like this: 1310*1b8adde7SWilliam Kucharski 1311*1b8adde7SWilliam Kucharski grub> ifconfig --address=192.168.110.23 --server=192.168.110.14 1312*1b8adde7SWilliam Kucharski 1313*1b8adde7SWilliam Kucharski You can also use `ifconfig' in conjuction with `bootp', `dhcp' or 1314*1b8adde7SWilliam Kucharski`rarp' (e.g. to reassign the server address manually). *Note 1315*1b8adde7SWilliam Kucharskiifconfig::, for more details. 1316*1b8adde7SWilliam Kucharski 1317*1b8adde7SWilliam Kucharski Finally, download your OS images from your network. The network can 1318*1b8adde7SWilliam Kucharskibe accessed using the network drive `(nd)'. Everything else is very 1319*1b8adde7SWilliam Kucharskisimilar to the normal instructions (*note Booting::). 1320*1b8adde7SWilliam Kucharski 1321*1b8adde7SWilliam Kucharski Here is an example: 1322*1b8adde7SWilliam Kucharski 1323*1b8adde7SWilliam Kucharski grub> bootp 1324*1b8adde7SWilliam Kucharski Probing... [NE*000] 1325*1b8adde7SWilliam Kucharski NE2000 base ... 1326*1b8adde7SWilliam Kucharski Address: 192.168.110.23 Netmask: 255.255.255.0 1327*1b8adde7SWilliam Kucharski Server: 192.168.110.14 Gateway: 192.168.110.1 1328*1b8adde7SWilliam Kucharski 1329*1b8adde7SWilliam Kucharski grub> root (nd) 1330*1b8adde7SWilliam Kucharski grub> kernel /tftproot/gnumach.gz root=sd0s1 1331*1b8adde7SWilliam Kucharski grub> module /tftproot/serverboot.gz 1332*1b8adde7SWilliam Kucharski grub> boot 1333*1b8adde7SWilliam Kucharski 1334*1b8adde7SWilliam Kucharski 1335*1b8adde7SWilliam KucharskiFile: grub.info, Node: General usage of network support-Footnotes, Up: General usage of network support 1336*1b8adde7SWilliam Kucharski 1337*1b8adde7SWilliam Kucharski (1) RARP is not advised, since it cannot serve much information 1338*1b8adde7SWilliam Kucharski 1339