FAT32 and GRUB
Posted: Sun Jan 20, 2013 6:33 pm
I'm trying to create a bootable GRUB image with FAT32 on it. For some reason, Ubuntu can mount the image but GRUB can't. This is the process I used to create it:
This all runs flawlessly. The issue is when I get to this part:
Code: Select all
sudo dd if=/dev/zero of=kernel.img bs=1M count=100
sudo fdisk kernel.img
o
n
a
p
w
sudo losetup -o1048576 /dev/loop0 kernel.img
sudo mkdosfs -F32 /dev/loop0
sudo mount /dev/loop0 /mnt/hdd
sudo mkdir /mnt/hdd/boot
sudo mkdir /mnt/hdd/boot/grub
cp ~/Downloads/fat* ~/Downloads/stage* /mnt/hdd/boot/grub
sudo umount /dev/loop0
sudo losetup -d /dev/loop0
Code: Select all
grub --device-map=/dev/null
>device (hd0) kernel.img
>root (hd0,0)
>setup (hd0)
Error 17: Cannot mount selected partition