版权声明:可以任意转载,转载时请务必以超链接形式标明文章原始出处和作者信息及本声明。
https://windtear.net/archives/2004/06/23/000248.html
其实就是安装一下 grub 纯粹骗文章数啊 呵呵
grub 全称 GRand Unified Bootloader 目前在大多发行版中已经取代了 LILO
lilo 以前的版本存在1024柱面限制 也就是著名的8.4G问题 ( # echo 1024*16*512 | bc -l 8388608 ) 而且 lilo 每次更新必须运行一下 lilo 更新引导区
相比之下 GURB 要强大的多 grub 可以在系统引导前 提示符下进行很多操作了 比如 pxe 启动进行系统安装 多么神奇啊 比如 查看特定文件信息 ...
grub 启动菜单 会提示 e 编辑启动参数 c 进入 提示符 编辑完毕 b 启动 ... 如果加了密码限制 可以首先 p 输入密码 然后根据需要输入 e c 等
grub> help 可以看的 grub 支持的命令和功能
Debian 默认采用的 LILO 作为系统引导 安装过程也无法选择 GRUB 进入系统后 可以很简单的进行安装
windteardebian:/# apt-get install grub Reading Package Lists... Done Building Dependency Tree... Done The following NEW packages will be installed: grub 0 packages upgraded, 1 newly installed, 0 to remove and 0 not upgraded. Need to get 247kB of archives. After unpacking 504kB will be used. Get:1 ftp://166.111.8.229 stable/main grub 0.91-2 [247kB] Fetched 247kB in 0s (587kB/s) Selecting previously deselected package grub. (Reading database ... 49503 files and directories currently installed.) Unpacking grub (from .../archives/grub_0.91-2_i386.deb) ... Setting up grub (0.91-2) ...
windteardebian:/# apt-cache show grub Package: grub Priority: optional Section: admin Installed-Size: 492 Maintainer: Jason Thomas <jason@debian.org> Architecture: i386 Version: 0.91-2 Depends: libc6 (>= 2.2.4-4), libncurses5 (>= 5.2.20020112a-1) Suggests: grub-doc Filename: pool/main/g/grub/grub_0.91-2_i386.deb Size: 246806 MD5sum: e1f90d12d23b89205acf457ab7913e94 Description: GRand Unified Bootloader GRUB is a GPLed bootloader intended to unify bootloading across x86 operating systems. In addition to loading the Linux kernel, it implements the Multiboot standard, which allows for flexible loading of multiple boot images (needed for modular kernels such as the GNU Hurd).
windteardebian:/# grub-install --help Usage: grub-install [OPTION] install_device Install GRUB on your drive.
-h, --help print this message and exit -v, --version print the version information and exit --root-directory=DIR install GRUB images under the directory DIR instead of the root directory --grub-shell=FILE use FILE as the grub shell --force-lba force GRUB to use LBA mode even for a buggy BIOS --recheck probe a device map even if it already exists
INSTALL_DEVICE can be a GRUB device name or a system device filename.
grub-install copies GRUB images into the DIR/boot directory specfied by --root-directory, and uses the grub shell to install grub into the boot sector.
Report bugs to <bug-grub@gnu.org>.
windteardebian:/# grub-install /dev/hda Probing devices to guess BIOS drives. This may take a long time. 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'.
(fd0) /dev/fd0 (hd0) /dev/hda
windteardebian:/boot/grub# update-grub Searching for GRUB installation directory ... found: /boot/grub . Testing for an existing GRUB menu.list file...
Could not find /boot/grub/menu.lst file. Would you like one generated for you? (y/N) y Updating /boot/grub/menu.lst ... done
Please note that configuration parameters for GRUB are stored in /boot/grub/menu.lst . You must edit this file in order to set the options which GRUB passes to the kernel, as well as the drive which GRUB looks in to for the kernel.
Everything on the line after "kopt=" is passed to the kernel as parameters, and "groot=" must be set to the partition(in GRUB terms, such as "(hd0,0)") which GRUB will load the kernel from.
After you have edited /boot/grub/menu.lst , please re-run 'update-grub'.
windteardebian:/boot/grub# cat /boot/grub/menu.lst ## default num # Set the default entry to the entry number NUM. Numbering starts from 0, and # the entry number 0 is the default if the command is not used. # # You can specify 'saved' instead of a number. In this case, the default entry # is the entry saved with the command 'savedefault'. default 0
## timeout sec # Set a timeout, in SEC seconds, before automatically booting the default entry # (normally the first entry defined). timeout 5
# Pretty colours color cyan/blue white/blue
## password ['--md5'] passwd # If used in the first section of a menu file, disable all interactive editing # control (menu entry editor and command-line) and entries protected by the # command 'lock' # e.g. password topsecret # password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/ # password topsecret
# # examples # # title Windows 95/98/NT/2000 # root (hd0,0) # makeactive # chainloader +1 # # title Linux # root (hd0,1) # kernel /vmlinuz root=/dev/hda2 ro #
### BEGIN AUTOMAGIC KERNELS LIST ## lines between the AUTOMAGIC KERNELS LIST markers will be modified ## by the debian update-grub script except for the default optons below
## DO NOT UNCOMMENT THEM, Just edit them to your needs
## ## Start Default Options ## ## default kernel options ## e.g. kopt=root=/dev/hda1 ro # kopt=root=/dev/hda1 ro
## default grub root device ## e.g. groot=(hd0,0) # groot=(hd0,0)
## should update-grub create alternative boot options ## e.g. alternative=true ## alternative=false # alternative=true
## should update-grub lock alternative boot options ## e.g. lockalternative=true ## lockalternative=false # lockalternative=false
## altoption boot targets option ## multiple altoptions lines are allowed ## e.g. altoptions=(extra menu suffix) extra boot options ## altoptions=(recovery mode) single # altoptions=(recovery mode) single
## controls how many kernels should be put into the menu.lst ## only counts the first occurence of a kernel, not the ## alternative kernel options ## e.g. howmany=all ## howmany=7 # howmany=all
## ## End Default Options ##
title Debian GNU/Linux, kernel 2.4.18-bf2.4 root (hd0,0) kernel /boot/vmlinuz-2.4.18-bf2.4 root=/dev/hda1 ro savedefault
title Debian GNU/Linux, kernel 2.4.18-bf2.4 (recovery mode) root (hd0,0) kernel /boot/vmlinuz-2.4.18-bf2.4 root=/dev/hda1 ro single savedefault
### END DEBIAN AUTOMAGIC KERNELS LIST
windteardebian:/boot/grub# update-grub Searching for GRUB installation directory ... found: /boot/grub . Testing for an existing GRUB menu.list file... found: /boot/grub/menu.lst . Updating /boot/grub/menu.lst ... done
windteardebian:/boot/grub#
崔剑<cuijianw at etang dot com>在其Debian日记里<http://free.cuijianw.net/debian_dairy/index.html> 还提到了安装新kernel自动update grub菜单的配置 《在Debian下安装Grub》<http://free.cuijianw.net/debian_dairy/docs/doc00001.html>
% cat /etc/kernel-img.conf postinst_hook = /sbin/update-grub postrm_hook = /sbin/update-grub do_bootloader = no
附录二: /etc/kernel-img.conf # Do not create symbolic links in / do_symlinks = yes relative_links = yes postinst_hook = /sbin/update-grub postrm_hook = /sbin/update-grub do_bootloader = no do_bootfloppy = no do_initrd = yes link_in_boot = no
|
|