Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Multi-device Btrfs root fails to mount without initrd
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2  
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 6920

PostPosted: Fri Apr 08, 2016 5:34 pm    Post subject: rootfs on multi-disk btrfs, do I need an initramfs? Reply with quote

Been banging my head against this problem for a few days now... I have a headless, remote server:

/dev/sda and /dev/sdb are both plain MBR disks, with a 512MB partition 1 and the rest as partition 2. sda1 is an ext4 /boot, sda2 is btrfs /, sdb is ignored for now. This setup works fine.

If I mkfs.btrfs sdb2, btrfs device add /dev/sdb2 /, and then try to reboot with that, I get the usual kernel panic message saying it can't find unknown-block(8,2) along with the list of known devices, but that already includes all of the ones above. I've tried adding "rootflags=device=/dev/sda2,device=/dev/sdb2 rootdelay=5" but it didn't help at all. Any idea?
Back to top
View user's profile Send private message
derk
Guru
Guru


Joined: 10 Mar 2003
Posts: 347
Location: St Thomas Ontario

PostPosted: Fri Apr 08, 2016 8:07 pm    Post subject: Reply with quote

you should not be mounting dev/sdb2 over top of /dev/sda2 .. not two root disks only one .. if you want a raid set-up use proper hardware set-up or a software raid .. which will need an initrd/initramfs of some sort .. look on wiki or search for help .. never done this myself
Back to top
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 6920

PostPosted: Fri Apr 08, 2016 9:03 pm    Post subject: Reply with quote

derk wrote:
you should not be mounting dev/sdb2 over top of /dev/sda2 .. not two root disks only one .. if you want a raid set-up use proper hardware set-up or a software raid .. which will need an initrd/initramfs of some sort .. look on wiki or search for help .. never done this myself

Maybe I didn't make myself clear enough. This is a Btrfs multidevice volume in RAID1 profile. It mounts perfectly fine from the server's debian netboot recovery environment, but not at boot. I've looked at about 50 different wikis already, nothing says this shouldn't work.
Back to top
View user's profile Send private message
derk
Guru
Guru


Joined: 10 Mar 2003
Posts: 347
Location: St Thomas Ontario

PostPosted: Fri Apr 08, 2016 9:21 pm    Post subject: Reply with quote

so you are not using mdadm ? with mount points /dev/md0, /dev/md1 etc .. what is the debian environment using to manage the disk arrays? does it actually load mdadm? or something else?

I have used a server with hardware raid ..under mandrake in the past and it still used mdadm in the boot process with an initrd ..to manage the device .. boot was on the raid device itself .. not sure about the formatting as I did not set it up. was pre-ext4 ..
Back to top
View user's profile Send private message
derk
Guru
Guru


Joined: 10 Mar 2003
Posts: 347
Location: St Thomas Ontario

PostPosted: Sat Apr 09, 2016 4:15 pm    Post subject: Reply with quote

have you seen this wiki:
https://wiki.archlinux.org/index.php/GRUB#RAID

FYI
Back to top
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 6920

PostPosted: Sat Apr 09, 2016 6:54 pm    Post subject: Reply with quote

derk wrote:
so you are not using mdadm ? with mount points /dev/md0, /dev/md1 etc ..

No.
Quote:
what is the debian environment using to manage the disk arrays? does it actually load mdadm? or something else?

ahci and btrfs. I can `mount /dev/sda2 /mnt/gentoo` and it'll DWIM. `btrfs fi show /mnt/gentoo` shows both disks active when they are.

The Gentoo kernel can also interact fine with the 2-disk volume while it's running. Just not mount it as root in that state.

I've tried both GRUB2 and LILO with various combinations of root= device/UUIDs, none worked.
Back to top
View user's profile Send private message
derk
Guru
Guru


Joined: 10 Mar 2003
Posts: 347
Location: St Thomas Ontario

PostPosted: Sat Apr 09, 2016 7:33 pm    Post subject: Reply with quote

adjust as per example:: rootflags=device=/dev/sda2,device=/dev/sdb2 rootfstype=btrfs

as per: https://wiki.gentoo.org/wiki/Btrfs/System_Root_Guidej
Back to top
View user's profile Send private message
brepro
n00b
n00b


Joined: 25 Apr 2016
Posts: 1

PostPosted: Mon Apr 25, 2016 4:45 am    Post subject: Reply with quote

Error checking has been added into the patched code segment (int err = create_dev ...)

New patch:

Code:

gentoo - /etc/portage/patches/sys-kernel/gentoo-sources# cat earlydevtmpfs.patch
--- init/do_mounts.c.orig       2016-04-25 14:27:42.264114898 +1000
+++ init/do_mounts.c    2016-04-25 14:28:11.443822879 +1000
@@ -542,6 +542,7 @@
                int err = create_dev(saved_root_name, ROOT_DEV);
                        if (err < 0)
                                pr_emerg("Failed to create %s: %d\n", saved_root_name, err);
+                       devtmpfs_mount("dev");
                        mount_block_root(saved_root_name, root_mountflags);
                } else {
                        int err = create_dev("/dev/root", ROOT_DEV);
Back to top
View user's profile Send private message
Chiitoo
Administrator
Administrator


Joined: 28 Feb 2010
Posts: 2575
Location: Here and Away Again

PostPosted: Mon Apr 25, 2016 5:37 pm    Post subject: Reply with quote

Merged 7 posts before the one above this one, as the topic seems to be about the same issue (and as was requested by Ant P.).
_________________
Kindest of regardses.
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
Goto page Previous  1, 2
Page 2 of 2

 
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