Ventoy Forums
How to edit ventoy_grub.cfg - Printable Version

+- Ventoy Forums (https://forums.ventoy.net)
+-- Forum: Ventoy General Use —— Ventoy 使用交流 (https://forums.ventoy.net/forumdisplay.php?fid=1)
+--- Forum: Ventoy Discussion Forum (https://forums.ventoy.net/forumdisplay.php?fid=2)
+--- Thread: How to edit ventoy_grub.cfg (/showthread.php?tid=2774)



How to edit ventoy_grub.cfg - balanga - 01-29-2024

Is there any way to amend ventoy_grub.cfg from within the grub menu, or do I need boot some OS first?

Such a feature would be useful.


RE: How to edit ventoy_grub.cfg - 0x6A7232 - 02-05-2024

(01-29-2024, 11:52 AM)balanga Wrote: Is there any way to amend ventoy_grub.cfg from within the grub menu, or do I need boot some OS first?

Such a feature would be useful.

Any grub entry can be edited IIRC.  Just press 'e' on the menu entry you'd like to alter.  Or am I missing something here?


RE: How to edit ventoy_grub.cfg - balanga - 02-10-2024

(02-05-2024, 11:11 PM)0x6A7232 Wrote:
(01-29-2024, 11:52 AM)balanga Wrote: Is there any way to amend ventoy_grub.cfg from within the grub menu, or do I need boot some OS first?

Such a feature would be useful.

Any grub entry can be edited IIRC.  Just press 'e' on the menu entry you'd like to alter.  Or am I missing something here?
 
If I get to the grub> prompt I can run

grub> ls (hd0,gpt1)/ventoy/ventoy_grub.cfg

and this shows

ventoy_grub.cfg

but I don't see any way to edit it. Is there a way?


RE: How to edit ventoy_grub.cfg - 0x6A7232 - 02-13-2024

(02-10-2024, 11:47 AM)balanga Wrote:
(02-05-2024, 11:11 PM)0x6A7232 Wrote:
(01-29-2024, 11:52 AM)balanga Wrote: Is there any way to amend ventoy_grub.cfg from within the grub menu, or do I need boot some OS first?

Such a feature would be useful.

Any grub entry can be edited IIRC.  Just press 'e' on the menu entry you'd like to alter.  Or am I missing something here?
 
If I get to the grub> prompt I can run

grub> ls (hd0,gpt1)/ventoy/ventoy_grub.cfg

and this shows

ventoy_grub.cfg

but I don't see any way to edit it. Is there a way?

You can manually enter the lines one at a time.  You can display a file's contents with
Code:
cat (hd0,gpt1)/ventoy/ventoy_grub.cfg
.  You can also use redirects with cat to edit files, but it will overwrite them if they exist!  So you'd want to display it first, then edit it.  See here: https://www.fosslinux.com/20889/how-to-create-and-edit-text-files-using-command-line-from-linux-terminal.htm

So, probably you'd want to make a backup (if cp doesn't work, perhaps redirect with
Code:
cat (hd0,gpt1)/ventoy/ventoy_grub.cfg > (hd0,gpt1)/ventoy/ventoy_grub.cfg.bk
  -- this would output the file but instead of the display, you redirect it ( > ) to a new file.  Then you can play with overwriting ventoy_grub.cfg.

Honestly much easier to boot another OS and use a normal text editor, though.  Why can't you do that?



RE: How to edit ventoy_grub.cfg - balanga - 02-17-2024

I do do that but it means booting up and OS just to edit a file.

grub has cat available so you can cat the cfg. Having vi available would be ideal.

Is cat built into busybux? If so, couldn't vi also be built in?