- 1、menu.lst的写法之一;
++++++++++++++++++++++++++++++++++++++++++++++++++++++++
正文
++++++++++++++++++++++++++++++++++++++++++++++++++++++++
一、什么是多重操作系统引导管理器,什么是GRUB;
1、什么是多重操作系统引导管理器及工作原理;
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).
在X86 架构的机器中,Linux、BSD 或其它Unix类的操作系统中GRUB、LILO 是大家最为常用,应该说是主流;
2、什么是GRUB;为什么我要选择GRUB;
1)什么是GRUB;
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.
2)“GRUB太不好用”──对GRUB的认识的误区;
GRUB真的不好用吗?不是的,通过LinuxSir.Org 社区近四年来的运行,我发现了大多新手弟兄还是不太了解GRUB;当然这也有中文Linux社区的责任,虽然也有GRUB的中文译本,初学Linux的弟兄可能有点看不懂;
3)为什么要选择GRUB;
二、GRUB软件包版本选择和安装;
1、GRUB的版本选择,Linux版本的GRUB及Windows版本的GRUB的说明;
2、GRUB的Windows版本WINGRUB;
3、GRUB的Linux版本软件包的安装;
[root@localhost ~]# rpm -ivh grub*.rpm
[root@localhost ~]# installpkg grub*.tgz
[root@localhost ~]#tar zxvf grub*.tar.gz
[root@localhost ~]#cd grub-xxx
[root@localhost ~]#./configure;make;make install
[root@localhost ~]# grub
[root@localhost ~]# grub-install
[root@localhost ~]# /usr/sbin/grub
[root@localhost ~]# /usr/sbin/grub-install
[root@localhost ~]# updatedb 注:这个要花很长时间;是索引slocate 的库,然后再通过locate来查找;
[root@localhost ~]# locate grub
[root@localhost ~]# locate grub
/sbin/grub-md5-crypt
/sbin/grub
/sbin/grub-install
/sbin/grub-terminfo
[beinan@localhost ~]$ su - 注:切换到root用户,并且切换到其家目录;
Password:
[root@localhost ~]#/sbin/grub 注:用绝对路径来运行grub命令;
三、在Linux中,GRUB的配置中的安装和写入硬盘的MBR;
1、在Linux中,GRUB配置过程中的安装grub-install;
[root@localhost ~]# fdisk -l
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
[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'.
(fd0) /dev/fd0
(hd0) /dev/hda
[root@localhost ~]# grub-install /dev/hdb
[root@localhost ~]# grub-install /dev/hda
[root@localhost ~]#grub-install --root-directory=/boot /dev/hda
[root@localhost ~]#grub-install --root-directory=/boot /dev/hdb
2、设定GRUB的/boot分区并写入MBR;;
在Linux中,GRUB软件包的安装,及在配置过程中安装grub到 /boot中还是不够的, 还要把GRUB,写入MBR才行;有时我们重新安装了Windows,Windows会把MBR 重写,这样GRUB就消失了;如果您出现这样的情况,就要进行这个过程;
[root@localhost ~]# grub
grub> find /boot/grub/stage1
(hd0,6)
(fd0) 注:这个是软驱;现在很少用软驱了,如果您有这方面的需要,自己看GRUB的DOC吧;
(fd0) 注:这个是软驱;现在很少用软驱了,如果您有这方面的需要,自己看GRUB的DOC吧;
grub>root (hd0,6) 注:这是/boot所在的分区;
grub>setup (hd0) 注:把GRUB写到MBR上;