Installing GRUB 2 on a CompactFlash card
I want to install GRUB 2 on a CompactFlash card, which I will boot on my Mini-ITX VIA C3 system for testing, by attaching the CF card to an IDE-CF adapter.
Before I run grub-install, I wanted to get a confirmation that I'm doing the right thing, so I don't end up wiping out my development system's boot partition or something. Here's my setup:
Development workstation:
Running Linux.
Hard drives on /dev/hdXX and /dev/sdXX.
The CompactFlash card will appear as /dev/sdc or something.
(let's assume it's /dev/sdc)
Target system:
IDE controller - connected to IDE-CompactFlash adapter.
If I create one partition on the CF card, for GRUB, I assume I should set up my grub.cfg to refer to it as (hd0,1) since this will only be used on the TARGET SYSTEM, right?
Then on my development workstation I will do:
grub-install /dev/sdc
But will this affect my development workstation's "/boot" ? I want to install only to my CompactFlash card; is this possible without messing with my dev machine's filesystem?
If I have /dev/sdc1 (the CF card's partition) mounted at /media/grubtest, can I just do
grub-install --root-directory=/media/grubtest /dev/sdc
Thanks!
Colin
Quoting Colin D Bennett <[email protected]>:
Quoted 3 lines
If I create one partition on the CF card, for GRUB, I assume I should set up my grub.cfg to refer to it as (hd0,1) since this will only be used on the TARGET SYSTEM, right?
I suggest that you use the current GRUB from CVS and use UUID to refer to any drives. update-grub will generate the new style grub.cfg, but be sure to back up your current grub.cfg in case it gets overwritten.
Quoted 4 lines
Then on my development workstation I will do:
grub-install/dev/sdcBut will this affect my development workstation's "/boot" ?
I don't think current GRUB will allow you to do that, but if cross-device installs were supported, it would indeed overwrite /boot/grub
Quoted 3 lines
I want to
install only to my CompactFlash card; is this possible without messing with my dev machine's filesystem?
Yes, I did it several times.
Quoted 3 lines
If I have
/dev/sdc1(the CF card's partition) mounted at /media/grubtest, can I just do
grub-install --root-directory=/media/grubtest/dev/sdc
Yes, that should work.
In case you are not sure if the system boot was affected, I suggest that you reinstall grub on your hard drive the way it was installed before attempting a reboot. Also make the rescue image with grub-mkrescue, write it to a CD and keep it handy in case you need to recover anything.
Signature · 2 lines
Regards, Pavel Roskin
Quoted 10 lines · Pavel Roskin
Quoting Colin D Bennett <[email protected]>:
Quoted 3 lines
If I create one partition on the CF card, for GRUB, I assume I should set up my grub.cfg to refer to it as (hd0,1) since this will only be used on the TARGET SYSTEM, right?
I suggest that you use the current GRUB from CVS and use UUID to refer to any drives. update-grub will generate the new style grub.cfg, but be sure to back up your current grub.cfg in case it gets overwritten.
Quoted 8 lines
Quoted 4 lines
Then on my development workstation I will do:
grub-install/dev/sdcBut will this affect my development workstation's "/boot" ?
I don't think current GRUB will allow you to do that, but if cross-device installs were supported, it would indeed overwrite
/boot/grub
P.S. Current GRUB is broken. Please use the version as of June 5. If ext3 is involved, use the version from May 19. That won't have UUID, but it would be safer.
Things may be fixed soon, even hours from now, but I cannot give any promises. Sorry for inconvenience.
Signature · 2 lines
Regards, Pavel Roskin
Quoted 21 lines · On Fri, 06 Jun 2008 18:57:39 -0400 Pavel Roskin <[email protected]> wrote:
Quoted 11 lines · Pavel Roskin
Quoting Colin D Bennett <[email protected]>:
Quoted 3 lines
If I create one partition on the CF card, for GRUB, I assume I should set up my grub.cfg to refer to it as (hd0,1) since this will only be used on the TARGET SYSTEM, right?
I suggest that you use the current GRUB from CVS and use UUID to refer to any drives. update-grub will generate the new style grub.cfg, but be sure to back up your current grub.cfg in case it gets overwritten.
Quoted 8 lines
Quoted 4 lines
Then on my development workstation I will do:
grub-install/dev/sdcBut will this affect my development workstation's "/boot" ?
I don't think current GRUB will allow you to do that, but if cross-device installs were supported, it would indeed overwrite
/boot/grub
Quoted 6 lines
P.S. Current GRUB is broken. Please use the version as of June 5. If ext3 is involved, use the version from May 19. That won't have UUID, but it would be safer.Things may be fixed soon, even hours from now, but I cannot give any promises. Sorry for inconvenience.
What is the problem with post-June 5 GRUB? Has it been fixed? I will use June 5 CVS for now then.
Quoted 7 lines · Colin D Bennett
Quoted 4 lines · On Fri, 06 Jun 2008 18:57:39 -0400 Pavel Roskin <[email protected]> wrote:
P.S. Current GRUB is broken. Please use the version as of June 5. If ext3 is involved, use the version from May 19. That won't have UUID, but it would be safer.
Quoted 5 lines
Quoted 2 lines
Things may be fixed soon, even hours from now, but I cannot give any promises. Sorry for inconvenience.
What is the problem with post-June 5 GRUB? Has it been fixed? I will use June 5 CVS for now then.
It's fixed now. It was an incorrect change to the code handling partitions in userspace utilities.
Signature · 2 lines
Regards, Pavel Roskin