GRUB: Difference between revisions

285 bytes added ,  9 years ago
no edit summary
[unchecked revision][unchecked revision]
(I'm not sure if you can override /dev/sda of your current system but I did not want to try it out.)
No edit summary
Line 224:
</source>
 
5. Because we're on OS X, we need to mount the disk image first, without actually mounting it.
<source lang="bash">
hdiutil attach -nomount fs.img
</source>
 
6. Use 'diskutil list' to find out which device your image is, use that below.
5. Now, make a FAT12/16/32 filesystem on the FS.img disk. Note that I booted up an Ubuntu VM to do this, but if you find the command to make a FAT32 FS in OSX, feel free to edit.
 
7. Now, make a FAT12/16/32 filesystem on the FS.img disk. Remember, use FS.img -- not disk.img
<source lang="bash">
mkfs.vfatnewfs_msdos -F 32 fs.img/dev/diskX
</source>
 
8. Now you'll want to unmount it, then recombine the two images, then install GRUB.
6. Finally, here comes the crucial part -- Installing GRUB2.
<source lang="bash">
hdiutil detach /dev/diskX
cat mbr.img fs.img > disk.img
 
hdiutil attach disk.img
grub-install --modules="part_msdos biosdisk fat multiboot configfile" disk.img
# note the mount point here (/Volumes/NO NAME, probably)
 
grub-install --modules="part_msdos biosdisk fat multiboot configfile" --root-directory="/Volumes/NO NAME" disk.img
Installation finished. No error reported.
</source>
Anonymous user