查看: 10153|回复: 25

[技术] 优盘实现 EFI+MBR多重启动的粗浅思路

[复制链接]
quya 发表于 2014-4-28 14:39 | 显示全部楼层 |阅读模式
快御云安全
本帖最后由 cjy__05 于 2014-7-21 13:13 编辑

本文根据前文 抛砖引玉:优盘EFI Shell 安装系统及脚本的应用 引申而来


目的:优盘能传统启动, 能EFI启动win8, win7, PE

准备阶段: 以一个32G优盘为例,我将之分为4个分区,第一个分区20G, 格式EXFAT, 用来储存日常数据或者ISO安装盘, 第2,3个分区,NTFS格式,每个分区4-5G,将win7,win8 iso原安装盘分别解压至此, 最后一个分区500-700mb, fat32格式, 用来存放PE和EFI Shell 启动文件。分区软件可用cfadisk驱动,因为安装之后能看到优盘所有分区,便于编辑。完成之后保留或者卸载这个驱动都可以。

传统启动实现办法: 用bootice写入grubdos至第4分区, 并将第四分区激活,因为大多数PE合盘采用的是grubdos启动 (如果不是,请根据PE采用不同的启动办法), 然后将你喜欢的PE ISO盘解压至该盘。

EFI启动办法:先将EFI Shell文件 (你可以下载我的附件,里边包含了脚本)拷贝至fat分区 \efi\boot 目录, 如果该目录有原来的PE文件, 覆盖即可。再将bootmgfw.efi (我想这个文件只是调用 efi\microsoft\boot\bcd )分别拷贝至2-4个分区的根目录, 分别改名 win8.efi, win7.efi, pe.efi即可。

脚本内容如下:

Startup.nsh 类似于dos的autoexec, 能自动执行


echo -off

for %i in fs0 fs1 fs2 fs3 fs4 fs5 fs6 fs7 fs8 fs9 fsa fsb fsc
if exist %i:\efi\boot\ntfs.efi then
%i:
goto loadntfs
endif
endfor

:loadntfs

load \efi\boot\ntfs.efi

cls

echo 1- Installation of Windows 8
echo 2- Installation of Windows 7
echo 3- Windows PE


Echo Enter choice and press Enter


1.nsh 启动安装win8的脚本,其他2个类似, 因EFI Shell 无用户输入等命令,所以只能用这种类似的但实际上只是调用另一个脚本的办法来实现。


echo -off

for %i in blk0 blk1 blk2 blk3 blk4 blk5 blk6 blk7 blk8 blk9 blka blkb blkc blkd blke blkf blkg
if exist %i:\win8.efi then
%i:
goto act
endif
endfor

:act

win8


几点说明:


1. 上边提到的某些文件的安放目录其实可以随意的, 只是需要修改脚本。

2. cfadisk驱动只对本机有效, 在其他机器只能看到优盘的第一个分区。

3. 我下载了无忧论坛的2个pe(无垠和HPY),运行不是太好, 原因未知。 2个pe都能在传统模式下出启动菜单,但都无法启动xp, 2003 pe, 无垠的PE能启动win8 64 位PE, 无32位, HPY PE能启动32位win8 pe, 却无法启动64位的。而在EFI Shell下, 似乎出loading 画面之后都无法启动, 也许无垠的能启动, 但我忘记了。因为win8,win7 安装盘都能启动, 我只能认为PE的兼容性有问题, 如果2位PE制作者能看到本文, 希望研究一下这个问题, 谢谢。 本人对PE是一窍不通的。

4. 如果将2-3分区格式化成fat32, 那么在bios启动之时按F12 选择启动之时, 就会出现多个UEFI的启动, 分别代表win8,win7, PE, 只是名称都一样,你得记住正确的顺序, 而且默认启动的都是\efi\boot\下的bootx64.efi,不一定是你希望的,当然如果你习惯这样, 不用脚本也是可以的。

EFI boot.zip (285.57 KB, 下载次数: 73)

评分

1

查看全部评分

FaiKee 发表于 2014-4-28 15:07 | 显示全部楼层
LZ: 既然你需要一個U盤製作這麼多分區存放不同安裝文件, 我的想法是為何不乾脆安裝Clover引導?

评分

1

查看全部评分

回复

使用道具 举报

ivyboy 发表于 2014-4-28 15:09 | 显示全部楼层
折腾吧。。。。折腾
回复

使用道具 举报

quya  楼主| 发表于 2014-4-28 15:20 | 显示全部楼层
FaiKee 发表于 2014-4-28 15:07
LZ: 既然你需要一個U盤製作這麼多分區存放不同安裝文件, 我的想法是為何不乾脆安裝Clover引導?

谢谢你介绍clover引导, 本人孤陋寡闻, 之前从未听说过此类软件, 所以只能diy。

今日稍微去看了下clover, 发现clover与很多主板兼容性不好,所以也不想学了, 再者本人也是比较懒的, clover太复杂, 我年纪大了, 领悟力有限, 不好意思。

你的某些文章我也看过, 思路不错, 比我强多了。 我只适合搞点小打小闹, 太复杂的, 比如PE, grubdos我都不懂的, 直接拿来就用倒是会的。
回复

使用道具 举报

FaiKee 发表于 2014-4-28 15:42 | 显示全部楼层
quya 发表于 2014-4-28 15:20
谢谢你介绍clover引导, 本人孤陋寡闻, 之前从未听说过此类软件, 所以只能diy。

今日稍微去看了下cl ...

說來慚愧, 我也沒有用這東西(沒需要), 只是知到有這東西. 呵呵!!
回复

使用道具 举报

vke652 发表于 2014-4-28 15:58 | 显示全部楼层
前来学习感谢分享
回复

使用道具 举报

winxpzzg 发表于 2014-4-28 17:15 | 显示全部楼层
讲解不是十分清楚,
回复

使用道具 举报

Harlay 发表于 2014-4-28 18:17 | 显示全部楼层
感谢楼主分享。
回复

使用道具 举报

rubycon 发表于 2014-4-28 19:10 | 显示全部楼层
多谢,学习了。。。。。。。
回复

使用道具 举报

shi05275 发表于 2014-4-28 19:43 | 显示全部楼层
2、3楼俩大神在谦虚呢!!
回复

使用道具 举报

humc 发表于 2014-4-28 19:52 | 显示全部楼层
这个要支持下技术文章啊!!
回复

使用道具 举报

raymai97 发表于 2014-4-28 23:36 | 显示全部楼层
好深奥,支持了
回复

使用道具 举报

flywing2016 发表于 2014-4-29 10:37 来自手机 | 显示全部楼层
shi05275 发表于 2014-4-28 19:43
2、3楼俩大神在谦虚呢!!

实在是太谦虚了。。
回复

使用道具 举报

tedrick 发表于 2014-4-29 11:08 | 显示全部楼层
mengbohao 发表于 2014-4-29 10:37
实在是太谦虚了。。

赞一个。仿佛回到了无忧。
回复

使用道具 举报

FaiKee 发表于 2014-4-29 21:05 | 显示全部楼层
話說LZ(或其他大大/小白)有無興趣折騰這玩意?

http://www.easy2boot.com/

NEW! E2B now supports UEFI multi-bootingof linux, Windows, KonBoot, etc. Also new - for Windows installs from a USB Hard Disk, a USB Helper drive is no longer required. Just make a partition image from each ISO first, by using the new MakePartImage tool in the MPI_Tool_Pack.
Please note: Easy2Boot is 'open source' - it consists of plain text batch files and open source grub4dos utilities - there is no proprietary software in Easy2Boot.
No other USB MultiBoot solution can do all of this from the same USB drive!
  • Extensive list of tested ISOs and payloads here
  • No limit to the number of different Linux, Windows Install, WinPE, etc. ISOs or other payload files
  • For most ISOs just 'Drag-and-Drop' - just copy your ISO file directly onto your E2B USB drive (MBR\CSM booting only)
  • UEFI booting of Windows Installers and Linux LiveCD payloads via a partition image (and most other things too, such as KonBoot).
  • Can use a USB Hard disk with two or more partitions and still UEFI boot (even if they are all NTFS partitions)
  • Boot almost ANY linux 'LiveCD' ISO - just copy it over! Unlike XBOOT or YUMI, you don't have to wait for Easy2Boot to be updated to support a new linux ISO distro - Easy2Boot is generic.
  • Supports Partition Image booting - make image files of any existing, bootable single-partition FAT32 or NTFS USB stick and add the files to E2B (e.g. add images of USB Flash drives made with YUMI, XBOOT, SARDU, WinSetupFromUSB, LiveUSB Creator, Rufus, USB Universal Installer, HP Utilities, etc.)
  • Install Windows XP to a system from an UNMODIFIED 32-bit XP install ISOs (any number of different ISOs) to a IDE\SATA\AHCI\RAID\SCSI system - no need to integrate special mass-storage or F6 drivers! Also works with Server 2003 ISOs (can be automated too).
  • Install directly from any number of different Windows Vista/7/8/SVR2008R2/SVR2012 install ISO files (can be automated too).
  • Boot directly from linux LiveCD ISOs with persistence - you can have all these (and more) on one Easy2Boot drive and boot them all with persistence - YLMF, Ubuntu, Fedora, StartOS, Porteus, pclinuxos, Backtrack5, kali-linux, Mint ISOs.
  • User configurable and fully documented - you can change the background wallpaper, headings and text colours, move the menu position, make your own sub-menus, make it beep when the menu loads, add your own GFXBoot menu, change menu font, use UTF-8 non-ASCII characters in the menus, define your own hotkeys, etc. etc.
  • You can use FAT32 or NTFS (and with a few limitations, an exFAT or ext2 formatted drive).
  • Because Easy2Boot is not a 'utility', you can prepare an Easy2Boot drive under Windows or linux. Once prepared, just copy over (or delete) any ISOs you like, at any time in the future.
  • Variety of example 'skins'/themes included.
回复

使用道具 举报

jgh123 发表于 2014-4-29 21:32 | 显示全部楼层
感谢分享!
回复

使用道具 举报

lovemini 发表于 2014-4-29 21:40 | 显示全部楼层
U盘量产成HDD模式,分几个区windows都认的,做成双启动都没问题
回复

使用道具 举报

cjy__05 发表于 2014-6-25 15:15 | 显示全部楼层
shi05275 发表于 2014-4-28 19:43
2、3楼俩大神在谦虚呢!!

他们就喜欢这样欺负我们
回复

使用道具 举报

zoujie8503 发表于 2014-6-26 21:26 | 显示全部楼层
楼主你方法太繁琐了,https://bbs.pcbeta.com/viewthread-1390315-1-1.html 之前发的帖子 应该会很简单的实现你需要的功能
回复

使用道具 举报

quya  楼主| 发表于 2014-6-26 22:46 | 显示全部楼层
zoujie8503 发表于 2014-6-26 21:26
楼主你方法太繁琐了,https://bbs.pcbeta.com/viewthread-1390315-1-1.html 之前发的帖子 应该会很简单的实现 ...

确实我的方法繁琐了些, 但文章发表之后1-2天之后我就找到了更简单的办法, 比你应用的文章更简单。

之所以我没继续在远景发,因为这儿大多数人看问题只看表面,不考虑各种办法可以应用在不同的场合。

你如有兴趣, 可搜索我在无忧的贴文, 无需什么量化优盘这种办法。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋手机版联系我们

Copyright © 2005-2025 PCBeta. All rights reserved.

Powered by Discuz!  CDN加速及安全服务由「快御」提供

请勿发布违反中华人民共和国法律法规的言论,会员观点不代表远景论坛官方立场。

远景在线 ( 苏ICP备17027154号 )|远景论坛 |Win11论坛 |Win10论坛 |Win8论坛 |Win7论坛 |WP论坛 |Office论坛

GMT+8, 2025-3-1 10:48

快速回复 返回顶部 返回列表