grub4dos icon indicating copy to clipboard operation
grub4dos copied to clipboard

Hanging at Command Line After Invoking "ls"

Open DapperDeer opened this issue 5 years ago • 14 comments
trafficstars

Hi there,

I have a disk with Grub4DOS that (is supposed to) boot into Windows 10. When I run QEMU on my Fedora distro, telling it to simply boot from the disk, it works perfectly.

However, when I plug that disk into physical hardware or setup a VM via VMWare with the disk, Grub4DOS is unable to find (and subsequently boot into) my Windows partition. I'm currently using the latter of the two setups (VMWare VM booting directly into the disk) and am at the command line where I have solely invoked "ls" trying to figure out where exactly Grub4DOS is on my filesystem and Grub has been hanging for over twenty minutes now.

I'm at the end of my rope trying to figure out why there is such a discrepancy in Grub's ability to probe disks, so I'd truly appreciate any advice.

Thanks

DapperDeer avatar Jun 16 '20 18:06 DapperDeer

can you paste a screenshot of the screen? try also

map --status
find

steve6375 avatar Jun 16 '20 19:06 steve6375

image

(I hope that uploaded correctly)

This is currently where I'm stuck, I can't even get to the cmd line now. I built it with ./configure --enable-preset-menu=<dir>/preset_menu.lst make

My preset_menu.lst is:

default 0
timeout 5

title Windows
rootnoverify (hd0,0)
chainloader /bootmgr

image

This is using QEMU, I really am not sure why it's able to work this way but not the others.

EDIT: I added the commands you suggested

map --status
find

image

EDIT 2: I rebuilt Grub4DOS without a preset menu so I could get to the command line. It's not just ls that hangs Grub, but I think near any read function; root (hd0,0) hangs just like ls but I can map --status just fine.

image

DapperDeer avatar Jun 16 '20 19:06 DapperDeer

0.4.6a is the current build version of grub4dos. Development of 0.4.5c is discontinued, Can you try 0.4.6a? Why re-compile when you can download the precompiled version + utilities? http://grub4dos.chenall.net/categories/downloads/

steve6375 avatar Jun 16 '20 23:06 steve6375

I was compiling it on my own because I'd either get stuck here, and/or this function would simply take forever, so I was foregoing menu.lst and instead using the preset_menu for my menuentries:

image

DapperDeer avatar Jun 17 '20 17:06 DapperDeer

OK. Well grub4dos 0.4.6a is used on over 100,000 systems because it is used by Easy2Boot and many other solutions. Can you think of any reason why your PC is different from 100,000 other PCs? Of course the disk must be a 512-bytes per sector (512e) disk and must have MBR partitions (not GPT). P.S. This is grub4dos not grub.

steve6375 avatar Jun 17 '20 17:06 steve6375

The two things I can think of are:

  1. I'm using Kexec to get into Grub4DOS
  2. I'm not "installing" Grub4DOS into my filesystem anywhere, just using the executable.

If I had to guess, it'd probably be the second bullet point that is giving me problems, but I don't think I can install Grub4DOS. For context as to why: I'm creating a secure boot chain for my work - I use Grub2 as my initial bootloader to boot into a minimal Linux Kernel which performs integrity checks on the filesystem, and then kexecs into Grub4DOS.

DapperDeer avatar Jun 17 '20 17:06 DapperDeer

You are using grub2 in Legacy BIOS mode - not UEFI - correct?

steve6375 avatar Jun 17 '20 17:06 steve6375

Correct, yes.

DapperDeer avatar Jun 17 '20 17:06 DapperDeer

OK - then I am afraid I can't help you because kexec is outside my area of knowledge. You can directly run grub4dos from grub2 - see https://sites.google.com/a/rmprepusb.com/www/tutorials/chainload-syslinux#TOC-Load-grub4dos-from-grub2 but I don't know about kexec - maybe one of the developers can help?

steve6375 avatar Jun 17 '20 17:06 steve6375

On a VMWare VM booting from my physical hard drive, I changed the VM's hard drive settings from SATA to IDE and Grub4DOS worked perfectly. I tried plugging it into my production hardware (which formats SATA into IDE) and unfortunately I received the same result as my earlier screenshots - "Processing the preset menu" and the same map --status output.

Is there some sort of IDE module or something that I need to include when compiling Grub4DOS?

EDIT: It passed the "Processing the preset menu" screen and is now stuck on "Booting Windows". My preset_menu.lst hasn't changed from my earlier post:

default 0
timeout 5

title Windows
rootnoverify (hd0,0)
chainloader /bootmgr

EDIT 2: Eventually Grub4DOS returns a Disk Read Error.

DapperDeer avatar Jun 17 '20 19:06 DapperDeer

no, grub4dos just used the BIOS. Try changing some BIOS settings for IDE\Legacy\AHCI etc.??

steve6375 avatar Jun 17 '20 20:06 steve6375

Does your minimal Linux has NTFS Support and what is the FileSystem of your Linux Partition ? Your harddisk has 4 partitions but find does not see them and Grub4dos does not have access to those partitions. In that case you can expect that bootsequence Grub2 > Linux > kexec > Grub4dos > Windows 10 is NOT working.

wimbrts avatar Jun 30 '20 19:06 wimbrts

Yes, my Linux kernel has NTFS read and write support and it is Ext2. find does end up seeing all partitions, the pictures posted earlier in this thread are from much earlier, from before I had realized my kernel was trying to force AHCI.

image

EDIT: Wimb, is reboot down for you as well? I wonder what happened

DapperDeer avatar Jun 30 '20 19:06 DapperDeer

Ok thanks for Info and Screenshot. Yes reboot is down. working menu.lst for you ` cat --hex --skip=0x1BC --length=1 (hd0)+1 | set mbr_flag=

echo mbr_flag=%mbr_flag%

echo %mbr_flag% > (md)0x220+1

cat --skip=63 --length=1 (md)0x220+1 | set mbr_flag=

echo mbr_flag=%mbr_flag%

pause

if #%mbr_flag%==#0 configfile /boot/grub/linux.lst

if #%mbr_flag%==#1 configfile /boot/grub/windows.lst `

wimbrts avatar Jun 30 '20 20:06 wimbrts