Linode Forum Index Linode Forum
Linode Community Forums
 


How-to run the stock Arch Linux kernel (3.x) on Linode

Click here to go to the original topic

 
       Linode Forum Index -> Linux Tips, Tricks, Tutorials
Author Message
brianp



Joined: 22 Sep 2011
Posts: 6

Posted: Tue Jan 31, 2012 3:54 pm    Post subject: How-to run the stock Arch Linux kernel (3.x) on Linode  

The 3.x series linux kernel includes the xen modules. This makes it easier than ever to run the stock Arch Linux kernel on your linode.

I plan to write up a less techie version for the library, but here are the steps.

First, make sure your Arch linux linode is completely up to date!

There are a few recent upgrades that require some intervention so be sure to check out the www.archlinux.org page - specifically for the initscripts and filesystem package updates.

Your system is up to date when you run pacman -Syu and it says "there is nothing to do".

Code: $ sudo pacman -Syu
:: Synchronizing package databases...
 core is up to date
 extra is up to date
 community is up to date
:: Starting full system upgrade...
 there is nothing to do


Also as you go through and edit the files below it is always a good idea to make a backup copy in case you need to change it back.

Once you are up to date here are the steps to change to running the stock Arch kernel. The commands below are using "sudo" but if you log in as root just remove the "sudo" from them.

1) Install the kernel and grub
Code: sudo pacman -Sy linux grub --noconfirm

2) Add the Xen Modules to the mkinitcpio.conf file
Code: sudo sed -i 's/MODULES=""/MODULES="xen-blkfront xen-fbfront xenfs xen-netfront xen-kbdfront"/g' /etc/mkinitcpio.conf

If the command above scares you, what you want to do is make sure that the following modules are in the MODULES line of the /etc/mkinitcpio.conf file: xen-blkfront xen-fbfront xenfs xen-netfront xen-kbdfront

You can do that using whatever editor you are comfortable with.

3) Re-create the kernel/initramfs
Code: sudo mkinitcpio -p linux

4) Edit /boot/grub/menu.lst so that the (0) Arch Linux entry matches the following:
(pay close attention to the root (hd0) - by default it is (hd0,0) and this will fail)

Code: # (0) Arch Linux
title  Arch Linux  [/boot/vmlinuz-linux]
root   (hd0)
kernel /boot/vmlinuz-linux root=/dev/xvda ro
initrd /boot/initramfs-linux.img



5) Edit the /etc/fstab (see the note above about backing up files!) to match the below:

Code: # <file system> <mount point>   <type>  <options>                   <dump>  <pass>
proc            /proc           proc    defaults                    0    0
/dev/xvda       /               ext3    defaults,noatime,barrier=0  0    1
/dev/xvdb       swap            swap    defaults                    0    0
xen             /proc/xen       xenfs   defaults                    0    0
devpts          /dev/pts        devpts  defaults                    0    0

*** Pay close attention to the /dev/xvda line - if you leave the errors=remount-ro in there your system will be read-only


6) Update the kernel in Linode Control Panel to be pv-grub

Go to your Linode's dashboard and edit the Configuration Profile of the Linode, selecting the right "pv-grub" 32/64 bit for your linode.

See the Library article on pv grub for more info.

7) reboot (via control panel)

8) login and test

If you have trouble, change the configuration profile back and/or access the console.

You can always clone your Linode and try this on the clone first.
Back to top  
mnordhoff



Joined: 03 May 2008
Posts: 451

Posted: Wed Feb 01, 2012 4:54 pm    Post subject: Re: How-to run the stock Arch Linux kernel (3.x) on Linode  

brianp wrote: *** Pay close attention to the /dev/xvda line - if you leave the errors=remount-ro in there your system will be read-only
As someone who does not use Arch or pv-grub, why are there fs errors? o_O
Back to top  
brianp



Joined: 22 Sep 2011
Posts: 6

Posted: Wed Feb 01, 2012 5:17 pm    Post subject: Re: How-to run the stock Arch Linux kernel (3.x) on Linode  

mnordhoff wrote:
As someone who does not use Arch or pv-grub, why are there fs errors? o_O

There aren't fs errors in the traditional sense of fs errors, but I think it mounts read only because the modules are actually a newer version of xen than what is being used in the host kernel.
Back to top  
isaacwhanson



Joined: 20 Jan 2012
Posts: 3

Posted: Mon Feb 27, 2012 10:35 am    Post subject:  

Note this will only work with the x86_64 kernel, not the i686 because the xen modules are not included in the i686 ARCH kernel.
Back to top  
isaacwhanson



Joined: 20 Jan 2012
Posts: 3

Posted: Mon Feb 27, 2012 10:36 am    Post subject:  

Note this will only work with the x86_64 kernel, not the i686 because the xen modules are not included in the i686 ARCH kernel.
Back to top  
brianp



Joined: 22 Sep 2011
Posts: 6

Posted: Mon Feb 27, 2012 5:34 pm    Post subject: 32-bit  

Yes - for 32-bit you'll need to use the linux-xen package from AUR. Sorry I didn't mention that before!
Back to top  
Zr40



Joined: 05 May 2011
Posts: 22

Posted: Thu Mar 01, 2012 5:08 pm    Post subject:  

Is there a practical advantage to using the stock Arch kernel instead of the kernel provided by Linode?
Back to top  
brianp



Joined: 22 Sep 2011
Posts: 6

Posted: Thu Mar 01, 2012 5:33 pm    Post subject:  

I don't know of any specific advantages/disadvantages. Arch being a rolling distro I do update the servers (first a development box so I can work through any potential issues).

While Arch runs nicely with a different kernel (such as Linode's provided one) - I feel that the userspace tools (kmod, udev, etc) should be as closely in step with the kernel as possible.

It just didn't sit well with me, them being updated and not the kernel.

The first time I did it though was because Linode had rolled out the 3.1 kernel and there was a bug that caused one of our servers to hang. They rolled back to 3.0 but I had already shifted that instance over to the pv-grub/instance-based kernel.
Back to top  
dfelicia



Joined: 30 Jul 2007
Posts: 77

Posted: Tue Mar 27, 2012 11:09 am    Post subject:  

Hmm. I rolled my own Arch using Oracle VirtualBox, dd'd the result, transferred to Linode running Finnix, then copied contents to /dev/xvda (formatted and mounted as ext3).

Note that I intentionally did not dd the image to /dev/xvda b/c that would have resulted in a "raw" linode disk with partition table, which would have precluded me from using their resizing tools, etc.

Anyway, I am not able to boot using pv-grub. Gub config loads, but when I try to boot the selection it says something like "Using whole disk" followed by "File not found"

Any hints? I followed all of the steps, above.
Back to top  
dfelicia



Joined: 30 Jul 2007
Posts: 77

Posted: Tue Mar 27, 2012 11:34 am    Post subject:  

nm. typo in menu.lst

thanks for the write up!
Back to top  
 
       Linode Forum Index -> Linux Tips, Tricks, Tutorials
Page 1 of 1