I'm using an application of deployment and management of operating systems and I need to change the order of the default menu entry in one Ubuntu 10.10, but i need to do it outside of the OS to be able to choose the correct OS before boot.
In older versions I only needed to change the parameter in menu.lst but now I can't do a sudo update-grub
How can I change directly /boot/grub/grub.cfg without broking everything?
The same way you edited menu.lst before. Just know that it will be replaced the next time you do run update-grub.
You also can chroot into the system while it is mounted from another system and run update-grub that way:
Code:for f in sys proc dev ; do mount --bind /$f /mnt/$f ; done chroot /mnt update-grub
I have found that an application called "Grub Customizer" will work fine for your purpose. Check this web site about it: http://www.webupd8.org/2010/10/grub-...er-add-or.html
sudo add-apt-repository ppa:danielrichter2007/grub-customizer
sudo apt-get update
sudo apt-get install grub-customizer
System76 Lemur Laptop,12GB RAM,250GB SSD w/U16.04LTS
White Box Computer:GigabyteGA-A75-UD4H MB,AMD A6-3670 APU,1TB SSHD, 16GB RAM,U16.04LTS
AcerAspireOneNetbook725 6GB RAM,250GB SSD,U16.04LTS
AcerAspireOneNetbookAO150,1.5GB RAM,120GB HD,U14.04LTS
I'm not sure exactly what you want to do but there have to be simpler ways of doing what you want rather than editing Grub2 every time you boot.
If you need to make different selections on boot:
Do you see the Grub 2 menu during boot? If so, you should be able to choose the selection. If you don't see the menu, perhaps we can permanently make the changes so you do.
If the boot option is always going to be the same:
If the version of the OS you want to boot doesn't change (or even if it does), you can create a custom menu and have the first menuentry be the one that always boots by default. You can also disable one or more of the GRUB scripts so that portion of the menu doesn't change (in combination with a custom entry).
If you can be a bit clearer of what exactly you want to do we can probably create a fairly trouble-free solution.
As far as editing the grub files outside the OS:
You need to chroot when you are trying to install or update a system. If you only want to manually edit the grub.cfg file, all you have to do is mount the partition and then access the file. Of course, as has been mentioned, any update-grub operation will re-write the file so other steps would be needed to prevent future modifications.
You can also edit the commands for one time use at boot time by pressing e at the grub menu to boot the system this time, and then go edit /etc/default/grub and run update-grub, and then you don't need a livecd at all.
Sorry, I didn't want to explain all the details because is hard and long.
I'm implementing a application of deployment and management of operating systems in my university.
This aplication have a little kernel that boot up before any operating system using PXE.
The HD have 3 operating systems (W7, WXP and Ubuntu10.10) and I have to be able to boot any operating sistems by the aplication. I can't boot the OS directly so I want to boot helped by the ubuntu's grub.
The partitions are mounted in this little kernel and I can change any file of them.
I think edit every time the file it's a good way because every time this aplication will go first and then the students will select what OS they want to use. The partitions will be frozen by deepfreeze so there will be no update-grub, and if there are any the file grub.cfg will by booted anyways.
Hello everyone, a question:
I found out that using the sudo update-grub from the terminal of
my first installation helped a lot in having two linux-distros
on the same harddisk.
The only thing to mention should be just to not install grub when
installing your second linux-distro.
Just install it without putting a bootloader onto the harddisk (important!)
and run into your first linux and update grub and the partition with
your 2nd distro will be added and should work as desired.
Does someone of you did this also?
Did you experience any difficulties with that way?
For a time (and I believe still) in the recent Ubuntu releases the installer did not allow the option of not installing the Grub bootloader. It was reported as a bug, as many advanced users recognized the advantages of not installing a second Grub 2.
One workaround was to install it to a flash drive and then just make sure the system boots off the internal hard drive first.
When you do have Grub installed on more than one drive, it can get confusing as to which one is controlling. I help myself by using a different background image for each Grub's boot menu, but you can also determine which one controls since it will place it's OS at the top of the list (if you haven't modified the /etc/grub.d script names).
Last edited by drs305; July 24th, 2011 at 08:08 PM.