You are not logged in.

#1 2011-02-13 02:45:02

tramusen
Member
Registered: 2010-08-25
Posts: 7

kernel panic booting Xen on btrfs-installed root - can't load FS

I installed the Xen packages today, and have things close to working, but can't quite figure out the last issue keeping things from working.  I am currently getting a kernel panic due to the root filesystem not loading.

I followed the wiki page on installing / to btrfs, and added the btrfs_advanced module to rc.conf.  btrfs-progs-unstable is instaled.  I am currently only working with a single disk, once I have things up and running I will add my mass storage devices.  Followed the Xen install until the GRUB configuration.  I did not make the tweaks to the python part, and I did install multilibs - running on x64

Here is some of the kernel panic text:
Kernel Panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)


fstab items:

/dev/sda / btrfs defaults,noatime,discard,ssd 0 0
/dev/sda /var/lib/btrfs-root btrfs defaults,noatime,discard,ssd,subvolid=0 0 0
/var/lib/btrfs-root/boot /boot none bind 0 0

Nothing else fancy there.

extlinux.conf:

PROMPT 1
TIMEOUT 0
DEFAULT arch

LABEL arch
  KERNEL /boot/vmlinuz26
  INITRD /boot/kernel26.img
  APPEND root=/dev/sda ro

LABEL arch-xen
  KERNEL mboot.c32
  APPEND /boot/xen-4.0.gz dom0_mem=1024M --- /boot/vmlinuz26-xen-dom0 root=/dev/sda ro console=tty0 /boot/kernel26-xen-dom0.img

I can boot into a standard kernel just fine with this setup, but Xen chokes.  Can someone point me in the right direction?  The extlinux.conf was lifted / modified from several places, one of which describing how to set things up for booting off of RAID.  For a lot of this I know just enough to be dangerous.  I am completely new to Xen.

Thanks

Last edited by tramusen (2011-02-13 03:50:37)

Offline

#2 2011-02-14 16:14:43

extofme
Member
From: here + now
Registered: 2009-10-10
Posts: 174
Website

Re: kernel panic booting Xen on btrfs-installed root - can't load FS

my desktop blew up (edit: hooray! i'm back!), im in lynx ATM while it rebuilds, otherwise i would quote your question properly :-)

you're not going to be able to add more devices to this btrfs array.  if you check the wiki page again, you'll see that mentioned in the first couple sentences; no bootloader available would be able to find the kernel at that point... syslinux can only operate on a single disk setup.

your setup looks fine, and as you said, you can boot from the regular kernel.  im not very familiar with xen, but the reason you can't boot it is because it's initramfs (if it even has one?) does NOT have the btrfs_advanced hook in it to perform some magic for you.  basically you need to pass `rootflags=subvol=__active` (or whatever the equivalent is for xen) to the kernel... that will do it.  your actual system is not in the "btrfs root"; it needs that mount option to correctly load the subvolume (__active) containing the system files. btrfs_advanced does this for you behind the scenes.

now... if the above doesn't work, you could try marking the __active subvolume as the default.  this will allow the xen kernel to mount it correctly _without_ any additional options.  HOWEVER, this will break mkinitcpio-btrfs/btrfs_advanced... im working on a huge update to this hook, but im pretty sure the current version expects the default to remain on the "btrfs root" (i didnt know about the `subvolid` mount option at the time i wrote it)

you can mark __active as default via:

# btrfs sub set <id> /

where <id> is the id corresponding to __active, found by `btrfs sub li /`.  you can set the "btrfs root" as the default again via:

# btrfs sub set 0 /

C Anthony

Last edited by extofme (2011-02-14 16:28:15)


what am i but an extension of you?

Offline

#3 2011-02-14 18:11:42

tramusen
Member
Registered: 2010-08-25
Posts: 7

Re: kernel panic booting Xen on btrfs-installed root - can't load FS

Thanks for the reply!

I have tried removing btrfs_advanced from the hooks list and running mkinitcpio for Xen dom0, then modifying the extlinux.conf as follows:

LABEL arch-xen
  KERNEL mboot.c32
  APPEND /boot/xen-4.0.gz dom0_mem=1024M --- /boot/vmlinuz26-xen-dom0 root=/dev/sda ro rootflags=subvol=__active console=tty0 /boot/kernel26-xen-dom0.img

While my default boot works (also removed the hook there) with the change, I was unsuccessful with Xen.

I also tried adding the root= and rootflags= portion to the first half, after the xen-4.0.gz part.  Neither did any good.  I am still trying to read up on extlinux / syslinux a bit to get a better understanding of what mboot.c32 is doing.

I have not yet tried specifying __active as the default, will do that in the next couple of hours when I have another work break.

Not sure if this is of any help, but just prior to the kernel panic error I noticed that it was unable to get a list of partitions.  Because I set the disk up to be consumed by the btrfs volume, does this mean that there isn't a partition table?  Could that be why there is a kernel panic, because Xen tries to get a partition list from a drive without a partition table?   Right now I am wondering if setting things up with GPT, a small EXT partition, and the remainder as btrfs might make Xen a little happier.  Not my preferred method, doesn't feel as clean, but I would try that if all else fails.  I could even resort to ext4 or some other file system, I don't yet know enough about btrfs to really take advantage of any of the features.  Since I haven't had a working linux box in a long time, I mainly wanted to try something new.

In terms of adding additional volumes, I am fine without having any other disks used alongside the SSD.  I am assuming it would still be possible to have additional btrfs volumes for data-only purposes (non-booting)?  I haven't yet decided how I want to configure things.  I have a 640GB WD Caviar Black that I intend to use for VM storage, and three Hitachi 2TB 7200rpm drives for data.  Not sure on the FS to use, and I don't know what would be best for the three 2TB: RAID5, or just using them independently, or using two in Raid1 with the third as an unmounted backup, or something else entirely.  I am kind of tempted to get another 640GB Caviar Black, set those two to Raid1, the two internal 2TB to Raid1, and then have the third 2TB and another 650+GB drive available to pop into the SATA cradle on the top of the case for backup purposes.  So many decisions!  Fortunately I don't have to think too much on that until I have a fully functioning system.

Offline

#4 2011-02-15 21:58:29

tramusen
Member
Registered: 2010-08-25
Posts: 7

Re: kernel panic booting Xen on btrfs-installed root - can't load FS

extofme wrote:

you can mark __active as default via:

# btrfs sub set <id> /

where <id> is the id corresponding to __active, found by `btrfs sub li /`.  you can set the "btrfs root" as the default again via:

# btrfs sub set 0 /

C Anthony

I gave this a shot, but encountered the same issue.  Was a bit surprised that __active was ID 256 rather than 1, but that was what was displayed.

From what I can tell, and I may be wrong, but I think Xen is finding things OK but that the dom0 is unable to find the root filesystem.  I see the first part of the Xen boot messages, lines with (Xen) at the start, and the kernel panic is happening after that point.  Not really sure either way.

Trying to reboot to non-Xen kernel, I had it crash to the ramfs prompt.  Booting to my 640gb backup OS drive, I tried using chroot and resetting the btrfs default subvolume, however it doesn't appear that that stuck.  I got dropped into the ramfs prompt again.  Is that the wrong way to try and fix this?

Is it worth pursuing using btrfs for my root partition in a Xen install?  I still really like the idea of building out a Xen host from Arch, and still am interested in btrfs, however I'm not sure if this is necessarily the best application, if maybe I should use one or the other since I am unfamiliar with both.  Alternatively I could install CentOS as the dom0 and Arch as a domU, though that isn't as appealing.  If I can figure out how to do this, on my own or with extensive help, I would be happier using Arch.

Would it be worth partitioning with an ext# partition at the front of the drive so I can use grub or grub2?

Offline

#5 2011-02-17 19:03:41

tramusen
Member
Registered: 2010-08-25
Posts: 7

Re: kernel panic booting Xen on btrfs-installed root - can't load FS

Ok, I started from scratch and followed a slightly different install procedure:
http://tincman.wordpress.com/2011/01/20 … os-system/

This worked well enough, and I have extlinux set up again, however I am getting a different error now.  When I try to load Xen, extlinux first states that the dom0 kernel failed to load, and then returns "No Files Found!'  Glancing at the source, the no files bit is due to there not being any modules to load?  But I'm not sure if the issue is that, or the kernel.

Only change to the APPEND line posted above is root=/dev/sda2 instead of root=/dev/sda.  I tried this with and without the rootflag setting the subvolume, no change.

Is the problem the dom0 kernel, or my extlinux configuration?  Or something else entirely?

Anyone actively running Xen with Arch as the dom0?  Does this work well enough for you, or is a different distro better for dom0 at the moment?  I hate to admit it, but I'm starting to think maybe I just need something a bit easier as my base system / dom0, and then I can play around more with an Arch domU.  I know I took a risk by both trying to make this work with Arch AND using btrfs, and I don't feel like I have wasted time, I have definitely learned a lot even without solving my problem(s),but I don't want to keep fighting with something that may take me a very long time (if ever) to fix and that others may not be able to help me with.

Offline

Board footer

Powered by FluxBB