-   Slackware (
-   -   Slackware 13.37rc2 btrfs with generic kernel (

spudgunner 03-20-2011 09:16 AM

Slackware 13.37rc2 btrfs with generic kernel
I was interested in the idea of the btrfs subvolumes, so I made a virtual machine and installed Slackware as per the instructions here:

It all went very well, but when I tried to switch from the huge kernel to the generic kernel and use the initrd.gz generated from step 29 (except that I used instead of whatever's there) in lilo.conf, it failed to boot. I also noticed that in the instructions themselves, the poster doesn't actually add the initrd.gz to lilo.conf, so I'm guess the huge kernel has everything it needs to boot properly. So all in all, I'm a little confused.

Any help would be appreciated.

kingbeowulf 03-20-2011 02:10 PM

Yes, there is a step missing:

# mkinitrd -c -k -m btrfs:ext4 -f btrfs -r /dev/sdb6
# Run /sbin/lilo

EDIT: Actually I just carefully read that post. Yes, the author DOES say to add initrd.gz (Step 26) to lilo.conf. Note also the append in step 25.

After mkinitrd, you need to update lilo.conf and THEN run lilo. Edit lilo.conf to point to the correct generic kernel and to your initrd.gz. For example, in my slackware-current (32 bit version) VM:


# mkinitrd -c -k -m ext4 -f ext4 -r /dev/sda1
and /etc/lilo.conf is


boot = /dev/sda
compact        # faster, but won't work on all systems.
bitmap = /boot/slack.bmp
bmp-colors = 255,0,255,0,255,0
bmp-table = 60,6,1,16
bmp-timer = 65,27,0,255
append=" vt.default_utf8=0"
timeout = 50
image = /boot/vmlinuz-generic-smp-
  initrd = /boot/initrd.gz
  root = /dev/sda1
  label = Slackware
  read-only  # Partitions should be mounted read-only for checking


bgeddy 03-20-2011 02:29 PM

I've gone through the instructions you linked to as I'm also interested in btrfs so I created my own VM. I've played around with btrfs before but I'm certainly not an expert. This time I tried just using Slackware's setup program to format a btrfs root partition and when it had finished created a /home subvolume. I noticed Yoda, (I'll call him that), missed out the initial ram disk bits of lilo.conf so I added them myself. This booted the generic fine but failed on the huge kernel.

Then I realized that Yoda's instructions you linked to had two subvolumes - one for / (system) and one for home (home). I reran the install following the instructions and this time my generic kernel falls with "ERROR: No /sbin/init found on rootdev (or not mounted) Trouble ahead." The huge kernel boots OK though. Oddly out of my two slightly different attempts this time, one with one subvolume and one with two, either the generic or the huge kernel works but not both! I'm still playing around with this as btrfs setups are a new thing to me. I'll let you you if I find anything relevant - I've got an idea it's something simple I'm missing.

spudgunner 03-20-2011 05:30 PM


Originally Posted by bgeddy (Post 4297275)
Then I realized that Yoda's instructions you linked to had two subvolumes - one for / (system) and one for home (home). I reran the install following the instructions and this time my generic kernel falls with "ERROR: No /sbin/init found on rootdev (or not mounted) Trouble ahead." The huge kernel boots OK though.

That's the same thing that's currently happening to me too. Other than that hiccup, it seems to be functioning normally. I never added the initrd.gz to the initial lilo configuration (booting of the huge kernel) but when I did it messed up with that error message above. For some reason mkinitrd doesn't like it I guess.

lumak 03-20-2011 10:32 PM

Just a note from my experience, VirtualBox OSE appears to require the boot loader be installed to the MBR of the virtual hard disk.


rerun lilo

This may not be true for the full VirtualBox install that lets you use virtual sata drives instead of ide drives.

Also, I've had no such troubles with btrfs in VirtualBox with multiple volumes... But... I have a /boot partition that's ext3. So perhaps lilo doesn't support btrfs yet? Err... I thought lilo used hard linking to the partition and inodes to get the boot files.

spudgunner 03-21-2011 07:58 AM

I always install to the MBR, but I re-ran it anyways. I got a warning from lilo this time that I don't remember before (but just because I don't remember it, doesn't mean it isn't there). It's about the initrd is not small enough to fit in the 15M-16M memory hole so it will be loaded elsewhere and assumed the the BIOS can read memory above 16M or something (don't have it with me at the time).

lumak 03-21-2011 08:16 AM

When you re mount your partitions after booting from the install iso/cd, don't forget to do
mount /dev/sda1 /mnt
mount /dev/sda? /mnt/whatever
mount --bind /proc /mnt/proc
mount --bind /sys /mnt/sys
chroot /mnt

It helps to avoid some errors when running lilo. Also the liloconfig probably has the option "lba32" around the "boot=/dev/sda". If it isn't there, you can try adding it. I can't remember the situations of when I got the 15M-16M error or what I did to fix it... but those options might help.

Also, be sure that

are pointing to the correct files. I'm sure that was already done, I'm just trying to cover everything that I would check.

spudgunner 03-21-2011 09:52 AM

I can boot the system normally using the huge kernel, so I am not needing to go through all the mounting stuff. I'll have to check my lilo.conf to make sure all that stuff is right when I get home, but I'm pretty sure it is.

spudgunner 04-08-2011 05:47 PM

Sorry for the delay in getting back, I got caught up with school. When installing Slackware, I didn't do the binding as mentioned above, but those lines in the lilo.conf are correct

spudgunner 04-13-2011 06:32 PM

So I've installed rc3.1415... on my netbook, hoping to figure out this btrfs problem, but I'm still stuck on it. Not getting the weird error about the initrd being to big anymore (I think that was something to do with the VM I was using it in), but I still can't get the initrd to work with the generic kernel (huge kernel boots fine without it).

My System is laid out as follows:
sda1: ext4, contains /boot
sda2: btrfs, divided as follows
"system" subvolume, contains /
"home" subvolume, contains /home
sda3: ext4, contains slackware-current mirror
sda4: swap

Here's my lilo.conf:

# Append any additional kernel parameters:
append=" vt.default_utf8=0"
boot = /dev/sda

# Boot BMP Image.
# Bitmap in BMP format: 640x480x8
  bitmap = /boot/slack.bmp
# Menu colors (foreground, background, shadow, highlighted
# foreground, highlighted background, highlighted shadow):
  bmp-colors = 255,0,255,0,255,0
# Location of the option table: location x, location y, number of
# columns, lines per column (max 15), "spill" (this is how many
# entries must be in the first column before the next begins to
# be used.  We don't specify it here, as there's just one column.
  bmp-table = 60,6,1,16
# Timer location x, timer location y, foreground color,
# background color, shadow color.
  bmp-timer = 65,27,0,255

# Standard menu.
# Or, you can comment out the bitmap menu above and
# use a boot message with the standard menu:
#message = /boot/boot_message.txt

# Wait until the timeout to boot (if commented out, boot the
# first entry immediately):
# Timeout before the first entry boots.
# This is given in tenths of a second, so 600 for every minute:
timeout = 1200
# Override dangerous defaults that rewrite the partition table:
# VESA framebuffer console @ 800x600x32k
vga = 787
# End LILO global section
# Linux bootable partition config begins - This entry works
image = /boot/vmlinuz
  append = "rootflags=subvol=system"
  root = /dev/sda2
  label = Slackware-huge
# Linux bootable partition config ends

#Generic - This entry does not work
image = /boot/vmlinuz-generic-smp-
  append = "rootflags=subvol=system"
  initrd = /boot/initrd.gz
  root = /dev/sda2
  label = Slackware-gen
#End of config

The mkinitrd command I used:

mkinitrd -c -k -m btrfs:ext4 -f btrfs -r /dev/sda2

/dev/sda4        swap            swap        defaults        0  0
#/dev/sda2        /                btrfs      defaults        1  1
/dev/sda2  /  btrfs  defaults,subvol=system  0  1
/dev/sda2  /home  btrfs  defaults,subvol=home  0  1
/dev/sda1  /boot  ext4  defaults  0  1
#/dev/cdrom      /mnt/cdrom      auto        noauto,owner,ro  0  0
/dev/fd0        /mnt/floppy      auto        noauto,owner    0  0
devpts          /dev/pts        devpts      gid=5,mode=620  0  0
proc            /proc            proc        defaults        0  0
tmpfs            /dev/shm        tmpfs      defaults        0  0

Command recommend by

mkinitrd -c -k -f btrfs -r /dev/sda2 -m usbhid:ehci-hcd:uhci-hcd:btrfs -u -o /boot/initrd.gz
I have never needed usbhid, ehci-hcd, or uhci-hcd modules in the past with my computer, nor have I ever used the -u option with mkinitrd, and this computer has always worked fine. In addition to this, it is missing the ext4 module, so I opted not to try this.

Any more hints would be appreciated.

alekow 04-13-2011 07:13 PM


mkinitrd -c -k -m btrfs:ext4 -f btrfs -r /dev/sda2
should be

mkinitrd -c -k -m btrfs:ext4 -f btrfs -r /dev/sda2

spudgunner 04-13-2011 08:16 PM

That was my bad.... I was scrolling on the bash commands to copy/paste stuff... the generic doesn't work, I know for sure I did it without the generic in it... my mistake.

alekow 04-14-2011 04:29 AM

Did you read this thread?

spudgunner 04-14-2011 10:26 AM

Thanks for pointing that thread out to me, I have seen it... guess I was just being dumb at the time. Doing what was suggested in there worked great.

My complete solution:


mkinitrd -c -k -m btrfs:ext4 -f btrfs -r /dev/sda2
Edit /boot/initrd-tree/init, add "subvol=system" as an option as such (and save):

mount -o ro -t $ROOTFS $ROOTDEV /mnt #Original Line
mount -o ro,subvol=system -t $ROOTFS $ROOTDEV /mnt #Edited Line


mkinitrd -k -m btrfs:ext4 -f btrfs -r /dev/sda2
And run lilo again. And it WORKS!

camerabambai 03-22-2013 09:46 PM

A little help,i tried with btrfs as you tried
But i have a btrfs with 2 disk(created mkfs.btrfs /dev/sda3 /dev/sdb3)
when i use sda3 on mkinitrd and lilo.conf failed with "failed to read the system array".
So on console i use mount -t btrfs -o subvol=system /dev/sdb3 /mnt..and works.
If i change with sdb3 on mkinitrd and lilo.conf failed with "failed to read the system array".
and i must use(mount -t btrfs.../dev/sda3) and works.
This on every reboot(sic!)
If i try the -B option on mkinitrd it create /mnt/home and /mnt/system and of course
won't boot
Someone can help?


All times are GMT -5. The time now is 12:04 PM.