5

I need btrfs filesystem support. I followed the wiki article and rebuilt the kernel, adding btrfs as a built-in kernel object. When I boot the new kernel and try to manually mount a btrfs filesystem, I get "mount: unknown filesystem type 'btrfs'". I have double-checked the config, and btrfs is definitely selected with an "*", as the wiki instructs.

However, my question concerns the new kernel itself. There is only one kernel file in /boot, the one I created on Mar 25. However, if I run "uname -a", it reports that the kernel was built on Mar 20, which is probably the day I originally installed Gentoo. It seems that the original kernel is the one being used, even though it apparently no longer exists.

Here is the boot line from the grub2 configuration:

linux /boot/kernel-genkernel-x86_64-3.12.13-gentoo root=/dev/sdb13
initrd /boot/initramfs-genkernel-x86_64-3.12.13-gentoo

/boot is not on a separate partition. Here is the requested output of ls -l:

lrwxrwxrwx 1 root root      42 Mar 25 14:57 System.map -> System.map-genkernel-x86_64-3.12.13-gentoo
-rw-r--r-- 1 root root 2101526 Mar 25 18:44 System.map-genkernel-x86_64-3.12.13-gentoo
lrwxrwxrwx 1 root root      41 Mar 25 14:58 initramfs -> initramfs-genkernel-x86_64-3.12.13-gentoo
-rw-r--r-- 1 root root 3481260 Mar 25 18:45 initramfs-genkernel-x86_64-3.12.13-gentoo
lrwxrwxrwx 1 root root      38 Mar 25 14:57 kernel -> kernel-genkernel-x86_64-3.12.13-gentoo
-rw-r--r-- 1 root root 3600976 Mar 25 18:44 kernel-genkernel-x86_64-3.12.13-gentoo

What am I missing?


Grub menu entry:

menuentry 'Gentoo Base System release 2.2 (on /dev/sdb13)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-simple-1e68823f-eec6-45b9-9563-a673ec07f4e3' {
        insmod part_gpt
        insmod ext2
        set root='hd1,gpt13'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt13 --hint-efi=hd1,gpt13 --hint-baremetal=ahci1,gpt13  1e68823f-eec6-45b9-9563-a673ec07f4e3
        else
          search --no-floppy --fs-uuid --set=root 1e68823f-eec6-45b9-9563-a673ec07f4e3
        fi
        linux /boot/kernel-genkernel-x86_64-3.12.13-gentoo root=/dev/sdb13
        initrd /boot/initramfs-genkernel-x86_64-3.12.13-gentoo
}
Rui F Ribeiro
  • 56,709
  • 26
  • 150
  • 232
Tim
  • 496
  • Is /boot on a separate partition? Can you post the output of ls -l /boot? – casey Mar 26 '14 at 16:36
  • Thanks for your response. I have edited the original post. – Tim Mar 26 '14 at 16:38
  • Where is your grub config located at? I would expect to see the grub directory in that listing. – casey Mar 26 '14 at 21:03
  • casey, I control grub from my main system (Debian) on another partition. – Tim Mar 26 '14 at 21:06
  • That is probably your issue then, your /boot is not the /boot that grub is looking for. You need to put this kernel with your others within the partition that grub is configured to look in. Alternatively if you want to keep the kernel there, you need to modify the root= line in the grub config to point to this partition. – casey Mar 26 '14 at 21:08
  • casey, I can't argue with what you're saying because I don't know what is wrong, but I successfully manage five other system installations that way, even when their kernels are upgraded. The original Gentoo kernel was in /dev/sdb13/boot, and it booted. The new kernel is in the same place. – Tim Mar 26 '14 at 22:02
  • can you post the entire menuentry from grub2 for both the old and new kernels? – casey Mar 26 '14 at 22:08
  • Ok, after thinking about this overnight, I devised an experiment to determine whether grub is booting to a kernel in an unexpected location. I moved the new (Mar 25) kernel to another directory and rebooted. It failed because the kernel was not found. That shows me that the system is booting to the expected new kernel.

    So, back to the original questions: 1) Why does the new kernel not support btrfs, which I config'ed into it? 2) Why does the new kernel still show an internal date of Mar 20, even though it was rebuilt on Mar 25 and the external file date is Mar 25?

    – Tim Mar 27 '14 at 15:44
  • Run file /boot/kernel-genkernel-x86_64-3.12.13-gentoo. This will print the embedded version info from that file and confirm it is the old kernel. I'm not familiar with genkernel for kernel updates, but perhaps it is not doing the right thing. – casey Mar 27 '14 at 15:52
  • You can also run file /usr/src/linux/arch/x86_64/boot/bzImage (with arch and kernel image name appropriate for your system) and verify it is the new kernel. If that checks out, genkernel is your culprit. – casey Mar 27 '14 at 15:55
  • Thank you, casey. I have verified that I am somehow running genkernel, incorrectly. I am running it with options --menuconfig --no-mrproper --no-clean --install --symlink. I am saving the new config when done with the menuconfig phase. However, when I go back and browse the config file, BTRFS_FS is still not set. So, I am completely missing something that needs to be done with menuconfig. It is my understanding that option --no-mrproper is supposed to make it keep and use my changes. Thanks for all your help. – Tim Mar 27 '14 at 16:45

1 Answers1

6

Ok, the problem was solved following advice given in Gentoo forums. That advice was to make the kernel manually instead of using genkernel. This worked perfectly, the first time.

cd /usr/src/linux
make menuconfig
make && make modules_install
cp arch/x86_64/boot/bzImage /boot
mv /boot/bzImage /boot/whatever_kernel_filename
genkernel --install initramfs

I am still confused as to why genkernel with --menuconfig does not seem to work as advertised. But I doubt that I will be trying it again. The manual way is not difficult.

Tim
  • 496
  • Condense two lines into one with cp arch/x86_64/boot/bzImage /boot/whatever_kernel_filename rather than cp the kernel image and then mv it. – slackline Sep 26 '14 at 06:30
  • What is meant by "whatever_kernel_filename" ? Example? – 에이바 Mar 10 '15 at 13:46
  • Thanks for posting the answer! It would be great of you could remember to accept it so the question can be marked as answered. – terdon Jun 15 '15 at 17:17