DebianThis forum is for the discussion of Debian Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
before debian started using grub2 it was very easy to specify a loader from another partition but since grub2 came out it's a lot more complicated, you can no longer edit a text document menu.list, is there an easy way to edit the grub2 boot-loader to boot FreeBSD operating system since it doesn't recognize it from update-grub
Distribution: Debian Testing, Stable, Sid and Manjaro, Mageia 3, LMDE
Posts: 2,628
Rep:
All you need to do to edit the grub.cfg file is put the entry you want in your /etc/grub.d/40_custom file and run, as root;
Code:
update-grub
if you run, again as root;
Code:
grub-mkconfig
it will print your grub.cfg file out there on your monitor so that you can check it.
I am afraid I know nothing about bsd and so I haven't a clue as to the menu entry to use. It will have to be in this format;
code]
echo "Adding Xubuntu 11.04B1 ISO on sda9" >&2
cat << EOF
menuentry "Xubuntu 11.04B1 ISO on /dev/sda9" {
loopback loop (hd0,9)/etc/aa/natty-desktop-amd64.iso
linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=/etc/aa/natty-desktop-amd64.iso noprompt
initrd (loop)/casper/initrd.lz
}
EOF
[/code]
That is an entry for an Ubuntu LiveCD ISO. The parts in the "" you can have as anything you want.
The first on the "echo" line is what you see in terminal with "update-grub". The second in the "menuentry" line is what you see on your screen menu.
It is the stuff between the {}s that you need to get right. The only thing that my example can do along that line is to show where the {}s MUST be in relation to the entry.
Distribution: Debian Testing, Stable, Sid and Manjaro, Mageia 3, LMDE
Posts: 2,628
Rep:
This is very good news.
I believe that you are right about the entry working for OpenBSD. They would have to be doing something quite different for it to not work.
The new grub takes a bit of getting used to but it is more flexible and easier to bring up to date as new storage devices, file systems and so forth come on line.
You could start a new document "08_custom", copy your entry from 40_custom to it, delete the entry in 40_custom. This would put it higher up the process list and on top of your menu.
If you had a 07_custom with your Linux installs in it you could change the permissions of all your grub scripts starting with 10_linux up so that they did not execute. This speeds up grub as all those are no longer needed.
I use "symbolic" menu entries for all my Debian based installs. These just call for the newest kernel in the defined partition. They look like this;
Code:
echo "Adding Squeezy on sda9" >&2
cat << EOF
menuentry "Squeezy on sda9" {
set root=(hd0,9)
linux /vmlinuz root=/dev/sda9 ro quiet splash
initrd /initrd.img
}
EOF
echo "Adding Lounge on sda13" >&2
cat << EOF
menuentry "Lounge on sda13" {
set root=(hd0,13)
linux /vmlinuz root=/dev/sda13 ro quiet
initrd /initrd.img
}
EOF
Note that I could install any Debian based OS on either of those partitions and not change the menu entry at all. True, the title would be wrong. What ever kernel was on the partition would boot though.
This is what I think the grub folks have in mind for people to do if they want a low or no fuss boot loader.
As a note. The Lounge entry is for Ubuntu 10.04, known here as Lounge Lizard, has no "splash" in the instruction string as plymouth will not allow me to boot if the splash is active. That is why there is that difference.
Without the other scripts executable I have no recovery option. This is not a problem. If you need it simply hit e and your highlighted entry is then editable. Remove the instructions "quiet splash" and replace with "single". Hit Ctrl+x to boot.s
The entries in 07_custom will appear on the screen menu above those in 08_custom. If you want that reversed just rename 07_custom to 09_custom (08 to 06 would work too).
ANY/ALL changes to your grub.d directory must be followed by running "update-grub".
debian based distros (which is most installs fedora/redhat and bsd based installs aren't very commonly used) can automatically be loaded with the
Code:
#update-grub
command same goes for windows, it will detect and find the os, on one condition that grub needs to be installed on that particular linux partition before you install it to the mbr again to run the update command with the os you choose to be your main os (mostly the distro you installed first)
Last edited by baronobeefdip; 04-10-2011 at 12:40 PM.
Distribution: Debian Testing, Stable, Sid and Manjaro, Mageia 3, LMDE
Posts: 2,628
Rep:
Quote:
Originally Posted by baronobeefdip
debian based distros (which is most installs fedora/redhat and bsd based installs aren't very commonly used) can automatically be loaded with the
Code:
#update-grub
command same goes for windows, it will detect and find the os, on one condition that grub needs to be installed on that particular linux partition before you install it to the mbr again to run the update command with the os you choose to be your main os (mostly the distro you installed first)
Yes they will and usually the RH ones too (getting better anyway). That is great on a first boot. After that it is kind of slow coming up because the /boot/grub/grub.cfg file is just too big. Update grub also takes too long every time it needs run (grub_pc, grub-common or kernel updates). Every script in /etc/grub.d gets run at that time.
You can see this easily if you look at the grub.cfg file in full. Easiest done by as root;
Code:
grub-mkconfig
That is 7 (or 8 if you got an update that you did not allow to over write a previous version of one of them) scripts that have to be run each time you run update grub and a much larger grub.cfg file that must be read to load your screen menu. If you put all your entries in one custom file and disable the scripts above it (the higher the number the later it gets run) then you only have 3 scrips that need run at update-grub and a much shorter grub.cfg file that must be read.
I use 3 custom files because I change things around quite a bit. One for my main drive, one for sdb and one for ISO entries. That way if I am not fooling around with Ubuntu (nice play OS) or looking at the ISO booted OS' but just using the 3 installs on my main I can shorten the grub time by disabling 2 scripts. Most folks only need one but how ever you go it is snappier.
When Ubuntu 9.10 testing was going on they sprang grub2 on us at Alpha2 with no documentation to speak of anywhere. The next two weeks were really interesting. That version of grub would not reliable boot from installs on / and /home, just off installs on /. Made figuring out what was wrong even more fun. We also spent a lot of time editing the grub.cfg file directly which is fine until the nest time update-grub is run (we were getting 3-4 kernel updates a week, sometimes more than 1 a day). FUN times.
As you can see I have a very long time out. I like to have the option of reading what is, at times, a very long menu.
Setting the time out at 0 will leave you with no time out. I really do like to be able to see the menu so I would, personally, leave it at 3 or less so you have the option of hitting a key and stopping the time out. If you are fast even 1 will leave you that option.
As with ALL changes to grub, update-grub must be run to set the change in place.
Distribution: Debian Testing, Stable, Sid and Manjaro, Mageia 3, LMDE
Posts: 2,628
Rep:
Quote:
Originally Posted by baronobeefdip
when you say no time out do you mean the menu will show until i choose an os
No. The time out lasts until booting the default menu entry (also set in that file - counting starts with 0). If you set it to 0 you will not see the menu.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.