Briefly, boot loader is the first software program that runs when a computer starts. It is responsible for loading and transferring control to the operating system kernel software (such as the Hurd or the Linux). The kernel, in turn, initializes the rest of the operating system (e.g. GNU).
GNU GRUB 是一个多重操作系统启动管理器。GNU GRUB 是由GRUB(GRand Unified Bootloader) 派生而来。GRUB 最初由Erich Stefan Boleyn 设计和应用;
GNU GRUB is a Multiboot boot loader. It was derived from GRUB, GRand Unified Bootloader, which was originally designed and implemented by Erich Stefan Boleyn.
Disk /dev/hda: 80.0 GB, 80026361856 bytes 255 heads, 63 sectors/track, 9729 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System /dev/hda1 * 1 970 7791493+ 7 HPFS/NTFS /dev/hda2 971 9729 70356667+ 5 Extended /dev/hda5 971 2915 15623181 b W95 FAT32 /dev/hda6 2916 4131 9767488+ 83 Linux /dev/hda7 4132 5590 11719386 83 Linux /dev/hda8 5591 6806 9767488+ 83 Linux /dev/hda9 6807 9657 22900626 83 Linux /dev/hda10 9658 9729 578308+ 82 Linux swap / Solaris
如果通过fdisk -l 出现有/dev/hda字样的,我们就要用下面的命令来安装; [root@localhost ~]# grub-install /dev/hda Installation finished. No error reported. This is the contents of the device map /boot/grub/device.map. Check if this is correct or not. If any of the lines is incorrect, fix it and re-run the script `grub-install'.
只要您在grub>提示符的后面输入help 就能得到GRUB所有的命令提示; 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]
如果需要得到某个指令的帮助,就在 help 后面空一格,然后输入指令,比如; grub>help kernel
3)cat的用法;
cat 指令是用来查看文件内容的,有时我们不知道Linux的/boot分区,以及/根分区所在的位置,要查看/etc/fstab的内容来得知,这时,我们就 要用到cat (hd[0-n],y)/etc/fstab 来获得这些内容;注意要学会用tab键命令补齐的功能; grub> cat ( 按tab 键会出来hd0或hd1之类的; grub> cat (hd0, 注:输入hd0,然后再按tab键;会出来分区之类的; grub> cat (hd0,6) Possible partitions are: Partition num: 0, Filesystem type unknown, partition type 0x7 Partition num: 4, Filesystem type is fat, partition type 0xb Partition num: 5, Filesystem type is reiserfs, partition type 0x83 Partition num: 6, Filesystem type is ext2fs, partition type 0x83 Partition num: 7, Filesystem type unknown, partition type 0x83 Partition num: 8, Filesystem type is reiserfs, partition type 0x83 Partition num: 9, Filesystem type unknown, partition type 0x82