@5littlejoe5
Update: I should have read and went to JohnRaf's link above before I posted. https://help.ubuntu.com/community/Grub2 It's 100 times better than the grub2 manual or what I wrote below. I'll still leave my post mostly intact.
To find where grub2 is installed (should be Crunchbang) type in exactly don't substitute the device "sudo grub-probe -t device /boot/grub" To find the UUID number type in "sudo grub-probe -t fs_uuid /boot/grub".
Here is the part of grub.cfg that starts your computer. Replace the UUID and block numbers and put back into grub.cfg to see if it works. There should be no other entries in this block. As soon as you get Crunchbang booted up, run sudo update-grub.
### BEGIN /etc/grub.d/10_linux ###
menuentry "CrunchBang Linux, with Linux 2.6.32-5-686" --class crunchbang --class gnu-linux --class gnu --class os {
insmod ext2
set root='(hd0,2)'
search --no-floppy --fs-uuid --set afbf0da6-1f35-4389-827e-2bff41f58d16
echo Loading Linux 2.6.32-5-686 ...
linux /boot/vmlinuz-2.6.32-5-686 root=UUID=afbf0da6-1f35-4389-827e-2bff41f58d16 ro quiet
echo Loading initial ramdisk ...
initrd /boot/initrd.img-2.6.32-5-686
}
menuentry "CrunchBang Linux, with Linux 2.6.32-5-686 (recovery mode)" --class crunchbang --class gnu-linux --class gnu --class os {
insmod ext2
set root='(hd0,2)'
search --no-floppy --fs-uuid --set afbf0da6-1f35-4389-827e-2bff41f58d16
echo Loading Linux 2.6.32-5-686 ...
linux /boot/vmlinuz-2.6.32-5-686 root=UUID=afbf0da6-1f35-4389-827e-2bff41f58d16 ro single
echo Loading initial ramdisk ...
initrd /boot/initrd.img-2.6.32-5-686
}
### END /etc/grub.d/10_linux ###
Grub’s menu for grub 1.98
( http://www.gnu.org/software/grub/manual/grub.html )
To change the menu so that Mint loads first, you "sudo gedit /etc/default/grub" and change the GRUB_DEFAULT=0 line to GRUB_DEFAULT=2 or whatever menu line Mint is on (see below). Then, you type "sudo update-grub" to make the changes. When menu comes up, the default you have chosen will be selected and loaded automatically but will not be at the top.
The UUID's of a partition don't change unless you have somehow changed the size of them with some utility - that's why linux is going to UUID's. Grub2 is pretty smart. I believe the only problems that grub2 now has is if you have 1 Ide and 1 eSata drive and you have the eSata drive as primary. This can be fixed by editing the map files. The more you use the UUID's, the more accurate grub will be because it won't have to guess. In my case I had a primary hard drive failure. I plugged up my secondary drive to the primary connections and did not have any problems with any of the distros. The UUID's have been in play now every since the Hardy distro so you shouldn't have many UUID's to change. You shouldn't be doubting a UUID and changing it to block device numbers unless you used some kind of utility to change the size of that partition.
================= MAIN PART - READ THIS FIRST IF SHORT ON TIME
Do you still have grub-legacy on your mint installation? You can go into Synaptic and lookup grub to make sure you installed grub-pc and grub-common and not grub-legacy. I noticed that you have mint on /dev/sda3 and crunchbang on /dev/sda2. Did you install mint after you installed crunchbang? What type of grub update did you do on mint? Personally, I would just re-install Crunchbang on the same installation and then install grub2 on the root drive or use your livecd to reinstall grub2 to Crunchbang. It's best to use a livecd because changes to the MBR of a root drive is not good while using that hard disk.
What you could try is to get the UUID of the Crunchbang partition by using "blkid", get the kernel number by connecting to the Crunchbang partition and through /media or /mnt, etc go to Crunchbang's /boot directory and write down the kernel number. I believe it is 2.6.32-5-686. Next, reboot and when the menu comes up, press "e" to edit. Substitute the UUID numbers and the kernel numbers and the '(hd0,2)' block device, and then type in "Control-X" to boot. If the system boots up, bring up a terminal and type "sudo update-grub". In the example below on adding manual setups, I entered what I think the kernel will be and the block numbers if crunchbang is on /dev/sda2.
Good Luck
====================
TO ADD MANUAL SETUPS TO GRUB:
Even if your system is working just fine, you still can add extra setups just for practice and to learn how to do it. Copy your 40_custom to a new 07_custom directory with the p option to preserve all the attributes so it will work. Now anything you put in 07_custom will come up first on your menu.
If you leave it empty it's fine too. You can still put menu items in 40_custom but they will come up last. You can sudo gedit /etc/default/grub and Uncomment #GRUB_DISABLE_OS_PROBER="true" and then there would only be your custom menu and then the menu item for that machine. The trouble with this is that you would have to change that back anytime you add a distro or make changes so grub would pick up the new information.
sudo cp -p /etc/grub.d/40_custom /etc/grub.d/07_custom
Open up grub.cfg in read-only mode just to copy your menu items exactly as they should be.
gedit /etc/default/grub/grub.cfg
Open up your 07_custom file to put your customized menu in. After opening file, you can right click on the gedit tab and put in a new window so you easily transfer the items. I just copy all of the menu items and then move them around, put comments in front of the ones I don't want to show up, etc. Don’t mess with top 5 lines, just add your menu entries below them.
sudo gedit /etc/grub.d/07_custom
Example of what it may look like:
menuentry "Crunchbang" {
insmod ext2
set root='(hd0,2)'
search --no-floppy --fs-uuid --set 1f8d9520-61de-4a79-96d7-415643248c73
linux /boot/vmlinuz-2.6.32-5-686 root=UUID=1f8d9520-61de-4a79-96d7-415643248c73 ro
initrd /boot/initrd.img-2.6.32-5-686
}
menuentry "Mint 9, kernel 2.6.26-2-686 (on /dev/sda3)" {
insmod ext2
set root='(hd0,3)'
search --no-floppy --fs-uuid --set 1f8d9520-61de-4a79-96d7-415643248c73
linux /boot/vmlinuz-2.6.26-2-686 root=UUID=1f8d9520-61de-4a79-96d7-415643248c73 ro
initrd /boot/initrd.img-2.6.26-2-686
}
Save file and then run “ sudo update-grub” and then reboot.
Note: The first two menu items in grub.cfg (for that machine) have extra settings on them that the others do not, I copy exactly and they work fine in your custom menu also.
You said you were used to the old grub methods, here's something that has changed. You don't have to worry about this if you copy the setups from grub.cfg.
Grub2 numbers partitions starting with 1 whereas the old grub-legacy numbered them starting with 0. Example: (hd0,0) will now be a (hd0,1).
sda1 (hd0,1) used to be (hd0,0) to put on partition, on root it is (hd0) NOT CHANGED
sda2 (hd0,2) used to be (hd0,1)
sda3 (hd0,3) used to be (hd0,2)
The hdo partition number is now the same as the linux sdx numbers.
HOW TO EDIT THE GRUB CONFIG FILE
sudo gedit /etc/default/grub to make changes and then run ‘sudo update-grub’.
#Set for which menu choice you want to boot starting with 0,1,2,3,........
GRUB_DEFAULT=0 (0 for 1st menu choice, 1 for second menu choice, ........)
# Set for seconds for boot or set to negative number to disable boot
GRUB_TIMEOUT=-5
# Add any kernel additions you want to add here
GRUB_CMDLINE_LINUX_DEFAULT="quiet"
# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console
# Uncomment to disable generation of recovery mode menu entries (second entry)
#GRUB_DISABLE_LINUX_RECOVERY="true"
I tested this one, it only left out the recovery on the first menu item not on all the other partitions.
# Uncomment to disable grub from picking up setups from the other partitions.
#GRUB_DISABLE_OS_PROBER="true"
There are many more settings, check the manual.
Note: Command vol_id no longer exists, it was removed 2009-05-11 https://launchpad.net/ubuntu/+source/ud
gitf079968 . You can type "sudo blkid" or "ls -l /dev/disk/by-uuid" to see the device name and UUID.
Hope this helps your transition. Good Luck
Last edited by duck (2010-10-19 09:13:47)