Modify grub configuration on an external drive without an installed OS

Asked by George on 2016-11-17

I'm wondering if there is a way to modify grub on a device without an installed OS? I have a flash drive that uses grub to boot various ISOs but has no installed operating system with which to update-grub. It would be ideal if I could navigate to and select the grub.cfg to modify in some way. I thought I might be able to accomplish this with Change Environment and changed the partition to point to the flash drive partition I wished to modify and pointed the output dir and output file to the mounted locations on the flash drive that I wished to modify but the menu entry list I get is the list from the host system, not the list on the flash drive. Is there a way to accomplish editing grub.cfg on the flash drive?

Question information

Language:
English Edit question
Status:
Solved
For:
Grub Customizer Edit question
Assignee:
No assignee Edit question
Solved by:
Daniel Richter
Solved:
2016-12-01
Last query:
2016-12-01
Last reply:
2016-11-17

No, you can't do this using grub customizer. I had some plans like this, but realized it would be too much complexity but low benefit (editing the grub.cfg is way easier than editing the automatic configuration of an installed os ... and I think there are not much people building such a bootable stick - although I'm one of them).

George (3grciii) said : #2

Thank you for that rapid response. Perhaps you can shed some light on what
changes would be required to grub.cfg to use a background image on an
already successfully booting grub. This is a snap on an installed OS, but
I've found it exceedingly difficult to do. I know I need insmod png to
support the png image and I assume I also need the gfxterm and filesystem
support modules necessary for the fs on the flash drive, but I cant seem to
get all the pieces together. If this is too far off topic you have my
apologies and understanding. Thank you.

On Nov 17, 2016 12:52 PM, "Daniel Richter" <
<email address hidden>> wrote:

> Your question #404175 on Grub Customizer changed:
> https://answers.launchpad.net/grub-customizer/+question/404175
>
> Status: Open => Answered
>
> Daniel Richter proposed the following answer:
> No, you can't do this using grub customizer. I had some plans like this,
> but realized it would be too much complexity but low benefit (editing
> the grub.cfg is way easier than editing the automatic configuration of
> an installed os ... and I think there are not much people building such
> a bootable stick - although I'm one of them).
>
> --
> If this answers your question, please go to the following page to let us
> know that it is solved:
> https://answers.launchpad.net/grub-customizer/+question/
> 404175/+confirm?answer_id=0
>
> If you still need help, you can reply to this email or go to the
> following page to enter your feedback:
> https://answers.launchpad.net/grub-customizer/+question/404175
>
> You received this question notification because you asked the question.
>

just add something like
set root='hd0,1'
background_image /path/to/image
set color_normal=white/black
set color_highlight=yellow/brown
(root must point to your device. When you boot from usb, 0 is always your device. Partitions counting from 1)

George (3grciii) said : #4

This works flawlessly in both BIOS and UEFI boot modes. It appears that the issue arises when I attempt this configuration on a device configured to boot in both BIOS and UEFI mode. This appears to be the root cause of this problem. I'm marking this as solved since the answer clearly works under normal conditions.