Originally Posted by
3dmatrix
Is it advisable to directly edit the grub file in /boot/grub/ or is it risky
The grub purest can and have told you not to edit grub.cfg, but since you brought up the subject, that's the only way I do it.
And have done it that way for years.
Depending on your experience, any so called "borking" is easily fixed.
For one thing, I keep several copies of my grub.cfg at hand, and my partition tables never change. If they did I would re-create the file.
Even if grub gets updated with a new kernel or program update, and a new grub.cfg gets inserted, I just go behind it back and copy mine in its place.
This is so easy and what's displayed - menuing, colors, etc. , I control. You just have to maintain your UUID's. Here's my grub.cfg jus so you know:
Code:
default=0
timeout=11
menu_color_normal=white/blue
menu_color_highlight=light-cyan/cyan
menuentry "Windows" {
insmod part_msdos
insmod ntfs
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set=root 3464AFFC64AFBF4C
chainloader +1
}
menuentry "KDE" {
insmod part_msdos
insmod ext2
set root='(hd0,msdos6)'
search --no-floppy --fs-uuid --set=root 333ea2a9-69c1-4f60-a39c-acfee7fc46ee
linux /vmlinuz root=UUID=333ea2a9-69c1-4f60-a39c-acfee7fc46ee ro modeset=0 splash quiet
initrd /initrd.img
}
menuentry 'Ubuntu' --class ubuntu --class gnu-linux --class gnu --class os {
insmod part_msdos
insmod ext2
set root='(hd0,msdos7)'
search --no-floppy --fs-uuid --set=root ee55c25c-fff8-4b60-8ff4-be9748d7eedc
linux /vmlinuz root=UUID=ee55c25c-fff8-4b60-8ff4-be9748d7eedc ro quiet splash
initrd /initrd.img
}
submenu Loop-Backs-ISO {
default=0
timeout=11
menu_color_normal=white/black
menu_color_highlight=black/white
menuentry "ISO" {
set root='(hd1,msdos1)'
set isofile="/ISO/kde-saucy-desktop-amd64.iso"
loopback loop (hd1,msdos1)$isofile
linux (loop)/casper/vmlinuz.efi boot=casper maybe-ubiquity iso-scan/filename=$isofile noprompt noeject
initrd (loop)/casper/initrd.lz
}
menuentry 'Ubuntu (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
insmod part_msdos
insmod ext2
set root='(hd0,msdos7)'
search --no-floppy --fs-uuid --set=root ee55c25c-fff8-4b60-8ff4-be9748d7eedc
echo 'Loading Linux 3.5.0-38-generic ...'
linux /vmlinuz root=UUID=ee55c25c-fff8-4b60-8ff4-be9748d7eedc ro recovery nomodeset
echo 'Loading initial ramdisk ...'
initrd /initrd.img
}
menuentry "Clonezilla" {
insmod part_msdos
insmod ext2
gfxpayload=1024x768x16,1024x768
set root='(hd1,msdos1)'
linux /boot/vmlinuz boot=live live-config noswap nolocales edd=on nomodeset ocs_live_run=\"ocs-live-general\" ocs_live_extra_param=\"\" ocs_live_keymap=\"NONE\" ocs_live_batch=\"no\" ocs_lang=\"en_US.UTF-8\" ip=frommedia nosplash live-media-path=/boot bootfrom=/dev/sdb toram=filesystem.squashfs
initrd /boot/initrd.img
}
menuentry "PartedMagic" {
insmod part_msdos
insmod ext2
gfxpayload=1024x768x16,1024x768
set root='(hd1,msdos1)'
linux /boot/pmagic/bzImage64 root=/dev/sdb directory=boot edd=off load_ramdisk=1 prompt_ramdisk=0 rw loglevel=9 max_loop=256 vmalloc=288MiB
initrd /boot/pmagic/initrd.img
}
menuentry 'Parted Magic' {
set root=(hd1,1)
linux /boot/pmagic/bzImage64 root=/dev/sdb directory=boot edd=on
initrd /boot/pmagic/initrd.img
}
}
This menu has white on blue text on first page and white on black for the submenu second "ISO" page.
When grub2 first came out, I too use to stick with scripts, but soon realized, I can control it better myself - and do.
There's always an alternative...
Bookmarks