Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Btrfs + raid 1 = Kernel panic, unknown block (8,17)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
marivald
n00b
n00b


Joined: 29 May 2013
Posts: 9

PostPosted: Thu Nov 21, 2013 4:26 pm    Post subject: Btrfs + raid 1 = Kernel panic, unknown block (8,17) Reply with quote

Hi,

I've used my btrfs for some time and decided to add a new disk and create a raid1 setup AND at the same time move /boot from a separate partition to / (which doesn't seem to be a good idea when I think of it now).

My current partition table is

/dev/sda
Code:
                                 Pri/Log   Free Space                         296.12
    sda1        Boot     Primary   btrfs                           983916.22
    sda2                    Primary   Linux swap / Solaris             15992.56*


/dev/sdb
Code:
    sdb1                    Primary   btrfs                           983916.22
    sdb2                    Primary   swap                             16288.67*


sda1 and sdb1 are in btrfs raid 1. I've rebalanced everything and it works, but I've never actually rebooted my machine since now.

And now I cannot boot. I get kernel panick, not syncing etc. Now I work from ubuntu live-cd.


My grub.cfg, which I have to edit manually because of failing grub-probe (despite chrooting with, I believe, proper mounts)
Code:
#
[...]

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Gentoo GNU/Linux' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-b36c5676-d239-440b-b534-f931164b1d5b' {
   load_video
   insmod gzio
   insmod part_msdos
   insmod btrfs
   set root='hd0,msdos1'
        search --no-floppy --fs-uuid --set=root b36c5676-d239-440b-b534-f931164b1d5b
   
   echo   'Loading Linux 3.12.0-ck ...'
   linux   /snapshot/current/boot/kernel-3.12.0-ck root=/dev/sda1 ro rootflags=subvol=snapshot/current,device=/dev/sdb1,device=/dev/sda1
}
[...]

### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f  ${config_directory}/custom.cfg ]; then
  source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###



I have no idea where to go from this point. I've tried to edit almost everything, but with no success.
I'd gladly provide more info if needed.
Back to top
View user's profile Send private message
Randy Andy
Veteran
Veteran


Joined: 19 Jun 2007
Posts: 1009
Location: /dev/koelsch

PostPosted: Fri Nov 22, 2013 8:47 am    Post subject: Reply with quote

Hi marivald.

I guess the main reason for your problem is not cause you moved your separate boot partition to your btrfs root, but cause you newly using a btrfs RAID-1.

Before the the Btrfs RAID could be assembled successfully a tool named btrfs-scan has to be run. This could be done only with the help of a initramfs you're not using as far as I see from your grub.cfg

Until then, as a fast workaround, you could mount one of your devices in degraded mode, to get back the possibility to boot from it.

So research for the "degraded" kernel command line parameter, until you've build a correct initramfs, I can't help with, cause this is not my preferred way to go, only for mounting a RAID filesystem as you can see here:
https://forums.gentoo.org/viewtopic-t-975858-highlight-.html

Much success, Andy.
_________________
If you want to see a Distro done right, compile it yourself!
Back to top
View user's profile Send private message
marivald
n00b
n00b


Joined: 29 May 2013
Posts: 9

PostPosted: Fri Nov 22, 2013 9:52 am    Post subject: Reply with quote

Hi Randy,

thanks for your answer.

I actually started to create initramfs according to https://wiki.gentoo.org/wiki/Btrfs_system_root, but I've failed for some reason. I've tried to create a separate boot partition after my / and I couldn't force grub to load it.

I thought that it could be possible to tell grub everything, after reading https://btrfs.wiki.kernel.org/index.php/Using_Btrfs_with_Multiple_Devices#Registration_in_.2Fetc.2Ffstab.

I'll try the degraded mode, that's very promising - everything to get rid of the live cd.

Meanwhile I think I'll transfer my data somewhere, repartition and try again :(

Thanks again.
Back to top
View user's profile Send private message
Randy Andy
Veteran
Veteran


Joined: 19 Jun 2007
Posts: 1009
Location: /dev/koelsch

PostPosted: Fri Nov 22, 2013 12:48 pm    Post subject: Reply with quote

marivald wrote:
Hi Randy,

thanks for your answer.

I actually started to create initramfs according to https://wiki.gentoo.org/wiki/Btrfs_system_root, but I've failed for some reason..


No wonder. As far as i understand this wiki is not well suitable for creating a native btrfs raid system, cause it adds an additional layer via md on top of the btrfs raid system.

marivald wrote:
I've tried to create a separate boot partition after my / and I couldn't force grub to load it.

I thought that it could be possible to tell grub everything, after reading https://btrfs.wiki.kernel.org/index.php/Using_Btrfs_with_Multiple_Devices#Registration_in_.2Fetc.2Ffstab.

That has confused me too, but I guess we misinterpret it a little.

marivald wrote:
I'll try the degraded mode, that's very promising - everything to get rid of the live cd.

Yes, this should work, but I'm actually not on my box so not able to show you a sample command line.

marivald wrote:
Meanwhile I think I'll transfer my data somewhere, repartition and try again :( Thanks again.

Not inevitable necessary, but if you prefer that, go on...
In the meantime some more references to read regarding this trouble:
https://bugzilla.kernel.org/show_bug.cgi?id=Btrfs
https://forums.gentoo.org/viewtopic-t-909416-postdays-0-postorder-asc-start-0.html?sid=dcdffbc21f7cd8e43e8ecbbf03a6bd25

Consider also the rootdelay option at the end of this thread. :wink:

Best , Andy.
_________________
If you want to see a Distro done right, compile it yourself!
Back to top
View user's profile Send private message
marivald
n00b
n00b


Joined: 29 May 2013
Posts: 9

PostPosted: Sat Nov 23, 2013 11:12 am    Post subject: Reply with quote

Randy Andy wrote:

No wonder. As far as i understand this wiki is not well suitable for creating a native btrfs raid system, cause it adds an additional layer via md on top of the btrfs raid system.


Well, I've tried to omit md part, only initramfs+separate grub, but I'll have to read more about it before moving on.

Randy Andy wrote:

That has confused me too, but I guess we misinterpret it a little.

This or it doesn't work ;-)

Degraded mode is just fine. I'd love to remount into normal after booting, but I couldn't manage to do it. As a rescue mode it's perfect.

And while rootdelay did not help (my first shot, to be able to read the logs before kernel going nuts ;-)) I wonder if playing with fstab and rootparams a bit more will not help. Thanks for this link!
Back to top
View user's profile Send private message
Randy Andy
Veteran
Veteran


Joined: 19 Jun 2007
Posts: 1009
Location: /dev/koelsch

PostPosted: Sat Nov 23, 2013 2:28 pm    Post subject: Reply with quote

marivald,

my btrfs RAID1 (sda2, sdb2) boot into the degraded mode with these parameters, you have to adopt it only to your root partition (sda1) and subtract the compress entries if you don't use it.

Code:

title=@Gentoo-1 Btrfs degraded, works.
root (hd0,0)
kernel /boot/kernel-x86_64-3.12.0-gentoo-LZO  rootdelay=10 root=/dev/sda2 rootfstype=btrfs  rootflags=degraded,subvol=@Gentoo-1,compress=lzo


My fstab for my btrfs devices looks like this:
Code:

LABEL=RAID-1            /               btrfs   defaults,relatime,compress=lzo,autodefrag        0 0
LABEL=RAID-1            /home       btrfs   defaults,relatime,subvol=@home,compress=lzo,autodefrag           0 0


As you know, its only a workaround, no solution. :cry:

Much success,

Andy.
_________________
If you want to see a Distro done right, compile it yourself!
Back to top
View user's profile Send private message
marivald
n00b
n00b


Joined: 29 May 2013
Posts: 9

PostPosted: Tue Nov 26, 2013 12:21 pm    Post subject: Reply with quote

Ok, so I think I miss something.

My current grub entry is:
Code:
linux /snapshot/current/boot/kernel-3.12.0-ck root=/dev/sdb1 ro rootflags=subvol=snapshot/current,degraded init=/usr/lib/systemd/systemd

My fstab is:
Code:
UUID=b36c5676-d239-440b-b534-f931164b1d5b    /    btrfs   noatime,defaults,compress=lzo,subvol=snapshot/current,device=/dev/sda1,device=/dev/sdb1   0    0

Does it mean that after the initial mount by kernel the final remount should "restore" my RAID setup?

My mount command returns it's still degraded:
Code:
/dev/sdb1 on / type btrfs (rw,noatime,degraded,compress=lzo,space_cache)

I'll be able to remount on Thursday, but I believe that I've booted with this exact setup. I will try to verify it asap.
Back to top
View user's profile Send private message
Randy Andy
Veteran
Veteran


Joined: 19 Jun 2007
Posts: 1009
Location: /dev/koelsch

PostPosted: Tue Nov 26, 2013 3:47 pm    Post subject: Reply with quote

marivald wrote:
Does it mean that after the initial mount by kernel the final remount should "restore" my RAID setup?
My mount command returns it's still degraded:
Code:
/dev/sdb1 on / type btrfs (rw,noatime,degraded,compress=lzo,space_cache)


Sorry marivald,

I thought your weren't able to mount into degraded mode and that's why I gave this hint.
Sadly I wasn't also able to remount my RAID well, afterwards. Hopefully you could find a way or the right parameters to do this.

Using the RAID-1 in degraded mode for longer times seems to be no good idea, as In know now.
My data gets inconsistent regularly while I'm working on. After one world update I couldn't get login via GUI, neither into the updated system nor into working the snapshot I'll done before.
On the console it works, but the file system couldn't be mounted writeable and simple commands doesn't work any longer.

So I have to repair it with the help of btrfsck which doesn't solve the problem.
So I had to rebalance my RAID, to get back to an consistent state.

Than it works for a while, but after some reboots or updates, the same happened again and again.

Lastly cancelled my RAID tests and now I try to use a single btrfs system only.
I'm not willing to get forced to use a initramfs , only mount a file-system.

Hopefully Chris Manson or the kernel guys will fix this asap and will not follow the same strategy as they did it for the MD / LVM RAID systems.
I guess this should be treated different, cause this functionality is part of the file system and not an additional layer on top. :cry:

Furthermore much success for your trying.

Best, Andy.
_________________
If you want to see a Distro done right, compile it yourself!
Back to top
View user's profile Send private message
marivald
n00b
n00b


Joined: 29 May 2013
Posts: 9

PostPosted: Wed Dec 04, 2013 5:44 pm    Post subject: Reply with quote

Doh.

I've ended up with clean repartitioning, initramfs, and stuff.

/boot is on / partition however, grub2 handles it's pretty good.

I consider it a fail. Nevertheless, big beer Randy for your help, thanks!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum