GRUB version 1
The computer’s boot process begins with a program called boot loader. The purpose of this program is to load an operating system or some other software for the computer after completion of the self-tests. In Linux, the most-used boot loader is the Grand Unified Boot Loader (GRUB), available in two versions: GRUB version 1 (also known as GRUB Legacy) and GRUB version 2. GRUB Legacy is older of the two boot loaders. It used to be the dominant boot loader for Linux, but it’s been largely replaced by GRUB 2.
GRUB Legacy configuration
The configuration file is located at /boot/grub/menu.lst (some distributions such as Fedora, Red Hat, and Gentoo use the filename grub.conf). Here is an example menu.lst file:
GRUB numbers the disk drives different than Linux does. Instead of /dev/hda or /dev/sda , GRUB uses hd0. Similarly, /dev/hdb or /dev/sdb is likely to be hd1. GRUB doesn’t distinguish between PATA, SATA, SCSI, and USB drives, so on a SCSI-only system, the first SCSI drive is hd0. GRUB Legacy’s drive mappings are stored in the /boot/grub/device.map file:
Additionally, GRUB Legacy numbers partitions on a drive starting at 0, instead of 1 that is used by Linux. GRUB Legacy separates partition numbers from drive numbers with a comma, as in (hd0,0) for the first partition on the first disk (normally Linux’s /dev/sda1).
GRUB Legacy also defines its own root partition, which can be different from the Linux root partition. GRUB’s root partition is the partition in which GRUB’s configuration file (menu.lst or grub.conf) resides. Because this file is normally in Linux’s /boot/grub/ directory, the GRUB root partition will be the same as Linux’s root partition if you do not use a separate /boot or /boot/grub partition.
Here is a brief description of the configuration options found in the GRUB Legacy’s configuration file:
default – tells GRUB which OS to boot. GRUB indexes from 0, so the 0 option means that the first OS will be booted.
timeout – defines how long, in seconds, to wait for user input before booting the default operating system.
splashimage – defines the picture that’s displayed as the background for the boot process.
The options listed above are the global GRUB options. The following options are per-image options:
title – the name that appears on the boot screen to represent the OS.
root – specifies the location of GRUB Legacy’s root partition. This is the /boot partition if a separate one exists; otherwise, it’s usually the Linux root (/) partition.
kernel – specifies the location of the Linux kernel and kernel options that are to be passed to it. Paths are relative to GRUB Legacy’s root partition. The root option specifies the Linux root filesystem.
initrd – specifies an initial RAM disk, which holds a minimal set of drivers, utilities, and configuration files that the kernel uses to mount its root filesystem before the kernel can fully access the hard disk.
rootnoverify – is similar to the root option except that GRUB Legacy won’t try to access files on this partition. It’s used to specify a boot partition for OSs for which GRUB Legacy can’t directly load a kernel, such as DOS and Windows.
chainloader – tells GRUB Legacy to pass control to another boot loader.
Linux course
- Overview
- What is Linux?
- Differences between Linux and Windows
- Differences between Unix and Linux
- Linux distributions
- Linux kernel
- File structure in Linux
- Filesystem Hierarchy Standard (FHS)
- Installation
- Change the boot order in BIOS
- Install Ubuntu
- Install CentOS on VMware Player
- Login to Ubuntu
- Shell
- The shell in Linux
- Bourne-again shell (Bash)
- Start the shell in Ubuntu
- Essential Linux commands
- Command line history
- Manual pages
- info command
- Manage directories
- Manage files
- Environment variables
- Common environment variables
- PATH environment variable
- Inode
- Links
- Hard links
- Symbolic links
- Wildcard
- Streams
- Redirect input and output
- Pipe data between programs
- Sort lines of a text file
- Search for text strings using grep
- Search for files using find
- Search for files using locate
- Count lines in a file
- Determine file type
- whereis command
- Display last lines of a text file
- Display first lines of a text file
- Split the output of a program
- Editing text
- Text editors
- gedit text editor
- KWrite text editor
- Pico text editor
- nano text editor
- less text viewer
- Managing processes
- What is a process?
- List all running processes
- top command
- Kill a process in Linux
- Kill a process by name
- Change process priority
- Background and foreground processes
- jobs command
- Install applications
- Package managers
- RPM Package Manager
- yum package manager
- Debian package manager
- Advanced Packaging Tool (APT)
- apt-cache command
- apt-get command
- dselect
- aptitude
- Synaptic Package Manager
- tar (tape archive) program
- cpio program
- Convert between packages
- Manage users
- root account
- Create users
- Delete users
- Modify users
- Manage passwords
- /etc/passwd file format
- /etc/shadow file format
- Change passwords
- Manage groups
- Linux groups
- Create groups
- Delete groups
- Modify groups
- /etc/group file format
- Administer groups
- Customize a user's work environment
- Permissions
- UID (User Identifier) and GID (Group Identifier)
- Manage file ownership
- Change file ownership
- Permissions basics
- Permission bits
- Identify file type
- Modify file permissions
- Set the default permissions for newly created files
- Change file attributes
- Manage hardware
- proc filesystem (procfs)
- IRQ (Interrupt Request)
- I/O ports
- DMA (Direct Memory Access)
- Kernel modules
- Load kernel modules
- Remove kernel modules
- Identify CPU
- Find out more information about your system
- Display information about USB devices
- Boot Linux
- GRUB version 1
- GRUB version 2
- Alternative boot loaders
- dmesg command
- Runlevels
- /etc/inittab
- Change runlevel
- Network protocols
- What is an IP address?
- What is a MAC address?
- What is DHCP?
- What is DNS?
- Basic networking
- ifconfig command
- Configure a static IP address in Ubuntu
- Configure DHCP client on Ubuntu
- Configure DNS settings
- /etc/hosts file
- Configure hostname
- Network tools
- ping command
- traceroute command
- host command
- dig command
- nslookup command
- netstat command
- tcpdump command
- whois command
- IP forwarding
- Overview of file systems
- File system
- ext2fs
- ext3fs
- ext4fs
- Reiser file system
- XFS file system
- JFS file system
- FAT file system
- NTFS file system
- ISO-9660 file system
- Disk partitioning
- What is partitioning?
- Swap partition
- Hard disk interfaces
- MBR partitions
- GPT partitions
- Configure hard disks
- fdisk utility
- GNU Parted utility
- Create a file system
- Mount a file system
- /etc/fstab file
- Mount a USB device
- Check disk space
- Check file disk usage
- Check file systems
- Obtain file system information
- Adjust file system parameters
- Debug a file system
- Configure disk quotas
- Disk quotas
- Enable quota support
- Set quotas
- Disk quota reporting
- Logging
- syslog protocol explained
- syslogd
- rsyslog
- Create a log entry
- Rotate logs
- Common log files
- /var/log/messages file
- Schedule jobs
- Schedule jobs with cron
- User cron jobs
- Schedule jobs with anacron
- Schedule jobs with at
- Date and time
- date and hwclock commands
- Network Time Protocol (NTP)
- Configure NTP client
- Configure NTP server
- Email protocols
- Mail server
- Read and send mail
- Redirect email
- Shell scripting
- Shell scripts
- Create shell scripts
- Write shell scripts
- if statement
- case statement
- for loop
- while loop
- until loop
- Miscellaneous
- Show the full path of shell commands
- Remove duplicate lines from a text file
- Join lines of two files
- Merge files line by line
- Convert tabs to spaces
- Prepare a file for printing
- Split a file into two or more files
- Archive a filesystem
- Filter text
- Shut down the system
- Halt, reboot, and power off the system
- Create aliases
- Octal dump
- Number lines in a file
- Measure time of program execution
- Change characters
- Reformat paragraphs
- type command