linux下引導盤的制作【轉】

發表于:2007-05-26來源:作者:點擊數: 標簽:
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
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 控制臺?,F在,研究命令?!?
制作引導盤,第四部分 
在 grub> 提示符處,輸入: 
grub> root (fd0) 
grub> setup (fd0) 
grub> quit 
現在,引導盤完成了。在繼續下一步驟之前,在看一下剛才輸入的命令。第一個 "root" 命令告訴 GRUB 到哪里查找輔助文件 stage1 和 stage2。缺省情況下,GRUB 會在指定的分區或磁盤上的 /boot/grub 目錄中進行查找。在安裝引導盤時,也就是幾分鐘以前,我們已將這些文件復制到正確的位置。接著,輸入了 setup 命令,它告訴 GRUB 將引導裝入器安裝到軟盤的引導記錄上;我們將在以后詳細討論這一過程。然后退出?,F在,已經制作好引導盤,可以開始使用 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

原文轉自:http://www.anti-gravitydesign.com

国产97人人超碰caoprom_尤物国产在线一区手机播放_精品国产一区二区三_色天使久久综合给合久久97