21.7. Booting a New Linux Kernel or BSD with GRUB

If you have just compiled a new kernel and want to be able to use it, you will need to add a new GRUB boot option.

A similar process should be followed if you have both Linux and FreeBSD, NetBSD, or OpenBSD installed on your system and want to be able to choose one of them at boot time. To set this up, follow these steps:

1.
To boot a Linux kernel after compiling, copy its compressed kernel image file (usually found under the source directory at arch/i386/bzImage) to the /boot directory. It should normally be renamed to vmlinuz-xx.yy.zz, where xx.yy.zz is the kernel version number.

2.
On the main page of the GRUB Boot Loader module, click on the Add a new boot option link to go to the option creation form.

3.
Enter a unique name for your new kernel into the Option title field, such as linux-xx.yy.zz. Whatever you enter will appear in the GRUB menu at boot time.

4.
Set the Boot image partition field to Selected and choose the partition that contains your kernel from the list next to it. If the partition does not appear in the menu, you will need to choose Other instead and enter the disk and partition into the field next to it, in the hdX,Y format used by GRUB. For example, hd2,1 would be the second partition on BIOS drive 3.

5.
For Operating system to boot, select Linux kernel and enter the path to the kernel's compressed image file into the field next to it. To pass additional arguments to the kernel, enter them into the Kernel options field below it. For FreeBSD, you must also select Linux kernel and enter /boot/loader into the field. No additional kernel arguments are allowed. For NetBSD or OpenBSD, select Linux kernel as well and enter this:

–type=netbsd /netbsd-elf

6.
If the root directory on your system is mounted from a device that is not compiled into the Linux kernel (such as a SCSI disk or hardware RAID controller), you will need to create an initial RAM disk containing the kernel modules needed to access the root filesystem. The simplest way of determining if this is necessary is to look at other existing boot kernel configurations. To create an initial RAM disk file under the /boot directory for kernel version xx.yy.zz, you will need to run a command like

mkinitrd /boot/initrd-xx.yy.zz xx.yy.zz

and then set the Initial ramdisk file field to the path to the newly created file.

7.
Finally, click the Create button. As long as there were no errors detected in your input, you will be returned to the module's main page, which will now contain an additional icon for the new kernel.

8.
To boot into the new kernel, you will need to restart your system. When GRUB loads at boot time, it will display a menu of available boot options, from which you can select the newly added kernel. Be sure to watch the debugging output and error messages that the kernel displays while booting, so that if anything goes wrong you can diagnose the problem. If there is a problem, you may need to reboot and select the old kernel option, then use Webmin to fix the GRUB configuration.

Once you have created a new kernel boot option, you can edit it by clicking on its icon on the module's main page. On the editing form, any of the fields can be edited and the changes saved by clicking the Save button, or the kernel can be removed by clicking Delete instead. Always be careful editing any kernel configurations that you did not create yourself, as a mistake may make the system unbootable.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.216.149.94