Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] Unable to mount BTRFS root filesystem on boot
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
alexbuell
Guru
Guru


Joined: 18 Jul 2002
Posts: 482
Location: "Hemp"shire, UK

PostPosted: Sun Mar 16, 2014 11:55 pm    Post subject: [SOLVED] Unable to mount BTRFS root filesystem on boot Reply with quote

I keep getting an error 'mount: mounting /dev/sda2 on /newroot failed: Invalid argument' when booting on my other box.

This box has 2 x 80GB and 2 x 160GB disks on it. The pair of 80GB disks are split into three partitions, one for the boot partition, one for the swap, and one for BTRFS. Both the boot partition and the swap partition on both 80GB disks are combined as mdadm raid10 devices and this bit works perfectly for booting.

The problem starts with BTRFS. I took the 2nd partition from both 80GB disks and the single partitions on both 160GB disks and combined them into a single 440GB BTRFS root filesystem, with metadata and data set to BTRFS RAID6. I can mount this when booted off a CDROM, so that's fine.

Kernel installed is 3.12.13, so that includes BTRFS RAID6 code and is compiled into the kernel. Also uses an initramfs with grub2 for booting, all built using genkernel.

Why does the kernel fails to recognise the BTRFS root filesystem? Any ideas? Thanks, much appreciated.
_________________
Cheers,
Alex.

Linux - the best text adventure game ever.


Last edited by alexbuell on Wed Mar 19, 2014 12:12 am; edited 1 time in total
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43985
Location: 56N 3W

PostPosted: Mon Mar 17, 2014 12:02 am    Post subject: Reply with quote

alexbuell,

Well, error 'mount: mounting /dev/sda2 on /newroot failed: is because /dev/sda2 is a single partition.

Your root is a compound device of some sort, so its unlikely you should be trying to mount a piece of the compound device.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
alexbuell
Guru
Guru


Joined: 18 Jul 2002
Posts: 482
Location: "Hemp"shire, UK

PostPosted: Mon Mar 17, 2014 12:04 am    Post subject: Reply with quote

NeddySeagoon wrote:
alexbuell,

Well, error 'mount: mounting /dev/sda2 on /newroot failed: is because /dev/sda2 is a single partition.

Your root is a compound device of some sort, so its unlikely you should be trying to mount a piece of the compound device.


Ah... maybe I need to give it an UUID for the root device that should link in all the rest ... will give that a try.
_________________
Cheers,
Alex.

Linux - the best text adventure game ever.
Back to top
View user's profile Send private message
alexbuell
Guru
Guru


Joined: 18 Jul 2002
Posts: 482
Location: "Hemp"shire, UK

PostPosted: Mon Mar 17, 2014 12:12 am    Post subject: Reply with quote

Well, using an UUID to refer to the BTRFS device didn't work.. Either it failed to use the UUID to find all the devices for that BTRFS root filesystem or something's wrong with the initramfs ...
_________________
Cheers,
Alex.

Linux - the best text adventure game ever.
Back to top
View user's profile Send private message
vaxbrat
l33t
l33t


Joined: 05 Oct 2005
Posts: 731
Location: DC Burbs

PostPosted: Mon Mar 17, 2014 12:29 am    Post subject: you probably need to do a btrfs scan first Reply with quote

What does your fstab entry look like for this root? I found when I wrote this wiki entry http://wiki.gentoo.org/wiki/Btrfs_native_system_root that grub2 has a hard time finding a multi-device btrfs root. Subvolume use also appears to complicate things.

The embedded initramfs for this article does a brtfs device scan and then uses an fstab to explicitly mount the new root. I'm still trying to get one working that can parse the /proc/cmdline args to forgo the need for that.

Neddy: The use of single device or partition with btrfs is usually sufficient for it to determine what you really meant on the mount. The initial device scan for filesystems would have already set it up with knowledge of what filesystems are out there.
Back to top
View user's profile Send private message
v_andal
Guru
Guru


Joined: 26 Aug 2008
Posts: 524
Location: Germany

PostPosted: Mon Mar 17, 2014 8:19 am    Post subject: Reply with quote

Maybe this http://www.funtoo.org/BTRFS_Fun will help? One can set default subvolume for booting, or set rootflags for kernel.
Back to top
View user's profile Send private message
PeeJay
n00b
n00b


Joined: 15 Aug 2004
Posts: 46
Location: Sydney, Australia

PostPosted: Mon Mar 17, 2014 11:14 am    Post subject: Reply with quote

I'm trying to get this working as well. When is genkernel going to get a BTRFS option?? I've been trying to get Dracut working with no success.
Back to top
View user's profile Send private message
alexbuell
Guru
Guru


Joined: 18 Jul 2002
Posts: 482
Location: "Hemp"shire, UK

PostPosted: Mon Mar 17, 2014 7:07 pm    Post subject: Reply with quote

PeeJay wrote:
I'm trying to get this working as well. When is genkernel going to get a BTRFS option?? I've been trying to get Dracut working with no success.


I'd defintely be interested if genkernel were to gain the ability to fix up the initramfs to scan for all BTRFS devices. They already do that in Ubunt on booting.
_________________
Cheers,
Alex.

Linux - the best text adventure game ever.
Back to top
View user's profile Send private message
alexbuell
Guru
Guru


Joined: 18 Jul 2002
Posts: 482
Location: "Hemp"shire, UK

PostPosted: Wed Mar 19, 2014 12:13 am    Post subject: Reply with quote

Finally got it booting.

All you need to do is to unmerge genkernel and emerge genkernel-next.

Then add --btrfs to your usual command line args passed to genkernel, and all should be well.

Yay :)
_________________
Cheers,
Alex.

Linux - the best text adventure game ever.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo 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