Using pv-grub to run custom kernels overview

The pv-grub kernel option allows your slice to boot from your own kernel instead of one of ours.


What is pv-grub?

Normally the kernel running on your server is selected by the virtualization layer that creates your VPS instance (in our case, a program called "Xen"). That means your kernel is not in your VPS filesystem.

If you tell Xen to use a feature called "pv-grub" (by contacting support through the SliceManager) you can change that behavior. Instead of the virtualization layer selecting your kernel from its own list it will look for the kernel on the VPS filesystem. That kernel can be a distribution's stock kernel (with Xen support enabled) or it can be one you've compiled yourself.

There are several changes that need to be made in order to make pv-grub work with your system. We cover those changes in this article series.

Contents

The first part of the series introduces pv-grub and walks through the initial changes to the system necessary for pv-grub to work.

• Explaining pv-grub

• Warning

• Kernel config

• Using a stock kernel

• Installing the kernel package

• Configuring the grub menu

• Adding the TTY device

In the second part of the series we look at enabling pv-grub and how to troubleshoot it if necessary.

• Final configuration changes

• Open the web console

• Enable pv-grub

• Check the results

• Troubleshooting

• Rescue mode

• Command summaries

Distribution links

Links to the articles for each distribution follow.

To access the article that corresponds to the Linux distribution running on your slice, click the appropriate link below:

Ubuntu - part 1:  Using pv-grub to run custom kernels on Ubuntu - preparing the slice

Ubuntu - part 2:  Using pv-grub to run custom kernels on Ubuntu - enabling and troubleshooting

Debian - part 1:  Using pv-grub to run custom kernels on Debian - preparing the slice

Debian - part 2:  Using pv-grub to run custom kernels on Debian - enabling and troubleshooting

CentOS - part 1:  Using pv-grub to run custom kernels on CentOS - preparing the slice

CentOS - part 2:  Using pv-grub to run custom kernels on CentOS - enabling and troubleshooting

Fedora - part 1:  Using pv-grub to run custom kernels on Fedora - preparing the slice

Fedora - part 2:  Using pv-grub to run custom kernels on Fedora - enabling and troubleshooting

RHEL - part 1:  Using pv-grub to run custom kernels on RHEL - preparing the slice

RHEL - part 2:  Using pv-grub to run custom kernels on RHEL - enabling and troubleshooting

Arch - part 1:  Using pv-grub to run custom kernels on Arch - preparing the slice

Arch - part 2:  Using pv-grub to run custom kernels on Arch - enabling and troubleshooting

Gentoo - part 1:  Using pv-grub to run custom kernels on Gentoo - preparing the slice

Gentoo - part 2:  Using pv-grub to run custom kernels on Gentoo - enabling and troubleshooting

Kernel config

More advanced users may just want the skinny on what's required for a custom kernel. This section is for them. If you want to start with a stock kernel (recommended, since that gets you a kernel for pv-grub that you know works and lets you tinker from there), dive into the articles.

The important points to keep in mind:

Use Xen config options. You can narrow down the ones you absolutely need by running a "make localmodconfig" to generate an initial config file based on the kernel you're already running on your VPS, or get the config for your current kernel from /proc/config.gz.

Use gzip compression for the kernel. There are problems trying to load a kernel that's been compressed with bzip or LZMA through pv-grub. Make sure to set the compression type in the config to "gzip". Alternately, the uncompressed "vmlinux" version of the kernel will work with pv-grub (found in the root of the kernel source directory after compiling).

Change the TTY. Details on the changes that need to be made to enable the different TTY device are in the articles (usually hvc0 or xvc0, depending on the distribution). Remember to make sure the new TTY device is in /etc/securetty too.

Change the fstab. The disk devices change when using pv-grub, so before booting with pv-grub the /etc/fstab file will need to be updated to reflect the new device names (from /dev/sda to /dev/xvda).

Other interface names change. This generally is not an issue if your kernel has udev enabled, but you should skim the articles and check for changes to module aliases just in case.

Set up /boot/grub/menu.lst. Instructions for setting up the menu.lst file are listed in the articles. You won't be able to boot with pv-grub unless there's a menu.lst file telling pv-grub what kernel choices are available.

Further reading

The kernel is a complex subject, so if you want to do any serious kernel tweaking it's best to check the documentation for your distribution as well as the docs at the official kernel archive site.

For more information on obtaining the source packages and patches for the kernels we usually make available, take a look at this article on the subject of our kernel source repository.

  • -- Jered
Want to comment?


(not made public)

(optional)

(use plain text or Markdown syntax)