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".

$ 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

sudo pacman -Sy linux grub --noconfirm

2) Add the Xen Modules to the mkinitcpio.conf file

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

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)

# (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:

# <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</pass></dump></options></type></mount></file> 

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.

21 Replies

@brianp:

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

@mnordhoff:

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.

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.

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.

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

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

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.

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.

nm. typo in menu.lst

thanks for the write up!

@Zr40:

Is there a practical advantage to using the stock Arch kernel instead of the kernel provided by Linode?
I think it is much more practical to use the kernel provided by Linode, as it is the Best Business Web Hosting, but I know many people use the stock Arch kernel with no issues. Did you ever get a good response regarding the practical advantage of one or the other? Thanks.

@barrymorgan88:

@Zr40:

Did you ever get a good response regarding the practical advantage of one or the other? Thanks.
No, but the Arch kernel gets updated very frequently. Pretty annoying on a server b/c you don't want to be rebooting all the time. I think Linode's kernel is more practical from a sysadmin perspective.

Has anyone in recent days had trouble during a reboot?

I used this tutorial to get up and running a few months ago.

Yesterday, I performed an update (which included the kernel to linux-lts 3.0.33), and now I'm getting errors on reboot. I tried downgrading to my previous kernel, but it didn't help.

Booting 'Arch Linux  [/boot/vmlinuz-linux]'                                                       

root   (hd0)                                                                                        
 Filesystem type is ext2fs, using whole disk                                                        
kernel /boot/vmlinuz-linux-lts root=/dev/xvda ro                                                    
initrd /boot/initramfs-linux-lts.img                                                                

close blk: backend at /local/domain/0/backend/vbd/1407/51712                                        
close blk: backend at /local/domain/0/backend/vbd/1407/51728                                        
[3194139.200651] i8042: No controller found                                                         
[3194139.242638] drivers/rtc/hctosys.c: unable to open rtc device (rtc0)                            
:: running early hook [udev]                                                                        
:: running hook [udev]                                                                              
:: Triggering uevents...                                                                            
Waiting 10 seconds for device /dev/xvda ...                                                         
ERROR: device '/dev/xvda' not found. Skipping fsck.                                                 
ERROR: Unable to find root device '/dev/xvda'.                                                      
You are being dropped to a recovery shell

Hi Guys,

I'm trying to get my arch linux working on linode however after a week of trying I'm close to give up…

I have followed tourtorials from here:

~~[http://library.linode.com/linode-platform/custom-instances" target="_blank">](http://library.linode.com/linode-platfo … -instances">http://library.linode.com/linode-platform/custom-instances](

and read through this:

~~[http://articles.slicehost.com/2010/10/27/using-pv-grub-to-run-custom-kernels-on-arch-preparing-the-slice" target="_blank">](http://articles.slicehost.com/2010/10/2 … -the-slice">http://articles.slicehost.com/2010/10/27/using-pv-grub-to-run-custom-kernels-on-arch-preparing-the-slice](

xen for arch linux:

~~[https://wiki.archlinux.org/index.php/Xen#ArchasXenguest.28PVHVMmode.29" target="blank">](https://wiki.archlinux.org/index.php/Xe … VM_mode.29">https://wiki.archlinux.org/index.php/Xen#ArchasXenguest.28PVHVM_mode.29](

And after all grub does not let me boot (booting process stops on grub).

I booted to rescue mode and chrooted to my drive (xvdb in my case) and tried to run install-grub (now I know it is rather not very wise on XEN)

Anyway my kernel does support XEN, all modules are modprobed, I'm in the forrest and can not find the way out.

Please anyone with good heart - have mercy and help…

Hey,

When you boot up your Linode, what's it saying in LISH?

I have moved one step further (I can't understand why though… the only change I have done was to unmount all drives except root from linode properties)

I get this first:

******************* BLKFRONT for device/vbd/51728 **********                                        

backend at /local/domain/0/backend/vbd/514/51728                                                    
Failed to read /local/domain/0/backend/vbd/514/51728/feature-flush-cache.                           
10240000 sectors of 512 bytes                                                                       
**************************                                                                          

    GNU GRUB  version 0.97  (524288K lower / 0K upper memory)                                       

 +-------------------------------------------------------------------------+                        
 | Arch Linux - vmlinuz-linux-lts-xen                                      |                        
 |                                                                         |                        
 |                                                                         |                        
 |                                                                         |                        
 |                                                                         |                        
 |                                                                         |                        
 |                                                                         |                        
 |                                                                         |                        
 |                                                                         |                        
 |                                                                         |                        
 |                                                                         |                        
 |                                                                         |                        
 +-------------------------------------------------------------------------+                        
    Use the ^ and v keys to select which entry is highlighted.                                      
    Press enter to boot the selected OS, 'e' to edit the                                            
    commands before booting, or 'c' for a command-line.                                             

And then

Booting 'Arch Linux - vmlinuz-linux-lts-xen'                                                      

root   (hd1)                                                                                        

Error 21: Selected disk does not exist                                                              

Press any key to continue...  

When I press 'e' for editting options I get:

GNU GRUB  version 0.97  (524288K lower / 0K upper memory)                                       

 +-------------------------------------------------------------------------+                        
 | root   (hd1)                                                            |                        
 | kernel /boot/vmlinuz-linux-lts-xen root=/dev/xvdb console=hvc0 ro       |                        
 | initrd /boot/initramfs-linux-lts-xen.img                                |                        
 |                                                                         |                        
 |                                                                         |                        
 |                                                                         |                        
 |                                                                         |                        
 |                                                                         |                        
 |                                                                         |                        
 |                                                                         |                        
 |                                                                         |                        
 |                                                                         |                        
 +-------------------------------------------------------------------------+                        
    Use the ^ and v keys to select which entry is highlighted.                                      
    Press 'b' to boot, 'e' to edit the selected command in the                                      
    boot sequence, 'c' for a command-line, 'o' to open a new line                                   
    after ('O' for before) the selected line, 'd' to remove the                                     
    selected line, or escape to go back to the main menu.                                           

My root (and boot) is on /dev/xvdb (so it should be (hd1) on /boot/grub/menu.lst?)

Would be nice if there is some workaround to that problem..

Thanks a lot,

Greg

@gallius:

My root is on /dev/xvdb (so it should be (hd1) on /boot/grub/menu.lst?)

But your /boot is on /dev/xvda (I assume), right? If so, try (hd0) and see what happens.

Hmm, on 'block device assignment' I have mounted it on /dev/xvdb…

No, I'm talking about your /boot partition not your / (root) partition. If you don't have a separate /boot partition though, why are you putting / on /dev/xvdb? What do you have on /dev/xvda?

Yup, I don't have separate partition for boot.

At the moment I have changed config to have /dev/xvda only and I'm booting to rescue mode to change fstab and menu.lst accordingly.

So at the moment my /boot/grub/menu.lst looks like:

# (4) Arch Linux                                                                                    
title  Arch Linux - vmlinuz-linux-lts-xen                                                           
root   (hd0)                                                                                        
kernel /boot/vmlinuz-linux-lts-xen root=/dev/xvda console=hvc0 ro                                   
initrd /boot/initramfs-linux-lts-xen.img

and my /etc/fstab:

`#                                                                                                   
# /etc/fstab: static file system information                                                        
#                                                                                                   
#` 

<dir> `<type><options>$                    
tmpfs           /tmp            tmpfs   nodev,nosuid,noexec,mode=1777          $                    
#tmpfs          /tmp            tmpfs   nodev,nosuid                           $                    
/dev/xvda       /               ext3    defaults,noatime                       $                    
/dev/xvdb       none            swap    defaults                               $</options></type>` 

Ok, so I have shut down the linode, waited 5 mins and booted it again. It stops on grub menu and after trying to boot I get:

`
Booting command-list

root (hd0)
Filesystem type is ext2fs, using whole disk
kernel /boot/vmlinuz-linux-lts-xen root=/dev/xvda console=hvc0 ro
initrd /boot/initramfs-linux-lts-xen.img

can only boot x86 64 kernels, not xen-3.0-x86_32p

Error 13: Invalid or unsupported executable format

Press any key to continue…

and that's strange because my root is on ext3 (and not on ext2)

I'm on:

uname -a (from my virtual box with the same root partition)

Linux 3.0.31-1-lts-xen i686

````

I have seen some posts saying that XEN have problems booting from compressed kernel, do you think that might be the case?

fstab and menu.lst seem be ok as I can boot from linode kernel…

```

In the configuration profile there's a kernel selection for pv-grub-x8632 and another one for pv-grub-x8664. Make sure you're using the right one.

Might be that I have chosen 32 and not 64…

Unfortunately still no success though, this time I'm having:

> Booting 'Arch Linux - vmlinuz-linux-lts-xen'

root (hd0)

Filesystem type is ext2fs, using whole disk

kernel /boot/vmlinuz-linux root=/dev/xvda ro

initrd /boot/initramfs-linux.img

ERROR Invalid kernel: elfxennote_check: ERROR: Will only load images built for the generic loader

or Linux images

xcdomparse_image returned -1

Error 9: Unknown boot failure

Press any key to continue…

I feel it's getting closer but still no success.

Thanks for your help anyway :-)

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct