China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-06-24 21:57
中国DOS联盟论坛 » GRUB4DOS、SYSLINUX及其它启动管理软件讨论专区 » How to solve these two problems when using GRUB on a USB flash drive? View 16,379 Replies 63
Original Poster Posted 2006-07-23 08:33 ·  中国 湖北 襄阳 广电网
初级用户
★★
Credits 132
Posts 58
Joined 2006-07-23 08:12
19-year member
UID 59051
Status Offline
My USB flash drive is in ZIP mode. After I boot the USB flash drive to DOS, I run
grub --config-file=(fd1)/menu.lst
At this time, the floppy drive keeps spinning, making a嘎嘎sound, and the screen displays:
default 0
timeout 1
fallback 1

It rang for about 1 minute, which is very annoying, and then the menu is displayed.
My questions are:
1. How can I skip accessing the floppy drive (fd0) to avoid this situation and successfully enter the menu display in the USB flash drive?
2. When I enter the menu, I want to use the image file diskedit.img in the USB flash drive. Use the following commands
map --menu (fd1)/diskedit.img (fd0)
map --hook
chainloader (fd0)+1
rootnoverify (fd0)

The result is displayed as Error 27:Disk read error press any key to continue...
How should I modify my command? Thank you!
Floor 2 Posted 2006-07-23 09:40 ·  中国 河南 南阳 联通
银牌会员
★★★★
不甘寂寞的人
Credits 2,491
Posts 1,115
Joined 2003-09-24 00:00
22-year member
UID 10292
Gender Male
Status Offline
The version you are using is too old. You should use the latest version at http://grub4dos.jot.com/

That --menu is a typo by you, it should be --mem.

Also, can you be sure that the (fd1) device exists? Usually the USB flash drive is (fd0) instead of (fd1), unless your system is relatively special. I think you should probably use (fd0) instead of (fd1), unless you really know that there is the (fd1) device. So I think it should be like this:

grub --config-file=(fd0)/menu.lst
------------------------------------------------------------
map --mem (fd0)/diskedit.img (fd0)
map --hook
chainloader (fd0)+1
rootnoverify (fd0)
boot
------------------------------------------------------------

Look more at the materials and try more, and you can solve the problem.
因为我们亲手创建,这个世界更加美丽。
Floor 3 Posted 2006-07-23 09:50 ·  中国 湖北 襄阳 广电网
初级用户
★★
Credits 132
Posts 58
Joined 2006-07-23 08:12
19-year member
UID 59051
Status Offline
Thanks to Master Budian's help!
1. menu is indeed a typo for mem, which I made when posting;
2. I first checked with grub on the hard disk. FD0 is my floppy drive, and FD1 should be my USB flash drive. And I initially used fd0, but it froze after running grub. Later, I switched to fd1 to start grub, but the above phenomenon occurred. I think if I pull out the floppy data cable, it will be fd0;
3. I downloaded the stable version from the website you provided a week ago. It shouldn't be too old, right?
Floor 4 Posted 2006-07-23 11:17 ·  中国 上海 松江区 电信
铂金会员
★★★★
DOS一根葱
Credits 5,493
Posts 2,315
Joined 2006-05-01 10:41
20-year member
UID 54766
Gender Male
From 上海
Status Offline
It is estimated that it rang for about 1 minute? Is the floppy drive broken? Removing the floppy drive data cable is not of much significance. The BIOS still assigns an interrupt to the floppy drive. It is best to disable the floppy drive in the BIOS.
Floor 5 Posted 2006-07-23 11:42 ·  中国 湖北 襄阳 广电网
初级用户
★★
Credits 132
Posts 58
Joined 2006-07-23 08:12
19-year member
UID 59051
Status Offline
Originally posted by fastslz at 2006-7-23 11:17:
It seemed to ring for about one minute? Is the floppy drive broken?
It doesn't make much sense to unplug the floppy drive data cable. The BIOS still assigns an interrupt to the floppy drive. It's better to disable the floppy drive in the BIOS.



The floppy drive ringing doesn't mean it's broken; I'm still using a floppy drive now. I guess it's because I didn't put a floppy disk in, but GRUB insists on searching for files in the floppy disk, which causes it to move back and forth.
Actually, I booted from a USB flash drive, not a floppy disk. If I disable the floppy drive in the BIOS, I have to use the "enable" option, which would make it impossible to boot from my USB flash drive.
Moreover, I think unplugging the data cable is equivalent to having no floppy drive, so it won't perform the disk reading action.
Floor 6 Posted 2006-07-23 12:04 ·  中国 湖北 襄阳 广电网
初级用户
★★
Credits 132
Posts 58
Joined 2006-07-23 08:12
19-year member
UID 59051
Status Offline
You can set the floppy drive to "None" in the BIOS, and I'll give it a try. But for solving the problem, even if it can be used this way, after all, it's still an issue.
Floor 7 Posted 2006-07-23 12:11 ·  中国 河南 南阳 联通
银牌会员
★★★★
不甘寂寞的人
Credits 2,491
Posts 1,115
Joined 2003-09-24 00:00
22-year member
UID 10292
Gender Male
Status Offline
You try the latest test version uploaded today. This test version should be quite stable. Now the preset menu in grub should not automatically search for floppy disks.
------------------
Let me analyze:

grub --config-file=(fd1)/menu.lst

This command specifies the menu file (fd1)/menu.lst. If GRUB can indeed find and open this file, it directly uses this file as the configuration file and executes the commands in it. Otherwise, when the file does not exist or the file opening fails, GRUB uses the built-in preset_menu as the main control menu to execute. The old preset_menu is to search for floppy disks, so the situation you saw occurs. The preset_menu in the latest version of GRUB4DOS no longer searches for floppy disks, so there should be no problem anymore.

However, from the previous analysis, it seems that (fd1)/menu.lst may not exist.

In addition, after booting the USB flash drive to DOS, A: should be the USB flash drive, or C: is the USB flash drive, and there should be no situation where B: or D: is the USB flash drive. This is because DOS cannot successfully boot from drives other than A: and C:.

So your (fd1) may not exist, and you yourself seem not to have proved that it exists.

If (fd0) is your real floppy drive and it is clicking, then I estimate your USB flash drive should be C:. You can try this:

grub

Do not add --config-file, in this case, it will default to find (hd0,0)/menu.lst as the configuration menu.
因为我们亲手创建,这个世界更加美丽。
Floor 8 Posted 2006-07-23 12:48 ·  中国 湖北 襄阳 广电网
初级用户
★★
Credits 132
Posts 58
Joined 2006-07-23 08:12
19-year member
UID 59051
Status Offline
I just saw the post from Master BuDian and haven't had time to test it yet. Let me first talk about the situation I tested just now. It's really strange!
1. My computer is a motherboard with an Asus 845D chipset. There is only the USB_ZIP option, and no USB_HDD option;
2. When I set the floppy drive to "None" in the BIOS, I boot GRUB from the hard drive (of course, the USB flash drive is plugged in), and confirm that there are only three disks: FD0, HD0, HD1 (I have two hard drives);
3. So after I boot from the USB flash drive into DOS, I run grub --config-file=(fd0)/menu.lst, and it still crashes;
4. Restart the computer, still set the floppy drive to None, run grub --config-file=(fd1)/menu.lst, but can start GRUB normally, and no longer read the floppy drive, of course, there is no clicking sound.
For this, I was very strange, so I entered the GRUB command line and ran:
cat (, displays (fd0),(hd0),(hd1)
Use cat (fd0, displays that it is indeed the USB flash drive.
Use cat (fd1, displays: Error23:Selected disk does not exist
Floor 9 Posted 2006-07-23 14:35 ·  中国 湖北 襄阳 广电网
初级用户
★★
Credits 132
Posts 58
Joined 2006-07-23 08:12
19-year member
UID 59051
Status Offline
Report as follows in accordance with the requirements using the latest July 23 version (actually July 22):
1. The trial situation is the same as the original grub for dos V4.1. It must be started in the USB flash drive by using grub --config-file=(fd1) /menu.lst. If the floppy drive is not disconnected in the BIOS, there is still a disk reading action, and the floppy drive makes a clicking sound; if the floppy drive is set to none in the BIOS, there is no disk reading, no sound, and it can also be started.
2. Starting with grub --config-file=(fd0) /menu.lst is not possible, and it freezes after "CD-ROM setup is OK.". But the USB flash drive still has a long time of reading action before freezing (because the light of the USB flash drive is always flashing).
3. After I boot GRUB from the hard disk, there are indeed the following displays:
possible disk are:fd0 fd1 hd0 hd1 rd
If using cat (fd0, there is no display (the previous version had display), and the same is true for rd;
Using cat (fd1, there is display such as "Plssible partitions are:".

I have found out that if I delete the menu.lst in drive C, then whether using --config-file=(fd1) or --config-file=(fd0) will freeze, indicating that the menu read by GRUB when running on the USB flash drive is actually in the root directory of drive C, and it cannot read the menu in the root directory of the USB flash drive (although there is a long time of reading action, it finally freezes).
Conclusion: If there is no menu.lst in drive C, I cannot run GRUB in the DOS startup environment of the USB flash drive, otherwise it will freeze.
But what I can't understand is: Whether it freezes is actually restricted by whether there is a menu.lst in drive C. Is there no way to solve it?
Floor 10 Posted 2006-07-23 15:37 ·  中国 上海 松江区 电信
铂金会员
★★★★
DOS一根葱
Credits 5,493
Posts 2,315
Joined 2006-05-01 10:41
20-year member
UID 54766
Gender Male
From 上海
Status Offline
Then check if there are options like "BOOT UP FLOPPY SEEK" (check floppy drive on boot) and "SWAP FLOPPY DRIVE" (swap floppy drive letters) in the BIOS settings. Also, if menu.lst is in the root directory, you can directly press grub to call the built-in menu to boot!
Floor 11 Posted 2006-07-23 16:13 ·  中国 湖北 襄阳 广电网
初级用户
★★
Credits 132
Posts 58
Joined 2006-07-23 08:12
19-year member
UID 59051
Status Offline
Directly running GRUB, no crash occurs and the floppy drive doesn't make noise. But there is no menu (the menu.lst under the root directory of drive C has been deleted, otherwise it can be displayed), and the last display on the screen is the GRUB command line. Two questions:
1. How can the menu.lst menu be displayed in this case?
2. It seems that it is because of the problem of reading the menu from the USB flash drive that the crash occurs. How to solve it?
Floor 12 Posted 2006-07-23 16:53 ·  中国 上海 松江区 电信
铂金会员
★★★★
DOS一根葱
Credits 5,493
Posts 2,315
Joined 2006-05-01 10:41
20-year member
UID 54766
Gender Male
From 上海
Status Offline
I this machine does not support USB boot, so I can't test it with your method. I don't know if it's an individual phenomenon or a GRUB bug. Wait for the boss of Dengbudian to answer. Oh... Is the grldr in the same package normal on your USB drive?
Floor 13 Posted 2006-07-23 16:55 ·  中国 河南 南阳 联通
银牌会员
★★★★
不甘寂寞的人
Credits 2,491
Posts 1,115
Joined 2003-09-24 00:00
22-year member
UID 10292
Gender Male
Status Offline
--1. My computer is a mainboard with ASUS 845D chipset, only has USB_ZIP item, no USB_HDD item;
--2. When I set the floppy drive to "None" in BIOS, I boot GRUB from the hard disk (of course, the USB flash drive is inserted), and confirm there are only three disks: ---FD0, HD0, HD1 (I have two hard disks);

It shows that when booting from the hard disk, the BIOS recognizes the USB flash drive as A:. So, your USB flash drive is always recognized as A:, whether booting from the hard disk or from the USB flash drive.

--3. Then I boot from the USB flash drive into DOS, and run grub --config-file=(fd0)/menu.lst, still get a system crash;

Crash when accessing the USB flash drive? This should be a bug in that old USB flash drive BIOS. This has been reported by people a long time ago. Combined with your previous report, this bug always occurs, regardless of whether the floppy drive is disabled in BIOS.

--4. Restart the computer, still set the floppy drive to None, run grub --config-file=(fd1)/menu.lst, but can start GRUB normally,
--also no longer read the floppy drive, of course no clicking sound.

You use a non-existent file as the menu, of course GRUB cannot find this menu. Then GRUB calls the built-in menu. The built-in menu first searches and finds the menu.lst on the hard disk, then hands over control to this menu on the hard disk.

--For this, I am very curious, so I enter the GRUB command line, run:
--cat (, displays (fd0),(hd0),(hd1)
--Use cat (fd0, displays it is indeed the USB flash drive.
--Use cat (fd1, displays: Error23:Selected disk does not exist

Confirmed that (fd1) does not exist.

--Use the latest version on July 23rd (actually July 22nd), now report as follows:
--1. Test situation is the same as original grub for dos V4.1, in the USB flash drive must use grub --config-file=(fd1) /menu.lst
--to start, if the floppy drive is not disconnected in BIOS, there is still reading action, the floppy drive clicks; if the floppy drive is set to None in BIOS,
--no reading action, no click, and can start.

Same as above analysis. Supplement: If there is a floppy drive in BIOS settings, then the possible reading of the floppy drive may be (fd1)/menu.lst. Some BIOS may actually access (fd0) when you try to access (fd1).

--2. Use grub --config-file=(fd0)/menu.lst cannot start, crash after CD-ROM setup is OK.
--But the USB flash drive still has a long time of reading action before the crash (because the light of the USB flash drive is flashing all the time).

Crash when accessing the USB flash drive? This should be a bug in that old USB flash drive BIOS. This has been reported by people a long time ago. Combined with your previous report, this bug always occurs, regardless of whether the floppy drive is disabled in BIOS. From the error message having reached CD-ROM setup is OK, it shows that A20 has been successfully opened, so rule out the possibility of crash caused by A20 control. It should be that the crash occurs when reading the menu file on the USB flash drive. You try to enter GRUB, then use the geometry (fd0) command, see if this command can be executed successfully. If successful, post its output result. Further, you can also use cat --hex (fd0)+1 to display the first sector of the USB flash drive, see if it is normal.

--3. I boot GRUB from the hard disk, indeed have the following display:
--possible disk are:fd0 fd1 hd0 hd1 rd
--If use cat (fd0, then no any display (the previous version has display), rd also no display;
--Use cat (fd1, then has display such as "Plssible partitions are:".

The two displayed floppy drives, (fd0) may be your real floppy drive, so it has no content display. And (fd1) may be the USB flash drive, so it has content display. But you did not display the content completely, so, you better use cat --hex (fd1)+1 to display the first sector of the USB flash drive, see if it is a partition table containing MBR or a usual DOS boot sector?

--I have found out, if I delete menu.lst in C drive, then no matter use --config-file=(fd1) or --config-file=(fd0)
--均 crash, indicating that the menu read by GRUB when running on USB flash drive is actually the one in C drive root directory, it cannot read the menu in USB flash drive root directory
--(although there is a long time of reading action, but finally crash).
--Conclusion: If there is no menu.lst in C drive, I cannot run GRUB in DOS startup environment of USB flash drive, otherwise crash.

So, I think should find out the structure of the USB flash drive, just as above said. Also again shows, this is the crash caused by BIOS reading process, essentially a BIOS fault.

--But what I cannot understand is: whether the crash is actually restricted by whether there is menu.lst in C drive,

When there is menu.lst in C drive, GRUB does not look for the USB flash drive, so it will not crash. This is easy to understand. Once need to read files from the USB flash drive, then it may lead to crash. When there is no menu.lst in C drive, the old version of GRUB will search for the floppy drive (that is, the USB flash drive), so it may lead to crash. The new version should not search for the floppy drive, so should not crash, you confirm again.

--Is there no way to solve it?

Try like this? grub --config-file="commandline" this command does not use other menus, but directly uses the GRUB command specified by the command line (here is commandline command), so, after starting GRUB will directly enter the command line, no longer look for the menu.

=========

Generally speaking, there are two possible reasons leading to this phenomenon. One is a BIOS bug, the other is that the formatting method of the USB flash drive is wrong. But the fundamental reason should still be the first one, that is, the BIOS bug leads to it. Find the BIOS manufacturer or mainboard manufacturer to solve.
因为我们亲手创建,这个世界更加美丽。
Floor 14 Posted 2006-07-23 17:06 ·  中国 河南 南阳 联通
银牌会员
★★★★
不甘寂寞的人
Credits 2,491
Posts 1,115
Joined 2003-09-24 00:00
22-year member
UID 10292
Gender Male
Status Offline
--Additionally, if menu.lst is in the root directory, you can directly press Enter after typing grub to call the built-in menu to start!

The default boot menu of GRUB is (hd0,0)/menu.lst. Pressing Enter after typing grub has the same effect as typing grub --config-file=(hd0,0)/menu.lst. So, this method cannot start menu.lst on drive A.

--Oh...Is the grldr in the same package working normally on your USB flash drive?

Yes, you can try installing GRLDR on the USB flash drive and directly use GRLDR to start, and see if GRLDR can successfully read menu.lst in the root directory of the USB flash drive. But I estimate it will still fail, because GRLDR and GRUB are essentially the same, the difference is only in the startup process. After entering the GRUB environment, there is no difference.


One most helpless method is to embed the entire menu into the GRUB command line, so that there is no need to load the menu from the USB flash drive after entering GRUB. If the menu is small, it can be embedded in the command line of grub.exe (in the DOS prompt or in AUTOEXEC.BAT). If the menu is large, you must use config.sys. There is a config.sys for example in the release of GRUB4DOS. You can study this example to make it work.

However, you still need to remember that after entering the GRUB environment, there should be no actions to access the USB flash drive (and the menu commands should not have actions to access the USB flash drive), otherwise it will still inevitably crash.

[ Last edited by 不点 on 2006-7-23 at 17:22 ]
因为我们亲手创建,这个世界更加美丽。
Floor 15 Posted 2006-07-23 17:40 ·  中国 湖北 襄阳 广电网
初级用户
★★
Credits 132
Posts 58
Joined 2006-07-23 08:12
19-year member
UID 59051
Status Offline
BF1B065057B9E501F3A4CBBDBE07B104
386E007C09751383C510E2F4CD188BF5
83C610497419382C74F6A0B507B4078B
F0AC3C0074FCBB0700B40ECD10EBF288
4E10E84600732AFE4610807E040B740B
807E040C7405A0B60775D28046020683
46080683560A00E821007305A0B607EB
BC813EFE7D55AA740B807E100074C8A0
B707EBA98BFC1E578BF5CBBF05008A56
00B408CD1372238AC1243F988ADE8AFC
43F7E38BD186D6B106D2EE42F7E23956
0A77237205394608731CEB1A90BB007C
8B4E028B5600CD1373514F744E32E48A
5600CD13EBE48A560060BBAA55B441CD
13723681FB55AA7530F6C101742B6160
6A006A00FF760AFF76086A0068007C6A
016A10B4428BF4CD136161730E4F740B
32E48A5600CD13EBD661F9C3496E7661
6C696420706172746974696F6E207461
626C65004572726F72206C6F6164696E
67206F7065726174696E672073797374
656D004D697373696E67206F70657261
74696E672073797374656D0000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
D80C05000000800101000EFE3F063F00
0000C1F3010000000000000000000000
00000000000000000000000000000000
000000000000000000000000000055AA

If you directly run GRUB, there is no system hang, and the floppy drive doesn't make noise. You can enter the command line, but after pressing Enter, it's still the command line, and no menu is displayed. You can use quit to return to DOS. Of course, you can also use type to display the menu.lst in the root directory of the USB flash drive, but this is meaningless because you can't execute the commands in the menu.
My idea is: 1. Booting to DOS is completely normal; 2. You can also directly run GRUB; 3. The problem only occurs when reading the menu.
Therefore, I can't understand that this failure is completely attributed to the BIOS.
1 2 3 5 Next ›
Forum Jump: