|
yanglongyang
新手上路

积分 6
发帖 2
注册 2008-3-22
状态 离线
|
『楼 主』:
USB-ZIP+启动U盘用Grub4DOS启动HDD和ZIP机子时的麻烦?
使用 LLM 解释/回答一下
因为有多个PE和IMG文件,所以选择了启动到DOS后用Grub.exe引导的方式。
但这时碰到了麻烦,比如启动某些机子后,盘符是C:
而另一些机子启动后盘符就是A:
这时AUTOEXEC.BAT就不那么自动了,在识别为C:的机子上可以写成:
grub --config-file=/menu.lst 就可以了,
但在只认A:盘的机器上就必须改为:
grub --config-file=(fd0)/menu.lst,否则提示找不到文件。
而且menu.lst里的项目也得改,
fontfile /grub/fonts =》 fontfile (fd0)/grub/fonts
chainloader /MTLDR =》 chainloader (fd0)/MTLDR
map --mem /grub/ar4.img (fd0)
map --hook
chainloader (fd0)+1 =》
rootnoverify (fd0)
map --mem (fd0)/grub/ghost.img (fd0)
map --hook
chainloader (fd0)+1
rootnoverify (fd0)
否则也无法引导进入菜单内的各项目。
Grub4DOS有个帮助文档介绍说:
“比如,你可以在u盘根目录建一个特征文件,如myudisk.txt
然后用下面的命令启动个项目:
find --set-root /myudisk.txt
chainloader /ldrxpe
”
我试了一下还是没成功。
这样把U盘拿到不同的机子上用会很麻烦,
有什么好的方法没有啊?
Because there are multiple PE and IMG files, the method of booting to DOS and then using Grub.exe for booting was chosen. But then there was a problem. For example, after booting some machines, the drive letter is C: while after booting others, the drive letter is A:. Then AUTOEXEC.BAT is not so automatic. On the machines where it is recognized as C:, it can be written as: grub --config-file=/menu.lst, but on the machines that only recognize A: drive, it must be changed to: grub --config-file=(fd0)/menu.lst, otherwise it prompts that the file is not found. Moreover, the items in menu.lst also need to be changed,
fontfile /grub/fonts => fontfile (fd0)/grub/fonts
chainloader /MTLDR => chainloader (fd0)/MTLDR
map --mem /grub/ar4.img (fd0)
map --hook
chainloader (fd0)+1 =>
rootnoverify (fd0)
map --mem (fd0)/grub/ghost.img (fd0)
map --hook
chainloader (fd0)+1
rootnoverify (fd0)
Otherwise, it cannot boot into the items in the menu.
The Grub4DOS help document says:
"For example, you can create a feature file in the root directory of the USB flash drive, such as myudisk.txt
Then use the following command to boot a project:
find --set-root /myudisk.txt
chainloader /ldrxpe
"
I tried it but still didn't succeed.
It will be very troublesome to take the USB flash drive to different machines.
Is there any good method?
|
|
2008-6-26 20:25 |
|
|
不点
银牌会员
     不甘寂寞的人
积分 2491
发帖 1115
注册 2003-9-24
状态 离线
|
『第 2 楼』:
使用 LLM 解释/回答一下
grub.exe 的固有缺点,就是它太灵活了,可以从任意磁盘、任意目录启动。这样,启动后的 grub 环境也就没有【当前默认设备】的概念了。因此只能用 find --set-root /mytag 之类的办法。
如果改成 grldr,就好办多了,因为 grldr 启动后,默认的设备就是 grldr 所在的这个设备。不过有人喜欢先启动 DOS,这就是“鱼与熊掌不可兼得”的事情了。
除了 find --set-root /myudisk.txt 之外,其实也可利用 grub4dos 的条件判断(即逻辑运算符)来灵活地执行某些操作。grub4dos 不像 bash 那样有着强大的程序设计能力,而是只有两个简陋的逻辑运算符 && 和 ||。参见 readme 文件。
比如,如果 myudisk.txt 是在 (hd0) 上,那么 cat (hd0)/myudisk.txt 就返回一个“真”,否则,如果 myudisk.txt 在 (fd0) 上,那么 cat (hd0)/myudisk.txt 就返回一个“假”。
The inherent drawback of grub.exe is that it is too flexible and can boot from any disk and any directory. In this way, there is no concept of "current default device" in the booted grub environment. Therefore, one can only use methods like find --set-root /mytag and so on.
If it is changed to grldr, it will be much easier, because after grldr is booted, the default device is the device where grldr is located. However, some people like to boot DOS first, which is a situation of "can't have both fish and bear's paw".
In addition to find --set-root /myudisk.txt, in fact, one can also use the conditional judgment (that is, logical operators) of grub4dos to flexibly perform certain operations. grub4dos does not have the powerful programming capabilities like bash, but only has two simple logical operators && and ||. Refer to the readme file.
For example, if myudisk.txt is on (hd0), then cat (hd0)/myudisk.txt returns a "true", otherwise, if myudisk.txt is on (fd0), then cat (hd0)/myudisk.txt returns a "false".
|

因为我们亲手创建,这个世界更加美丽。 |
|
2008-6-26 21:19 |
|
|
fsfsdf
新手上路

积分 9
发帖 4
注册 2007-7-28
状态 离线
|
|
2008-6-27 11:53 |
|
|
yanglongyang
新手上路

积分 6
发帖 2
注册 2008-3-22
状态 离线
|
『第 4 楼』:
使用 LLM 解释/回答一下
暂时的方法:
我们先随便在U盘根目录下建立两个文件夹,比如FD和HD,然后分别针对BIOS把U盘识别为A:和C:的情况
分别写两个menu.lst放到里面。
如果是用AUTOEXEC.BAT或是config.sys自动进入Grub,可以选择“C”键进入命令行后输入quit退回DOS状态下。
如果没有上面的设置,那么开机就是进的DOS。
在DOS状态下可以copy一份menu.lst到U盘根目录,
比如把U盘识别为A:的情况:
copy \FD\menu.lst \menu.lst
然后写下
grub --config-file=(fd0)/menu.lst
就可以了。
Temporary method:
First, we randomly create two folders under the root directory of the USB flash drive, such as FD and HD, and then write two menu.lsts respectively for the situations where the BIOS recognizes the USB flash drive as A: and C:.
If entering Grub automatically through AUTOEXEC.BAT or config.sys, you can press the "C" key to enter the command line and then enter quit to return to the DOS state.
If there is no the above settings, then booting is into DOS.
In the DOS state, you can copy a menu.lst to the root directory of the USB flash drive,
For example, in the case where the USB flash drive is recognized as A::
copy \FD\menu.lst \menu.lst
Then write
grub --config-file=(fd0)/menu.lst
That's it.
|
|
2008-6-27 23:38 |
|
|
king3060
新手上路

积分 4
发帖 2
注册 2008-7-5
状态 离线
|
『第 5 楼』:
使用 LLM 解释/回答一下
if not exist a:\king.520 goto C
boot\grub\GRUB.exe --config-file=(fd0)/boot/grub/menu.lst
goto end
:C
boot\grub\GRUB.exe --config-file=(hd0,0)/boot/grub/menu.lst
:end
(注意:king.520只是我的一个标识的文件你可以设置你自己的)
你AUTOEXEC.BAT试下这样写,我的也是ZIP+的
然后菜单那里的路径都不要带(FD0) 或(HDO,?)之类的
这是我的你看下
splashimage /boot/grub/bj2008.xpm.gz
fontfile /boot/grub/fonts
timeout 10
default 0
title 启动微型WIN-PE(电脑狂人版)
chainloader /maotao/peldr2
boot
title 启动微型WIN-PE(小马强化版)
chainloader /maotao2/LDRXPE2
boot
title 启动微型WIN-PE(by老毛桃)
chainloader /peldr
boot
title 启动微型WIN-PE(by深山红叶)
chainloader /WXPE/SETUPLDR
boot
title 启动矮人dos工具箱V5.0
kernel /boot/grub/memdisk.gz c=160 h=2 s=36 floppy
initrd /boot/grub/ar5.zip c=160 h=2 s=36 floppy
title 启动maxdos工具箱V5.7S
kernel /boot/grub/memdisk.gz c=274 h=2 s=18 floppy
initrd /boot/grub/System.zip c=274 h=2 s=18 floppy
title 启动mini98
kernel /boot/grub/memdisk.gz
initrd /boot/grub/mini98.gz
title 启动PQ分区魔术师双语版
kernel /boot/grub/memdisk.gz c=160 h=2 s=36 floppy
initrd /boot/grub/pm805.img c=160 h=2 s=36 floppy
title 启动DM9.75
kernel /boot/grub/memdisk.gz
initrd /boot/grub/dm957.img
title 启动故障恢复控制台
chainloader /setupldr.001
boot
title 启动HWINFO系统测试
kernel /boot/grub/memdisk.gz
initrd /boot/grub/hwinfo.img
title 启动硬盘再生器
kernel /boot/grub/memdisk.gz
initrd /boot/grub/hddreg15.img
title 启动效率源硬盘修复
kernel /boot/grub/memdisk.gz
initrd /boot/grub/xly2004.img
title 启动GDISK单硬盘快速分区
kernel /boot/grub/memdisk.gz
initrd /boot/grub/gdisk83.img
title 启动KV2006 DOS杀毒伴侣(2006-12-31)
kernel /boot/grub/memdisk.gz c=160 h=2 s=36 floppy
initrd /boot/grub/kv2006.img c=160 h=2 s=36 floppy
title 清除2000/XP密码
kernel /boot/grub/memdisk.gz
initrd /boot/grub/PASSWORD.IMA
title 清除CMOS密码
kernel /boot/grub/memdisk.gz
initrd /boot/grub/icmos.ima
title 返回WINDOWS启动菜单
rootnoverify
makeactive
chainloader +1
title 从本地硬盘启动操作系统
map (hd0) (hd1)
map (hd1) (hd0)
root (hd1,0)
chainloader (hd1,0)+1
boot
title 重新启动计算机
reboot
title 关闭计算机
halt
不过这两项有点问题进不去,不知道哪里错了,知道的朋友也希望能解答下,谢谢
title 返回WINDOWS启动菜单
rootnoverify
makeactive
chainloader +1
title 从本地硬盘启动操作系统
map (hd0) (hd1)
map (hd1) (hd0)
root (hd1,0)
chainloader (hd1,0)+1
boot
Last edited by king3060 on 2008-7-10 at 04:15 PM ]
if not exist a:\king.520 goto C
boot\grub\GRUB.exe --config-file=(fd0)/boot/grub/menu.lst
goto end
:C
boot\grub\GRUB.exe --config-file=(hd0,0)/boot/grub/menu.lst
:end
(Note: king.520 is just an identification file of mine, you can set your own)
Try writing your AUTOEXEC.BAT like this, mine is also ZIP+
And don't bring (FD0) or (HDO,?) in the path in the menu
Here's mine, take a look
splashimage /boot/grub/bj2008.xpm.gz
fontfile /boot/grub/fonts
timeout 10
default 0
title Start Mini WIN-PE (Computer Man Edition)
chainloader /maotao/peldr2
boot
title Start Mini WIN-PE (Xiao Ma Enhanced Edition)
chainloader /maotao2/LDRXPE2
boot
title Start Mini WIN-PE (by Lao Maotao)
chainloader /peldr
boot
title Start Mini WIN-PE (by Deep Mountain Red Leaf)
chainloader /WXPE/SETUPLDR
boot
title Start矮人DOS Toolkit V5.0
kernel /boot/grub/memdisk.gz c=160 h=2 s=36 floppy
initrd /boot/grub/ar5.zip c=160 h=2 s=36 floppy
title Start MaxDOS Toolkit V5.7S
kernel /boot/grub/memdisk.gz c=274 h=2 s=18 floppy
initrd /boot/grub/System.zip c=274 h=2 s=18 floppy
title Start mini98
kernel /boot/grub/memdisk.gz
initrd /boot/grub/mini98.gz
title Start PQ Partition Magic Bilingual Edition
kernel /boot/grub/memdisk.gz c=160 h=2 s=36 floppy
initrd /boot/grub/pm805.img c=160 h=2 s=36 floppy
title Start DM9.75
kernel /boot/grub/memdisk.gz
initrd /boot/grub/dm957.img
title Start Fault Recovery Console
chainloader /setupldr.001
boot
title Start HWINFO System Test
kernel /boot/grub/memdisk.gz
initrd /boot/grub/hwinfo.img
title Start Hard Disk Regenerator
kernel /boot/grub/memdisk.gz
initrd /boot/grub/hddreg15.img
title Start Efficiency Source Hard Disk Repair
kernel /boot/grub/memdisk.gz
initrd /boot/grub/xly2004.img
title Start GDISK Single Hard Disk Quick Partition
kernel /boot/grub/memdisk.gz
initrd /boot/grub/gdisk83.img
title Start KV2006 DOS Antivirus Companion (2006-12-31)
kernel /boot/grub/memdisk.gz c=160 h=2 s=36 floppy
initrd /boot/grub/kv2006.img c=160 h=2 s=36 floppy
title Clear 2000/XP Password
kernel /boot/grub/memdisk.gz
initrd /boot/grub/PASSWORD.IMA
title Clear CMOS Password
kernel /boot/grub/memdisk.gz
initrd /boot/grub/icmos.ima
title Return to WINDOWS Boot Menu
rootnoverify
makeactive
chainloader +1
title Boot Operating System from Local Hard Disk
map (hd0) (hd1)
map (hd1) (hd0)
root (hd1,0)
chainloader (hd1,0)+1
boot
title Restart Computer
reboot
title Shutdown Computer
halt
But these two items have problems and can't enter, I don't know where the mistake is, friends who know also hope to answer, thank you
title Return to WINDOWS Boot Menu
rootnoverify
makeactive
chainloader +1
title Boot Operating System from Local Hard Disk
map (hd0) (hd1)
map (hd1) (hd0)
root (hd1,0)
chainloader (hd1,0)+1
boot
Last edited by king3060 on 2008-7-10 at 04:15 PM ]
|
|
2008-7-10 16:13 |
|
|
wangmeng052
中级用户
  
积分 334
发帖 154
注册 2007-3-24
状态 离线
|
|
2008-9-7 15:19 |
|
|