linux引导光盘文件,linux下引导盘的制作【转】

1.mke2fs -m 0 /dev/fd0 #去掉superblock

mount /dev/fd0

mkdir -p /mnt/floppy/boot/grub

cp /boot/grub/stage1 /boot/grub/stage2   /mnt/floppy/boot/grub

umount /dev/fd0

grub

root (fd0) #you must has the space

setup (fd0)

2.clear driver mbr record

you must make a dos boot  floppy,and  has command fdisk.exe

if you boot,you can use:

fdisk/mbr

to clear mbr record

3.how to install grub into mbr and boot your linux os

if you have a linux os at harddriver  1 ,partition 2,filesystem is ext2

then you will use grub floppy boot enter the grub bash environment:

root (hd0,1)

setup (hd0)

4.from grub floppy,direct to your os.

root ( hd0,1)

kernel /boot/vmlinuz-2.4.20-8 ro root=LABEL=/

initrd  /boot/initrd-2.4.20-8.img

boot

up is the redhat 9.0's example.and after you boot,you can enter RH9

Linux下引导盘一般有两种

一种就是系统启动盘或安装盘

制作步骤为:

DOS或Windows下创建启动盘

进入DOS环境,将Linux安装光盘第一张插入光驱(假设光驱设为E:盘),然后插入格式化过的软盘,执行以下命令:

C:> E:

E:> cd dosutils

E:dosutils> rawrite

Enter disk image source file name: e:imagesoot.img

Enter target diskette drive: a:

Please insert a formatted diskette into drive A: and press --ENTER-- :

E:dosutils>

再一种就是GRUB的引导盘

要制作引导盘,需执行一些简单的步骤。

首先,在新的软盘上创建 ext2 文件系统。然后,将其安装,并将一些 GRUB 文件复制到该文件系统,最后运行 "grub" 程序,它将负责设置软盘的引导扇区。准备好了吗?

制作引导盘,第二部分

好,将一张空盘插入 1.44MB 软驱,输入:

# mke2fs /dev/fd0

创建了 ext2 文件系统后,需要安装该文件系统:

# mount /dev/fd0 /mnt/floppy

现在,需要创建一些目录,并将一些关键文件(原先安装 GRUB 时已安装了这些文件)复制到软盘:

# mkdir /mnt/floppy/boot

# mkdir /mnt/floppy/boot/grub

# cp /usr/share/grub/i386-pc/stage1 /mnt/floppy/boot/grub

# cp /usr/share/grub/i386-pc/stage2 /mnt/floppy/boot/grub

只需要再有一个步骤,就能得到可用的引导盘。

制作引导盘,第三部分

解压、编译和安装 GRUB 源 tar压缩包时,会将程序 grub 放到 /usr/sbin 中。该程序非常有趣并值得注意,因为它实际上是

GRUB 引导装入器的半功能性版本。是的,尽管 Linux 已经启动并正在运行,您仍可以运行 GRUB 并执行某些任务,而且其界面与使用

GRUB 引导盘或将 GRUB 安装到硬盘 MBR 时看到的界面完全相同。

这是有趣的设计策略,现在该使用驻留版本的 GRUB 来设置引导盘的引导扇区了。从 root 用户,输入 "grub"。GRUB 控制台将启动,显示如下:

GRUB version 0.5.96.1 (640K lower / 3072K upper memory)

[ Minimal BASH-like line editing is supported. For the first word, TAB

lists possible command completions. Anywhere else TAB lists the possible

completions of a device/filename. ]

grub>

欢迎使用 GRUB 控制台。现在,研究命令。

制作引导盘,第四部分

在 grub> 提示符处,输入:

grub> root (fd0)

grub> setup (fd0)

grub> quit

现在,引导盘完成了。在继续下一步骤之前,在看一下刚才输入的命令。第一个 "root" 命令告诉 GRUB 到哪里查找辅助文件

stage1 和 stage2。缺省情况下,GRUB 会在指定的分区或磁盘上的 /boot/grub

目录中进行查找。在安装引导盘时,也就是几分钟以前,我们已将这些文件复制到正确的位置。接着,输入了 setup 命令,它告诉 GRUB

将引导装入器安装到软盘的引导记录上;我们将在以后详细讨论这一过程。然后退出。现在,已经制作好引导盘,可以开始使用 GRUB 了。

或是用更简单的方法制作grub的引导盘,简单的12步就够了

(1)mkfs.ext2 /dev/fd0

(2)dd if=/boot/grub/stage1 of=/dev/fd0 bs=512 count=1

(3)dd if=/boot/grub/stage2 of=/dev/fd0 bs=512 seek=1

(4)mkfs.ext2 /dev/fd0

(5)mount /dev/fd0 /mnt/floppy

(6)mkdir /mnt/floppy/boot/grub -p

(7)cp /boot/grub/stage1 /boot/grub/stage2 /mnt/floppy/boot/grub

(8)umount /mnt/floppy

(9)grub (此后换了一种界面,也是要命令行的,但是grub自己命令行的)

(10)root (fd0)

(11)setup (fd0)

(12)quit

还有一种就是lilo 的启动盘,下面是制作步骤:

mount /dev/fd0 /mnt

如果不行, 试试加上 -t ext2 ( for redhat ) -t minix ( for slackware ?? not so

sure ), 总之是要 mount 上去

下面拷贝自己的编译的核心到软盘上去,

cp /usr/src/linux/arch/i386/boot/zImage /mnt/vmlinuz

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  ^^^^^^^^^^

你编译的内核所在的路径     你的启动盘的启动的核心所在路径

接着指定启动的设备,

rdev /mnt/vmlinuz /dev/fd0

^^^^^^^

从软驱启动

再下来修改你软盘上的 lilo.conf 以适合你的要求

vi /mnt/etc/lilo.conf

最后,运行 lilo

lilo -r /mnt

卸下软盘, 下次就可以从这张软盘上启动你的 linux 了

umount /dev/fd0

如果你的 linux 版本比较旧, 那么在运行 redv /mnt/vmlinuz /dev/fd0 后还要运行

rdev /mnt/vmlinuz /dev/fd0H1440

rdev -r /mnt/vmlinuz 1440

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值