GRUB Commands

GRUB has a powerful command line option.  All you have to do to start the command line is to use the command grub.

 

Lesson 2 | Lesson 4

You can see a list of the possible commands by using the help.

grub> help
blocklist FILE                         boot
cat FILE                               chainloader [--force] FILE
clear                                  color NORMAL [HIGHLIGHT]
configfile FILE                        device DRIVE DEVICE
displayapm                             displaymem
find FILENAME                          geometry DRIVE [CYLINDER HEAD SECTOR [
halt [--no-apm]                        help [--all] [PATTERN ...]
hide PARTITION                         initrd FILE [ARG ...]
kernel [--no-mem-option] [--type=TYPE] makeactive
map TO_DRIVE FROM_DRIVE                md5crypt
module FILE [ARG ...]                  modulenounzip FILE [ARG ...]
pager [FLAG]                           partnew PART TYPE START LEN
parttype PART TYPE                     quit
reboot                                 root [DEVICE [HDBIAS]]
rootnoverify [DEVICE [HDBIAS]]         serial [--unit=UNIT] [--port=PORT] [--
setkey [TO_KEY FROM_KEY]               setup [--prefix=DIR] [--stage2=STAGE2_
terminal [--dumb] [--no-echo] [--no-ed terminfo [--name=NAME --cursor-address
testvbe MODE                           unhide PARTITION
uppermem KBYTES                        vbeprobe [MODE]



The displaymem command will show you what GRUB thinks is the system address space map of the machine.  The lower memory is the address space in the first megabyte of memory.

grub> displaymem
EISA Memory BIOS Interface is present
Address Map BIOS Interface is present
Lower memory: 640K, Upper memory (to first chipset hole): 3072K
[Address Range Descriptor entries immediately follow (values are 64-bit)]
Usable RAM:  Base Address:  0x0 X 4GB + 0x0,
Length:   0x0 X 4GB + 0xa0000 bytes
Reserved:  Base Address:  0x0 X 4GB + 0xa0000,
Length:   0x0 X 4GB + 0x60000 bytes
Usable RAM:  Base Address:  0x0 X 4GB + 0x100000,
Length:   0x0 X 4GB + 0x300000 bytes


grub> find /sbin/init
(hd0,1)

enter find ( and then tab

grub> find (hd0,

Use the tab

grub> find (hd0,
Possible partitions are:
Partition num: 0,  Filesystem type is ext2fs, partition type 0x83
Partition num: 1,  Filesystem type is ext2fs, partition type 0x83
Partition num: 2,  Filesystem type is ext2fs, partition type 0x83
Partition num: 4,  Filesystem type unknown, partition type 0x8e
Partition num: 5,  Filesystem type unknown, partition type 0x8e

Disk /dev/hda: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot      Start         End      Blocks   Id  System
/dev/hda1   *           1          13      104391   83  Linux
/dev/hda2              14         523     4096575   83  Linux
/dev/hda3             524         650     1020127+  83  Linux
/dev/hda4             651        1044     3164805    5  Extended
/dev/hda5             651         663      104391   8e  Linux LVM
/dev/hda6             664         676      104391   8e  Linux LVM

grub> find /grub/menu.lst
(hd0,0)



grub> find /sbin/init
(hd0,1)