I can’t finish instalation on one of my computers when using BTRFS as root filesystem.
It always fails after some time (with disk still running) because it cannot write boot loader.
With EXT4 it is ok.
Strange is that at another, installed to fresh, clean, newly partitioned SSD it works
well even with BTRFS…
If the failing computer is legacy BIOS HDD, in order to boot you will need a separate /boot partition with a non-btrfs file system on it e.g. ext2, etc.
Some extra comment about the separate /boot: It can be relatively small, but large enough for multiple kernel support and Grub2. I use a logical partition with ext2, 500MiB (used about 40% with Tumbleweed installed), and the boot flag is set there.
That’s definitely not true, at least not in general.
I have installed openSUSE 13.1 with a single btrfs partition (no separate /boot) on a legacy BIOS sytem one year ago without any problem.
During the weekend I upgraded to 13.2, still no problem…
But, AIUI, the gap between the MBR and the first partition has to be big enough to embed grub2’s boot code, as it is apparently not supported to embed it in a btrfs partition.
This seems to be a problem when you use MSDOS/Windows tools to partition the disk, i.e. the gap is too small then and grub2’s core.img doesn’t fit in.
If you use YaST to partition the drive it should just work even without a separate /boot.
Of course, as grub2 does have some trouble with btrfs (in particular it cannot write its environment, which means that if you set an entry to boot this will be permanent as grub2 cannot reset it), a separate /boot might be a good idea anyway.
So shrinking and moving first partition should help? It is HP NB, shipped with Windows, i just
shrunk W. partitions and made extended one for root/home/swap at the end.
Btw. that embeding to btrfs will be supported later?
If the first partition starts on sector 63 (as used to be the default, in particular with MSDOS/Windows), the gap is too small.
Moving the partition back should help.
IIANM, YaST normally uses Megabyte-aligned partition boundaries, also to speed up access on 4K sector drives.
Btw. that embeding to btrfs will be supported later?
No idea.
There are are other limitations as well in grub2’s btrfs support.
It might not even be possible to support every btrfs feature, grub2 is just a boot loader after all, no operating system.
But I do not have enough insight to really answer that question.
A separate boot partition (with ext2 preferably) should of course prevent all possible problems, at least if it’s big enough (it has to have space for at least 3 kernels and their initrds).
Of course! The separate boot partition was advised in the online openSUSE Reference Manual when I last visited it. Unfortunately it’s “down for maintenance”, so I couldn’t check the reference.
There was recent report about failure to install in MBR (as opposed to partition), with one probable cause - too small post-MBR gap (old style 63 sectors). But btrfs leaves 128K for bootloader on a device, so installing on btrfs partition should be possible.
Yes, that was what I was suggesting here.
The post MBR-gap is too small, so the code doesn’t fit in.
And the output he posted does confirm this.
But AIUI, grub2-install will fall back to install to that gap if it cannot install the code into a partition for whatever reason. Correct?
@shini42:
As I understand it, the first failed installation did not install grub2 to the MBR, or did it?
I.e. did you select “Install to MBR” or “Install to / partition” or what?
But btrfs leaves 128K for bootloader on a device, so installing on btrfs partition should be possible.
Ok, so apparently the problem should not be btrfs at all.
Maybe perl-bootloader or whatever tried to install to a different partition where it is not supported?
Seeing that /dev/sda1 is marked active, maybe it wanted to install to this one?
Could that be a bug in perl-bootloader or whatever, or rather a wrong configuration (i.e. “Install to MBR” selected although the post MBR gap is too small)?
But why did it work with ext4 as / filesystem then, but failed with btrfs?
Maybe just the boot loader settings were different, i.e. not “Install to MBR” selected?
Yes.
Or you try to install to a partition where it is not supported (NTFS e.g.), it will fall back to install to the post MBR gap then instead, I think.
And in shini42 fstab output, /dev/sda1 is the active partition, so grub has to be installed either to the MBR or /dev/sda1, otherwise the system won’t boot.
And /dev/sda1 is no btrfs partition at all. It actually is a logical partition.
The problem is, I understand, when you install generic mbr, and place
grub on an btrfs primary (classic) partition.
But according to arvidjaar this should actually be supported, IIUIC.
> Or you try to install to a partition where it is not supported (NTFS
> e.g.), it will fall back to install to the post MBR gap then instead, I
> think.
It can’t do that! There may be something else in there, like lilo, grub
1, another grub 2, other booters…
>> The problem is, I understand, when you install generic mbr, and place
>> grub on an btrfs primary (classic) partition.
> But according to arvidjaar this should actually be supported, IIUIC.
I’m surprised that btrfs has problems with this configuration.
–
Cheers / Saludos,
Carlos E. R.
(from 13.1 x86_64 “Bottle” at Telcontar)
Just to add a case that actually works with GRUB2 installed to btrfs root/ partition, generic code to MBR.
The Linux stuff is all within the extended partition, so don’t know what happens with a primary root/.
All went smooth in the past with EXT3/4 several times.
This time (13.2RC1 actually) the DVD installer complained about not being able to install the bootloader.
Upon recovery, it turned out that GRUB2 was actually installed to the btrfs root/, only the boot flag was still on sda1 (the Win* one).
With the boot flag set to sda8, GRUB2 booted like a charm.
Device Boot Start End Sectors Size Id Type
/dev/sda1 63 127684682 127684620 60,9G 7 HPFS/NTFS/exFAT
/dev/sda2 127700685 215046089 87345405 41,7G f W95 Ext'd (LBA)
/dev/sda3 215109632 231176191 16066560 7,7G 7 HPFS/NTFS/exFAT
/dev/sda4 231184384 234438655 3254272 1,6G 7 HPFS/NTFS/exFAT
/dev/sda5 127700748 131911678 4210931 2G 82 Linux swap / Solaris
/dev/sda6 152906733 190097144 37190412 17,8G 83 Linux
/dev/sda7 190097208 215046089 24948882 11,9G 83 Linux
/dev/sda8 * 131911680 152905727 20994048 10G 83 Linux
Hm?
There may be something else in the MBR, there maybe something else in the root partition’s boot loader space.
There even might be something else (a different grub2 version e.g.) on the /boot partition already that will be overwritten.
Please note, I do not know whether it does that, and I don’t want to investigate right now either. This was just speculation.
It might just fail when told to install to a partition that is not supported, but that won’t change the end result, an unbootable system.
>> The problem is, I understand, when you install generic mbr, and place
>> grub on an btrfs primary (classic) partition.
> But according to arvidjaar this should actually be supported, IIUIC.
I’m surprised that btrfs has problems with this configuration.
Hm? It’s not btrfs that has problems with this configuration.
This is about the boot loader installation, not the filesystem.
And upto now we do not know whether there are problems with this configuration (generic MBR, grub on primary partition).
I do have the same configuration here (btrfs on /dev/sda4 which is /), and it worked fine. With 13.1 and 13.2 (which was an online upgrade, but still).
So I think just having btrfs on a primary partition is not the problem, something else is.
But we do not even know what boot loader options the OP set. (install to MBR, root, …)
IMHO, with his setup an installation to the MBR is bound to fail, as the post-MBR gap seems to be too small.
And OTOH, even the OP mentions that it worked just fine on a freshly partitioned SSD (with btrfs).
There is a grub error, from the log:
Error: ‘/usr/sbin/grub2-install --target=i386-pc --force --skip-fs-probe “/dev/disk/by-id/ata-Maxtor_6L200P0_L438QZXG”’ failed with exit code 1, output:
/usr/sbin/grub2-install: warning: your core.img is unusually large. It won’t fit in the embedding area.
/usr/sbin/grub2-install: error: filesystem `btrfs’ doesn’t support blocklists.
I suppose this is due tthe first partition starting at sector 63, so the space
between the MBR and the first partition is not large enough to the bootloader.
Why the bootloader is installed to the MBR if btrfs should be supported, I don’t know. That’s why I suspected a bug in perl-Bootloader or whereever.
But I saw now, that there’s actually a fix proposed and submitted to Factory already: https://bugzilla.opensuse.org/show_bug.cgi?id=841247#c18
Apparently Michael Chang’s fix has made its way to the public repos, if only among “unstable” packages, and to the 20141112 Tumbleweed snapshot.
I would like to give it a try over the weekend since I might still have a messy boot process.
Three questions:
if I simply install the new Grub2 rpm and run grub-install from inside the running SUSE, will I get a new installation to the right place or simply overwrite the current grub (wherever it might be)?
If not 1), is there a way to include it in my install DVD or should I download the whole 20141112 snapshot?
Do I need some specific setup to install core.img to the bootloader patch before the btrfs root/ or simply “install bootloader to /” will do the trick?
Feel free to suggest, I will do anything at my own risk (and with SuperGrub disk handy ;))