GrubHowto/BootFloppy
出自Ubuntu中文
This how to describes making a GRUB boot floppy.
如何制作GRUB引导软盘
GRUB (GRand Unified Bootloader) is the boot manager installed by default in recent versions of Ubuntu Linux. It is an effort by the GNU project to provide a bootloader that supports the greatest number of operating systems. This document explains how to make a boot floppy that can either boot an installed operating system or present you with a GRUB command shell so that you can enter commands directly. It assumes that you are making the diskette on an Ubuntu Linux box.
GRUB是Ubuntu linux默认的引导程序,由GNU项目组开发,它可以支持当前常见的大部份操作系统的引导。本文主要介绍如何将GRUB安装到一张软盘上,并且最终制作完成的引导软盘将可以启动你现在硬盘上已经安装的操作系统,你也可以通过这张软盘进入GRUB的命令操作界面,通过输入命令开启动你想使用的操作系统。本文所有操作均在Ubuntu Linux下进行。
1. Obtain root privileges.
1.执行下面的命令,获取管理员权限.
- sudo -s
answer the <password> prompt 2. Format the floppy with the ext2 filesystem:
2.将软盘格式化成ext2文件系统:
- mke2fs /dev/fd0
3. Mount the floppy and copy the files that GRUB needs to make it bootable:
3.加载软驱,复制GRUB启动所需的文件.
- mount /dev/fd0 /media/floppy mkdir /media/floppy/boot mkdir /media/floppy/boot/grub cd /boot/grub cp stage1 stage2 /media/floppy/boot/grub
If you want to boot the operating system already installed on the machine you are making the floppy from, also copy /boot/grub/menu.lst and /boot/grub/device.map to the corresponding directories on the floppy.
如果你希望可以用这张软盘启动你的电脑上现有的操作系统,请将/boot/grub/下的menu.lst、device.map两个文件复制到软盘上相应的目录里下。
4. Unmount the floppy (umount /dev/fd0), then start GRUB in interactive mode by typing grub. You will see the GRUB command prompt (grub >). Enter these commands:
4.卸载软驱(umount /dev/fd0),进入终端并启动GRUB,并进入GRUB的命令操作模式,你将看到GRUB的命令提示符(grub>),执行下面的命令:
- device (fd0) /dev/fd0 root (fd0) setup (fd0) quit
5. At this point, you have a bootable floppy. If you added the extra files mentioned above, you should get a standard GRUB screen when you boot from it, just as if you had booted from the hard drive.
5.这样,一张GRUB的引导软盘就制作完成了,如果你在第三步中将那两个文件复制到了软盘上面,那用这张软盘启动你的电脑的启动界面和你通过硬盘启动时的界面是一模一样的;
6. If you want to be extra cautious, you can save a copy of the current machine's master boot record to a file on the floppy. The following example assumes the master boot record is on device hda; the file containing the boot record is named boot.mbr.
6.为了安全起见,你也可以将当前硬盘上上的引导系统备份到一张软盘上(备份成一个文件),进行这种备份操作前提是你的GRUB是安装在了你的硬盘上。引导程序包含在一个名为boot.mbr的文件。以下为备份操作:
- dd if=/dev/hda of=/media/floppy/boot.mbr bs=512 count=1
To restore it, you would just reverse the parameters of the dd command:
当你硬盘上的引导程序出现问题时,你可以通过软盘启动,执行下面的命令来进行修复:
- dd if=/media/floppy/boot.mbr of=/dev/hda bs=512 count=1
