|
From: | Tom Oakes |
Subject: | Re: Default Grub legacy menu.lst to Grub2 grub.cfg |
Date: | Tue, 08 Jan 2013 10:26:59 -0700 |
User-agent: | Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.2.13) Gecko/20110202 Thunderbird/3.1.7 |
I have appended my original email to the end of this message as I
think it is necessary for understanding my problem if others have
suggestions. My Disk does have a MBR with Grub 1.98 installed to access the /boot/grub directory of the ubuntu system installed in /dev/sdb5, which is in the extended partition /dev/sdb3. The ubuntu boots with no problem from the installed Grub2 system. I have two basic questions: 1. Is correct that it necessary for the Grub2 MBR to be access Grub files installed in a separate partition in order for it to boot freeBSD? 2. If it is necessary, can it be a partition in an extended partition? A third question is what code needs to be in grub.cfg for booting the freeBSD? On 01/07/13 14:05, Chris Murphy wrote: I posted the following to the freeBSD forum and received a single reply shown below the original post.I'm not sure about Ubuntu 12.10 (current) but 12.04 and Linux Mint 13 have a positively ancient version of GRUB2, it's not the release 2.00. So I suggest you get a release version of 2.00, either building it yourself from current source or snag the RPM from Fedora 18. Maybe what's confusing are the parts of grub. There's a grub package that includes a bunch of scripts and .mod files, which are platform specific. When you run grub-install, it causes the *.mod files to be created/replaced, a new core.img created, which is then placed into one of three locations. Is the partition scheme MBR or GPT? I'm going to guess this is BIOS, not UEFI, hardware in which case the default is probably MBR. If the 1st partition start sector is 2048 you have a ~1MB gap between the MBR at LBA0, and LBA2048 where the first partition starts. And GRUB's core.img goes in that gap. If you're using GPT, you need a 1MB BIOS Boot partition into which GRUB's core.img will go. For UEFI, it'll go on the EFI System partition. In any case, these locations are found automatically by grub-install. For BIOS, technically there are two parts: the part that fits into the first 440 bytes of LBA 0, which is merely code to jump to, load, and run core.img which is in the MBR gap, or the BIOS Boot partition on GPT disks. That core.img code has a PREFIXED baked into it, so it can find the rest of GRUBs modules, the *.mod files, and also the grub.cfg. At that point is when you see the menu. So this statement:Quote: Grub is installed in /boot/Grub in the utuntu file systemis true, and fine. It's not a mistake. If you are going to use GPT, I suggest using gdisk (atp-get gdisk I'm guessing for Ubuntu). It doesn't matter where the 1MB partition is for BIOS boot, it's identified by grub-install by its GUID. The gdisk type code for this is EF02. If you use parted, you set a bios_grub flag on the 1MB partition to do the same thing. This idea of a 512MB partition for GRUB makes no sense to me. This partition for GRUB only doesn't contain anything but GRUB's core.img which is usually around 32KB. It's tiny. If you use LVM or Btrfs then it gets bigger, but still way less than 100KB. So 1MB is recommended for padding and to keep subsequent partitions aligned in the event they're 512e AF disks with 4K physical sectors. As for the FreeBSD menu entry, I'm pretty sure the current GRUB 2 release's grub-mkconfig will find it, and create the proper menu entry in the grub.cfg. Now, it's not exactly obvious how you install grub if you're not already booted from the disk you're going to install it to, i.e. if you've booted from a live cd or something. You need to mount that OS's partitions, and I use mount -o bind for /proc, /sys, and /dev. I always forget which two are needed by grub-install so I just do all three. Then chroot that. Then 'grub-install /dev/sda' or whatever; then 'grub-mkconfig -o /boot/grub/grub.cfg'. Done. Chris Murphy The reply said that I need to install Grub in a separate partition. Will that really fix the problem? Can the separate partition be in an extended partition containing Ubuntu 12.04? I don't understand why a separate partition will fix the problem. The Grub manual says that Grub runs before the OS starts. It also says in the instructions for installing grub in a separate partition to format the partition with a file system. The advantage for installing Grub in the separate mentioned is that it does get messed up if/when you upgrade your operating system containing /boot/Grub. All this make me wonder if a separate partition won't solve the problem. I did, in trying different things, upgrade Ununtu, and Grub2 now starts instead of Grub-legacy so I have lost the ability to boot freeBSD from the hard disk. I think I need to reinstall Grub-legacy in the MBR. How do I do that? I think see direction for that but do not recall where I saw them. I can still boot freebsd with a CD. Thanks for any answers and help, Tom address@hidden
|
[Prev in Thread] | Current Thread | [Next in Thread] |