c.cobb
May 14th, 2011, 12:23 AM
In short, what I'd like to find is a workaround to install Grub2 onto a USB stick, from a PC running Windows, without using a GUI.
After searching, I don't find any way to install Grub2 from Windows. I do have a nice little MS-DOS batch file that installs syslinux onto a USB stick. It's simple, fairly fool-proof, and I'd like to convert it to install Grub2.
Did find an example of running grub-install without actually installing (http://en.gentoo-wiki.com/wiki/Grub2#Chainloading_to_GRUB2) anything:
grub-install --grub-setup=/bin/true /dev/sda
So, IFAIKT, this just creates the Grub2 'boot.img' file, and maybe also modifies the 'core.img' file? Is that right? If so, then a little DOS utility to write a USB's MBR using the boot.img should work, yes?
However, I notice the boot.img file is 512 bytes. As I understand it, a drive's partition table is included in that space.
I'd like to take that boot.img and use it to install Grub2 on any arbitrary USB stick, without altering the existing partition table. If I snip off the last 72 bytes so the image is only 440 bytes, it seems like this should work (assuming that every USB stick will have Grub2 installed in the /boot/grub subdirectory).
If this sounds right, is there a DOS-based MBR update utility that you would recommend? I find several, such as MBRUtility, MBRWizard, and MBRFix, among others.
Thoughts? Thanks!
After searching, I don't find any way to install Grub2 from Windows. I do have a nice little MS-DOS batch file that installs syslinux onto a USB stick. It's simple, fairly fool-proof, and I'd like to convert it to install Grub2.
Did find an example of running grub-install without actually installing (http://en.gentoo-wiki.com/wiki/Grub2#Chainloading_to_GRUB2) anything:
grub-install --grub-setup=/bin/true /dev/sda
So, IFAIKT, this just creates the Grub2 'boot.img' file, and maybe also modifies the 'core.img' file? Is that right? If so, then a little DOS utility to write a USB's MBR using the boot.img should work, yes?
However, I notice the boot.img file is 512 bytes. As I understand it, a drive's partition table is included in that space.
I'd like to take that boot.img and use it to install Grub2 on any arbitrary USB stick, without altering the existing partition table. If I snip off the last 72 bytes so the image is only 440 bytes, it seems like this should work (assuming that every USB stick will have Grub2 installed in the /boot/grub subdirectory).
If this sounds right, is there a DOS-based MBR update utility that you would recommend? I find several, such as MBRUtility, MBRWizard, and MBRFix, among others.
Thoughts? Thanks!