Scan not being performed properly on boot
Hi
I've just recently started testing btrfs on my server but after just 24 hours problems have started. I get booted to a busybox prompt user ubuntu 14.04. I have a multi device FS setup and I can't say for sure if it managed to boot initially or not but it worked fine in regular usage.
I cannot mount my root with anything other than an explicit /dev/sdx reference until I manually run a scan. Then UUID etc all work. I've tried setting the /etc/fstab to use that type of reference but it doesn't work. In all cases there is some sort of mention of a scan being run before mounting fails but it clearly isn't effective.
I would be really appreciative of ant pointers to try and get this going again
Thanks
Peter
Quoted 4 lines · On Mon, 4 Aug 2014 04:02:53 Peter Roberts wrote:
I've just recently started testing btrfs on my server but after just 24 hours problems have started. I get booted to a busybox prompt user ubuntu 14.04. I have a multi device FS setup and I can't say for sure if it managed to boot initially or not but it worked fine in regular usage.
What is GRUB (or your boot loader) giving as parameters to the kernel?
What error messages appear on screen? Sometimes it's helpful to photograph the screen and put the picture on a web server to help people diagnose the problem.
Quoted 2 lines
I cannot mount my root with anything other than an explicit
/dev/sdxreference until I manually run a scan. Then UUID etc all work. I've
That sounds like a problem with the Ubuntu initrd, probably filing an Ubuntu bug report would be the best thing to do. Is BTRFS supported in that version of Ubuntu?
But just changing your boot configuration to use /dev/sdx is probably the best option.
Signature · 2 lines
My Main Blog http://etbe.coker.com.au/ My Documents Blog http://doc.coker.com.au/
Quoted 11 lines · Russell Coker
Quoted 4 lines · On Mon, 4 Aug 2014 04:02:53 Peter Roberts wrote:
I've just recently started testing btrfs on my server but after just 24 hours problems have started. I get booted to a busybox prompt user ubuntu 14.04. I have a multi device FS setup and I can't say for sure if it managed to boot initially or not but it worked fine in regular usage.
What is GRUB (or your boot loader) giving as parameters to the kernel?
What error messages appear on screen? Sometimes it's helpful to photograph the screen and put the picture on a web server to help people diagnose the problem.
Quoted 9 lines
Quoted 2 lines
I cannot mount my root with anything other than an explicit
/dev/sdxreference until I manually run a scan. Then UUID etc all work. I'veThat sounds like a problem with the Ubuntu initrd, probably filing an Ubuntu bug report would be the best thing to do. Is BTRFS supported in that version of Ubuntu?
But just changing your boot configuration to use
/dev/sdxis probably the best option.
Assuming you are booting with grub2, you will need to use /dev/sdx in the grub2 configuration file. This is known issue with grub2. Example from my script:
--------------------------------------------------------------------------------------
echo 'Loading Linux desktop ...' linux /vmlinuz-desktop root=/dev/sda7 ro splash quiet echo 'Loading initial ramdisk ...' initrd /initrd-desktop.img
---------------------------------------------------------------------------------------
Quoted 6 lines · On Sun, 3 Aug 2014 21:00:19 George Mitchell wrote:
Quoted 2 lines
But just changing your boot configuration to use
/dev/sdxis probably the best option.Assuming you are booting with grub2, you will need to use
/dev/sdxin the grub2 configuration file. This is known issue with grub2. Example from my script:
That's not a GRUB issue it's an initrd issue. GRUB just passes text to the kernel. "cat /proc/cmdline" will show you what GRUB sent to the kernel, the programs in the initrd read /proc/cmdline and then do what they think is appropriate.
Quoted 5 lines
----------------------------------------------------------------------------
---------- echo 'Loading Linux desktop ...'linux /vmlinuz-desktop root=/dev/sda7 ro splash quiet echo 'Loading initial ramdisk ...' initrd /initrd-desktop.img
Signature · 2 lines
My Main Blog http://etbe.coker.com.au/ My Documents Blog http://doc.coker.com.au/
Quoted 16 lines · Russell Coker
Quoted 5 lines · On Sun, 3 Aug 2014 21:00:19 George Mitchell wrote:
Quoted 2 lines
But just changing your boot configuration to use
/dev/sdxis probably the best option.Assuming you are booting with grub2, you will need to use
/dev/sdxin the grub2 configuration file. This is known issue with grub2. Example from my script:That's not a GRUB issue it's an initrd issue. GRUB just passes text to the kernel. "cat
/proc/cmdline" will show you what GRUB sent to the kernel, the programs in the initrd read/proc/cmdlineand then do what they think is appropriate.Quoted 5 lines
----------------------------------------------------------------------------
---------- echo 'Loading Linux desktop ...'linux /vmlinuz-desktop root=/dev/sda7 ro splash quiet echo 'Loading initial ramdisk ...' initrd /initrd-desktop.img
Russell, it fixed the problem for me, that's all I know. That's why I am suggesting it.
Quoted 16 lines · Russell Coker
Quoted 5 lines · On Sun, 3 Aug 2014 21:00:19 George Mitchell wrote:
Quoted 2 lines
But just changing your boot configuration to use
/dev/sdxis probably the best option.Assuming you are booting with grub2, you will need to use
/dev/sdxin the grub2 configuration file. This is known issue with grub2. Example from my script:That's not a GRUB issue it's an initrd issue. GRUB just passes text to the kernel. "cat
/proc/cmdline" will show you what GRUB sent to the kernel, the programs in the initrd read/proc/cmdlineand then do what they think is appropriate.Quoted 5 lines
----------------------------------------------------------------------------
---------- echo 'Loading Linux desktop ...'linux /vmlinuz-desktop root=/dev/sda7 ro splash quiet echo 'Loading initial ramdisk ...' initrd /initrd-desktop.img
I see what you are saying. Its a hack. But I suspect that most of the distros are not yet accommodating btrfs with their standard mkinitrd process. At this point modifying grub2 config does solve the problem. If you know a reasonably easy way to fix initrd so that it can interpret UUID and LABEL, I would certainly be all ears.
Quoted 5 lines · On Sun, 3 Aug 2014 21:34:29 George Mitchell wrote:
I see what you are saying. Its a hack. But I suspect that most of the distros are not yet accommodating btrfs with their standard mkinitrd process. At this point modifying grub2 config does solve the problem. If you know a reasonably easy way to fix initrd so that it can interpret UUID and LABEL, I would certainly be all ears.
Debian/Wheezy works with BTRFS when using UUID= to specify the root filesystem. Wheezy was released in May 2013, Ubuntu 14.04 was released in April 2014 and as Ubuntu is based on Debian it should have at least the same features as an older version of Debian.
I think that most Distributions are supporting BTRFS. Debian/Wheezy has support for BTRFS (although I recommend that you don't use it unless you plan to take a kernel from Testing), most Debian derivatives will support it, Fedora supports it.
It's probably better to make a list of distributions that DON'T support BTRFS, it'll be a shorter list.
Signature · 2 lines
My Main Blog http://etbe.coker.com.au/ My Documents Blog http://doc.coker.com.au/
George Mitchell posted on Sun, 03 Aug 2014 21:00:19 -0700 as excerpted:
Quoted 13 lines
Quoted 9 lines
Quoted 2 lines
I cannot mount my root with anything other than an explicit
/dev/sdxreference until I manually run a scan. Then UUID etc all work. I'veThat sounds like a problem with the Ubuntu initrd, probably filing an Ubuntu bug report would be the best thing to do. Is BTRFS supported in that version of Ubuntu?
But just changing your boot configuration to use
/dev/sdxis probably the best option.Assuming you are booting with grub2, you will need to use
/dev/sdxin the grub2 configuration file. This is known issue with grub2. Example from my script:
Quoted 7 lines
------------------------------------------------------------------------
echo 'Loading Linux desktop ...' linux /vmlinuz-desktop root=/dev/sda7 ro splash quiet echo 'Loading initial ramdisk ...' initrd /initrd-desktop.img------------------------------------------------------------------------
??
Known issue with ubuntu's grub2, perhaps? Or perhaps with separate initrds as opposed to kernel-appended initramfss? Or maybe it's with loadable kernel modules as opposed to a custom-built monolithic kernel? Or maybe it's an issue with mbr style grub2 but not gpt with a dedicated BIOS boot partition, or perhaps with grub2 in EFI mode instead of BIOS mode?
Because it works just fine here, grub2, root=LABEL= style root= line pointed at a multi-device btrfs rootfs, BIOS mode gpt partitions with a dedicated BIOS partition for grub2 to use, custom built monolithic kernel with all necessary modules builtin and an appended initramfs, not a separately loaded initrd.
As rootfs /is/ a multi-device btrfs I /do/ have to have an initramfs, because apparently the kernel's command-line parser doesn't properly handle the btrs device= mount option in rootflags=device= parameters, and without a userspace btrfs device scan, the btrfs device= mount option must be passed for multi-device filesystems or btrfs will refuse to mount the device without degraded. But with an appropriate initramfs, it most certainly does work here.
FWIW, my initramfs is dracut-based, btrfs and udev dracut modules loaded of course, with or without the systemd dracut module also loaded (I recently converted to systemd and was running the non-systemd dracut before that.
And root=LABEL= works just fine.
In fact, I have grub2 variables setup with the labels for several different rootfs choices, working multi-device btrfs rootfs, primary backup multi-device btrfs rootfs, and secondary backup reiserfs rootfs. I then have a grub2 menu setup that lets me choose between the three, substituting in the appropriate grub2 variable based root=LABEL= kernel commandline option as necessary. With the previously mentioned exception of having to use the initramfs in the first place in ordered to work around the kernel's rootflags=device= parsing issue instead of being able to direct-boot the rootfs without an initramfs at all, it all works exactly as expected.
Signature · 3 lines
Duncan - List replies preferred. No HTML msgs. "Every nonfree program has a lord, a master -- and if you use the program, he is your master." Richard Stallman
Quoted 1 line · Russell Coker
Is BTRFS supported in that version of Ubuntu?
Out of the box a fresh 14.04 install onto btrfs worked fine for me on two different sets of hardware. 13.10 the same on a third piece of hardware.
cheers,
Chris
Signature · 1 line
Chris Samuel : http://www.csamuel.org/ : Melbourne, VIC
Quoted 1 line · Russell Coker
What is GRUB (or your boot loader) giving as parameters to the kernel? What error messages appear on screen? Sometimes it's helpful to photograph the screen and put the picture on a web server to help people diagnose the problem.
Here a screenshot http://imgur.com/8pQgG8g
Making changes to /etc/fstab didn't seem to work and nor did manually adding device=/dev/sda1,device... in the GRUB config itself. What has fixed the problem though seems pretty horrible it to specify root=/dev/sda1 instead of UUID=....
Quoted 1 line
That sounds like a problem with the Ubuntu initrd, probably filing an Ubuntu bug report would be the best thing to do. Is BTRFS supported in that version of Ubuntu? But just changing your boot configuration to use
/dev/sdxis probably the best option.
I'll file a bug report but I'm not sure whether this is a GRUB or an initrd / initramfs problem. Getting a persistent fix required a bodge in /etc/grub.d/10-linux
As for support, I don't think it is considered stable in 14.04 but I haven't had to do anything special to use it and used to official installer to get where I am (converting the single disk FS to a RAID1 after).
In any case, thanks for the help :)