USB系统维护盘制作

方法一:USB仅分为一个分区,使用bootloader(例如Syslinux或GRUB);方法二:在你的USB设备上建立包含多个引导扇区的分区.
下面举例以建立一个多重引导的USB工具盘,它带有的操作系统或工具有:BarPE,Linux(选用DSL ,PuppyGparted- -Gnome多功能分区工具),winpe2.0,win98和memtest86的软盘引导镜像文件.制作完成的工具盘大小约为312M大小.
注:确保你的主板支持USB启动.当你依照这篇说明制作好一个USB工具盘无法工作时,你可以参阅以下链接地址:
http://www.pcw.co.uk/articles/print/2152896
方法一: 使用Syslinux做为开机引导
step1:下载

  1. HPUSBFW.EXE (惠普USB格式化工具)
  2. syslinux
  3. w2k3 service pack 1 (如果有用BartPE)
  4. 其它OS或工具(winPE , BartPE等)

setp2a:测试你的主板是否支持USB设备启动--这步仅为测试
先得确定一下你的bios支持从USB引导.在用惠普USB格式化工具生成一个可引导U盘时需要插入一引可引导的DOS软盘,当然你也可以用虚拟软盘镜像文件的方式.

  1. 运行HPUSBFW.EXE并点选以下选项:
  2. 设备---选择你的U盘
  3. 建立起动盘---DOS系统位于---选择软盘
  4. 开始

注:以下文件必须包含在你的U盘中:command.com, MSdos.sys ,io.sys,参阅链接:http://www.nforcershq.com/forum/viewtopic.php?p=575175
测试: 重启电脑并调整BIOS测试U盘是否可以用作启动
step 2B 格式化U盘
使用惠普USB格式化工具重新格式化:

  1. 运行HPUSBFW.EXE
  2. 设备选择为你的U盘
  3. 磁盘格式选择FAT
  4. 其它选项全部留空.

step3 安装syslinux

  1. 将下载的syslinux解压到硬盘,例如D:/temp/syslinux
  2. 运行以下命令:   d:/temp/syslinux/win32/syslinux E: (E:为USB盘符)

注:成功安装后会在你的USB的根目录下生成一个ldlinux.sys文件
step4 建立多重开机菜单和配置文件
新建menu.txt--暂不编辑
新建syslinux.cfg, 并输入以下几行:
PROMPT 1
TIMEOUT 0
DEFAULT 1
DISPLAY Menu.txt
step5 添加可引导的软盘镜像文件:

  1. 拷贝d:/temp/syslinux/memdisk目录到USB根目录
  2. 拷贝磁盘镜像文件到U盘根目录(e.g. win98.ima)
  3. 编辑menu.txt,写入以下这行:
    1.- Windows 98 boot disk
  4. 在syslinux.cfg文件中添加以下内容:
    LABEL 1
    KERNEL memdisk
    APPEND initrd=win98.ima
    • 将你选用系统或工具的可引导磁盘镜像文件,按2,3,4步骤配置到menu.txt 和syslinux.cfg文件中.
      例如: 拷贝memtest86.ima到U盘根目录下
      编辑menu.txt  加上--->  2.- Memtest86
      编辑syslinux.cfg并添加以下几行:
      LABEL 2
      KERNEL memdisk
      APPEND initrd=Memtest86.ima

step6. 添加puppy linux

  • 下载最新版的puppy linux ISO光盘镜像文件
  • 将initrd.gz, pup_2**.sfs, vmlinuz 这些文件从镜像文件中解压到USB根目录
  • 在menu.txt中添加一行 --->  3.- Linux Puppy
  • 编辑syslinux.cfg并添加以下三行:
    LABEL 3
    KERNEL vmlinuz
    APPEND root=/dev/ram0 initrd=initrd.gz PMEDIA=usbflash PKEYS=us

step7 添加DSL (Damn small linux)

  • 下载最新版本DSL Embedded.ZIP文件
  • 将KNOPPIX目录(含目录)解压到U盘根目录
  • 并将linux24和minirt24.gz文件从压缩包中解压到U盘根目录
  • 在menu.txt中添加一行 ---> 4.- Damn Small Linux
  • 编辑syslinux.cfg并添加以下三行:
    LABEL 4
    KERNEL linux24
    APPEND ramdisk_size=100000 init=/etc/init lang=us apm=power-off vga=791 initrd=minirt24.gz nomce noapic qemu quiet BOOT_IMAGE=knoppix frugal

step8 添加 Gparted

  • 下载最新gparted liveusb .ZIP
  • 将下好的文件解压到一个临时文件中
  • 重命名initrd.gz为gpinitrd.gz(避免与puppy linux的initrd重名)
  • 将gpinitrd.gz, linux和 gparted这三个文件拷到U盘根目录
  • 在menu.txt中添加两行 --->
    5.- GParted
    6.- GParted (Use if RAM < 64MB)
  • 编辑syslinux.cfg文件添加以下六行:
    LABEL 5
    KERNEL linux
    APPEND noapic initrd=gpinitrd.gz root=/dev/ram0 init=/linuxrc ramdisk_size=65000

    LABEL 6
    KERNEL linux
    APPEND noapic initrd=gpinitrd.gz root=/dev/ram0 init=/linuxrc ramdisk_size=16384

step9 添加2003 sp1 BartPE
关于怎么建立BartPE镜像参照:Howto Boot A Pebuilder Iso From Ram (ISO文件),  How to create a custom WinPE 2005 SDI image ,  Help with booting .SDI images from CD(SDI文件) ,在建立镜像文件之前,切记将BartPE中的RAMDISK.SYS文件用Windows 2003 sp1的RAMDISK.SYS文件将其覆盖.

  • 将你建立好的iso或者sdi文件U盘根目录,并改名为PE.ISO (或 PE.SDI)
  • 在U盘根目录新建名为WINNT.SIF的文件
  • 如果你建的是PE.iso文件,那么在WINNT.SIF中添加以下四行:
    [SetupData]
    BootDevice = "ramdisk(0)"
    BootPath = "/i386/System32/"
    OsLoadOptions = "/noguiboot /fastdetect /minint /rdexportascd /rdpath=PE.ISO"
  • 如果是PE.SDI,在winnt.sif中写入
    [SetupData]
    BootDevice = "ramdisk(0)"
    BootPath = "/i386/System32/"
    OsLoadOptions = "/noguiboot /fastdetect /minint /rdimageoffset=36352 /rdpath=PE.SDI"
  • 将SETUPLDR.BIN文件从Windows 2003 SP1拷贝到U盘根目录,并重命名为NTLDR
  • 拷贝NTDETECT.COM到U盘根目录
  • 从pebuilder3110a中的PE2USB.BIN文件拷贝到U盘根目录,并改名为PE.bss .
  • 编辑menu.txt添加 --->  7.- Win2003 sp1 BartPE
  • 在syslinux.cfg中添加以下三行:
    LABEL 7
    KERNEL pe.bss
    APPEND -

step 9.1 添加其它的 BartPE
当需要将第二个光盘镜像文件(ISO或SDI)添加到U盘,你就需要下载一个破解版Windows2003 SP1的SETUPLDR.BIN文件.

  • 重命名破解的SETUPLDR.BIN为NTLD2并拷到U盘目录
  • 用Hex编辑NTLD2,将WINNT.SIF替换成NTLD2.SIF(需要替换9处)
  • 复制PE2USB.BIN到U盘根目录并重命名为NTLD2.bss
  • 用Hex编辑NTLD2.bss文件,将NTLDR替换为NTLD2
  • 建立一个名为NTLD2.SIF的文件----按step9中修WINNT.SIF的方法修改这个文件
    "/rdpath=PE.ISO" (或 "/rdpath=PE.SDI")  改为  "/rdpath=NTLD2.ISO" (或"rdpath=NTLD2.SDI"). 
  • 将名为NTLD2.ISO (或 NTLD2.SDI)文件复制到U盘根目录
  • 添加一行到menu.txt (e.g.  "8.- BartPE XX")
  • 编辑syslinux.cfg,添加以下内容:
    LABEL 8
    KERNEL NTLD2.bss
    APPEND -

建立的.sif文件,文件名长度为5个字符,这一规则同样也适用于SETUPLDR.BIN文件的重命名.另外,你也可以重复step 9a的步骤建立多个BartPE 的镜像.

step 10. 添加windows pe 2.0
先下载并安装Windows 自动安装工具包 (AIK)
添加WinPE要使用 pebuilder的mkbt.exe提取U盘的引导扇区记录.具体操作见window自动安装工具包指南.注意,在安装时选择忽略FAT32的文件系统,直接采用FAT.
将提取的引导磁区生成文件复制到U盘根目录,并重命名为PE2.bss

  • 按window自动安装工具包的引导生成pe2.bss
  • 复制向导生成的包含"ISO"文件的目录到U盘根目录
  • 添加menu.txt (例如  9.- WinPE 2.0)
  • 在syslinux.cfg 中添加
    LABEL 9
    KERNEL pe2.bss
    APPEND -

Finished
以上步聚生成的menu.txt文件为:
1.- Windows 98 boot disk
2.- Memtest86
3.- Linux Puppy
4.- Damn Small Linux
5.- GParted
6.- GParted (Use if RAM < 64MB)
7.- BartPE
8.- BartPE 2
9.- WinPE 2.0

生成的syslinux.cfg为:
PROMPT 1
TIMEOUT 0
DEFAULT 1
DISPLAY Menu.txt
LABEL 1
KERNEL memdisk
APPEND initrd=win98.ima

LABEL 2
KERNEL memdisk
APPEND initrd=Memtest86.ima

LABEL 3
KERNEL vmlinuz
APPEND root=/dev/ram0 initrd=initrd.gz PMEDIA=usbflash PKEYS=uk

LABEL 4
KERNEL linux24
APPEND ramdisk_size=100000 init=/etc/init lang=us apm=power-off vga=791 initrd=minirt24.gz nomce noapic qemu quiet BOOT_IMAGE=knoppix frugal

LABEL 5
KERNEL linux
APPEND noapic initrd=gpinitrd.gz root=/dev/ram0 init=/linuxrc ramdisk_size=65000

LABEL 6
KERNEL linux
APPEND noapic initrd=gpinitrd.gz root=/dev/ram0 init=/linuxrc ramdisk_size=16384

LABEL 7
KERNEL pe.bss
APPEND -

LABEL 8
KERNEL NTLD2.bss
APPEND -

LABEL 9
KERNEL pe2.bss
APPEND -

Method 1_2 - 使用 GRUB4DOS

I don't want to repeat myself too much in this section, as its very similar to the
Syslinux method above. You will need to download the latest version of GRUB4DOS - I used version 0.4.2pre11 . I previously tried using version 0.4.1 from Sourceforge, however this did not work on my USB drive - it failed to find the menu.lst configeration file.

Repeat the following steps from the Syslinux method:
Step 1
Step 2a
Step 2b
Ignore Step 3 and Step 4

To install GRUB4DOS :
* Download latest GRUB4DOS package and extract contents to a temporary location.
* Install an NT boot sector to the USB partition using Bart's mkbt.exe (mkbt.exe and bootsector pe2usb.bin are included with pebuilder) - e.g.

CODE
mkbt -x pe2usb.bin F:


Where pe2usb.bin is bootsector and F: is the partition on USB stick.

* Now create a boot.ini file on the USB stick, with the following code:

CODE
[boot loader]
timeout=10
default=C:/grldr
[operating systems]
C:/grldr="Grub4Dos"


* Copy NTDETECT.COM and NTLDR from a working Windows XP installation to the USB stick.
* Copy GRLDR from the GRUB4DOS package downloaded earlier to the USB stick.
* Create menu.lst file (using notepad) on the USB stick with following text - this is the GRUB configeration file.

CODE
color white/red black/red
default 0
timeout 10

To add bootable floppy disk images

Repeat Step 5 ,
but ignore instructions to add entries in menu.txt and syslinux.cfg. To
add Win98.ima to GRUB add the following lines to menu.lst:

CODE
title Windows 98 boot disk
find --set-root /grldr
kernel /memdisk
initrd /win98.ima


To add Memtest86.ima to GRUB add the following lines to menu.lst:

CODE
title Memtest86
find --set-root /grldr
kernel /memdisk
initrd /Memtest86.ima

To add Puppy Linux

Repeat Step 6 , but ignore instructions to add entries in menu.txt and syslinux.cfg. Add following lines to menu.lst:

CODE
title Linux Puppy
find --set-root /grldr
kernel /vmlinuz root=/dev/ram0 initrd=initrd.gz PMEDIA=usbflash PKEYS=uk
initrd /initrd.gz

To add DSL (Damn Small Linux)

Repeat Step 7 , but ignore instructions to add entries in menu.txt and syslinux.cfg. Add following lines to menu.lst:

CODE
title Damn Small Linux
find --set-root /grldr
kernel
/linux24 ramdisk_size=100000 init=/etc/init lang=us apm=power-off
vga=791 initrd=minirt24.gz nomce noapic qemu quiet BOOT_IMAGE=knoppix
frugal
initrd /minirt24.gz

To add gparted

Repeat Step 8 , but ignore instructions to add entries in menu.txt and syslinux.cfg. Add following lines to menu.lst:

CODE
title GParted
find --set-root /grldr
kernel /linux noapic initrd=gpinitrd.gz root=/dev/ram0 init=/linuxrc ramdisk_size=65000
initrd /gpinitrd.gz

title GParted (Use if RAM < 64MB)
find --set-root /grldr
kernel /linux noapic initrd=gpinitrd.gz root=/dev/ram0 init=/linuxrc ramdisk_size=16384
initrd /gpinitrd.gz

To add BartPE

Repeat Step 9 ,
but ignore instructions to copy and rename pe2usb.bin. As ntldr already
exists on the USB stick (and needs to remain there to load grldr) don't
rename setupldr.bin (from w2k3 sp1) - GRUB can chainload this file
directly. Also ignore instructions to add entries in menu.txt and
syslinux.cfg. Add following lines to menu.lst:

CODE
title BartPE
find --set-root /grldr
chainloader /setupldr.bin

To add another BartPE

Repeat Step 9a ,
but ignore instructions to copy and rename pe2usb.bin. Also ignore
instructions to add entries in menu.txt and syslinux.cfg. Add following
lines to menu.lst:

CODE
title BartPE 2
find --set-root /grldr
chainloader /ntld2

To add Windows PE 2.0

Oops! At present GRUB4DOS does not support directly chainloading bootmgr (WinPE 2.0's equivalent of setupldr.bin/ntldr). The only way to add WinPE 2.0
is to create a separate partition with bootsector (refer to method 2
below) and then chainload the partition using the following entry in
menu.lst:

CODE
title WinPE 2.0
find --set-root /sources/boot.wim
chainloader +1

Completed menu.lst :

CODE
color white/red black/red
default 0
timeout 10

title Windows 98 boot disk
find --set-root /grldr
kernel /memdisk
initrd /win98.ima

title Memtest86
find --set-root /grldr
kernel /memdisk
initrd /Memtest86.ima

title Linux Puppy
find --set-root /grldr
kernel /vmlinuz root=/dev/ram0 initrd=initrd.gz PMEDIA=usbflash PKEYS=uk
initrd /initrd.gz

title Damn Small Linux
find --set-root /grldr
kernel
/linux24 ramdisk_size=100000 init=/etc/init lang=us apm=power-off
vga=791 initrd=minirt24.gz nomce noapic qemu quiet BOOT_IMAGE=knoppix
frugal
initrd /minirt24.gz

title GParted
find --set-root /grldr
kernel /linux noapic initrd=gpinitrd.gz root=/dev/ram0 init=/linuxrc ramdisk_size=65000
initrd /gpinitrd.gz

title GParted (Use if RAM < 64MB)
find --set-root /grldr
kernel /linux noapic initrd=gpinitrd.gz root=/dev/ram0 init=/linuxrc ramdisk_size=16384
initrd /gpinitrd.gz

title BartPE
find --set-root /grldr
chainloader /setupldr.bin

title BartPE 2
find --set-root /grldr
chainloader /ntld2

title WinPE 2.0
find --set-root /sources/boot.wim
chainloader +1

So
why bother with GRUB if Syslinux works? IMHO there are advantages and
disadvantages to each. I've personaly found Syslinux to be more stable
and user friendly than GRUB, however as USB sticks get bigger we will
eventually run into problems as, according to the documentation ...SYSLINUX is unsafe to use on any filesystem that extends past cylinder 1024... .

GRUB
has a lot of features and can boot XP/BartPE/WinPE from a non first
hard disk by remapping the drive containing the OS as 1st Hard Drive.
I've not had any stability problems since switching to version
0.4.2pre11. GRUB can also access subfolders, which will enable you
(with the correct entries in menu.lst) to clean up the root of the
drive. GRUB can also be used with method 2 to save the need to install
a boot manager to MBR (see Step 9a below).

Method 2 - Using multiple partitions 略

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值