HELP! FAT32 image not recognized.
Posted: Mon Sep 15, 2014 11:06 am
Hello guys,
I made a FAT32 image file with grub2 in Linux and tried to run it on bochs.
As soon as it boots, grub2 enters the rescue mode.
"ls" gives "(hd0)"
And "ls (hd0)" gives "error: unknown filesystem."
The weird thing is that the image file can be correctly mounted in linux but cannot be opened on Windows using disk tools.
The script I used to generate the image is:
==========================================
KERNELIMG=$1
sudo umount /mnt
sudo losetup -d /dev/loop0
sudo losetup -d /dev/loop1
sudo rm $KERNELIMG
sudo dd if=/dev/zero of=$KERNELIMG bs=512 count=131072
echo "n
p
1
2048
a
1
w
" | sudo fdisk $KERNELIMG
sudo losetup /dev/loop0 $KERNELIMG -o 1048576
sudo losetup /dev/loop1 $KERNELIMG
sudo mkdosfs -v -F 32 /dev/loop0
sudo mount /dev/loop0 /mnt
sudo grub-install --root-directory=/mnt --no-floppy /dev/loop1
sudo umount /mnt
sudo losetup -d /dev/loop0
sudo losetup -d /dev/loop1
echo "p
" | sudo fdisk $KERNELIMG
==========================================
Anyone has any ideas?
I made a FAT32 image file with grub2 in Linux and tried to run it on bochs.
As soon as it boots, grub2 enters the rescue mode.
"ls" gives "(hd0)"
And "ls (hd0)" gives "error: unknown filesystem."
The weird thing is that the image file can be correctly mounted in linux but cannot be opened on Windows using disk tools.
The script I used to generate the image is:
==========================================
KERNELIMG=$1
sudo umount /mnt
sudo losetup -d /dev/loop0
sudo losetup -d /dev/loop1
sudo rm $KERNELIMG
sudo dd if=/dev/zero of=$KERNELIMG bs=512 count=131072
echo "n
p
1
2048
a
1
w
" | sudo fdisk $KERNELIMG
sudo losetup /dev/loop0 $KERNELIMG -o 1048576
sudo losetup /dev/loop1 $KERNELIMG
sudo mkdosfs -v -F 32 /dev/loop0
sudo mount /dev/loop0 /mnt
sudo grub-install --root-directory=/mnt --no-floppy /dev/loop1
sudo umount /mnt
sudo losetup -d /dev/loop0
sudo losetup -d /dev/loop1
echo "p
" | sudo fdisk $KERNELIMG
==========================================
Anyone has any ideas?