btrfsck fails with "unsupported option features", must [ignore] to boot

Bug #748340 reported by Martin Erik Werner
246
This bug affects 54 people
Affects Status Importance Assigned to Milestone
Baltix
New
Undecided
Unassigned
btrfs-tools (Ubuntu)
Fix Released
Medium
Dimitri John Ledkov
Precise
Won't Fix
Medium
Unassigned
Quantal
Fix Released
Medium
Dimitri John Ledkov

Bug Description

Binary package hint: btrfs-tools

current btrfsck on natty reports:
couldn't open because of unsupported option features (2).
fsck.btrfs: disk-io.c:683: open_ctree_fd: Assertion `!(1)' failed.
...if invoked on the standard root/home.

Meaning that when the link fsck.btrfs -> btrfsck was enabled as per Bug #660649 my system now stops booting with this message:
fsck from util-linux-ng 2.17.2
fsck from util-linux-ng 2.17.2
fsck from util-linux-ng 2.17.2
couldn't open because of unsupported option features (2).
fsck.btrfs: disk-io.c:683: open_ctree_fd: Assertion `!(1)' failed.
Warning... fsck.btrfs for device /dev/sda5 exited with signal 6.
mountall: fsck /home [313] terminated with status 8
mountall: Unrecoverable fsck error: /home
couldn't open because of unsupported option features (2).
fsck.btrfs: disk-io.c:683: open_ctree_fd: Assertion `!(1)' failed.
Warning... fsck.btrfs for device /dev/sda5 exited with signal 6.
mountall: fsck / [312] terminated with status 8
mountall: Unrecoverable fsck error: /
/dev/sda1: clean, 233/48768 files, 44709/194560 blocks
init: udev-fallback-graphics main process (625) terminated with status 1

If [I] is pressed to ignore errors booting can be done normally, just bypassing btrfsck completely.
---
Architecture: amd64
DistroRelease: Ubuntu 11.04
Package: btrfs-tools 0.19+20100601-3ubuntu2
PackageArchitecture: amd64
ProcEnviron:
 SHELL=/bin/bash
 LANG=en_GB.UTF-8
 LANGUAGE=en_GB:en
ProcVersionSignature: Ubuntu 2.6.38-7.39-generic 2.6.38
Tags: natty
Uname: Linux 2.6.38-7-generic x86_64
UpgradeStatus: No upgrade log present (probably fresh install)
UserGroups: adm admin cdrom dialout lpadmin plugdev sambashare

Revision history for this message
Martin Erik Werner (arand) wrote : Dependencies.txt

apport information

tags: added: apport-collected natty
description: updated
Revision history for this message
Martin Erik Werner (arand) wrote :

I just tested updating btrfs-tools with the latest from http://git.kernel.org/?p=linux/kernel/git/mason/btrfs-progs-unstable.git;a=summary
and now btrfsck seems to work fine.
I think the debian experimental version is similar, so syncing that might be fitting?

Revision history for this message
Martin Erik Werner (arand) wrote :

Semi-rectraction of previous statement:
Turns out the reason it was booting was simply that it was failing due to the extra "-a" flag and skipping the fsck entirely.

I did not manage to apply the latest ubuntu change to the debian experimental version (and I know to little to resolve the merge there I think)

However, Simply grabbing the btrfsck binary from debian experimental and running it alongside the ubuntu version on the latest liveCD, the ubuntu one fails with the error above, whereas the debian exp succeeds to run the fsck.

Revision history for this message
Martin Erik Werner (arand) wrote :

I've spoke to another user who did not seem to have these issues on the current version so it seems it might be something to do with my particular system..

When I run fsck using the debian experimental version of the userspace tools I get this output:

ubuntu@ubuntu:~$ sudo btrfsck /dev/sda5
fs tree 259 refs 7 not found
 unresolved ref root 261 dir 256 index 31 namelen 4 name snap error 600
 unresolved ref root 262 dir 256 index 31 namelen 4 name snap error 600
 unresolved ref root 263 dir 256 index 31 namelen 4 name snap error 600
 unresolved ref root 264 dir 256 index 31 namelen 4 name snap error 600
 unresolved ref root 265 dir 256 index 31 namelen 4 name snap error 600
 unresolved ref root 266 dir 256 index 31 namelen 4 name snap error 600
 unresolved ref root 267 dir 256 index 31 namelen 4 name snap error 600
found 3873710080 bytes used err is 1
total csum bytes: 3517348
total tree bytes: 258281472
total fs tree bytes: 241065984
btree space waste bytes: 70634105
file data blocks allocated: 15013134336
 referenced 4583772160
Btrfs Btrfs v0.19

This is a fairly recent (few days) install, but what I have done so far is taken snapshots of my "/" subvolume via apt-btrfs-snapshot, rolled back to one of these snapshots, and deleted the old "/" subvolume along with some apt-snapshots that I did not use.

So my guess is that btrfs doesnt like that I've removed my original "/" subvolume, which is then what crashes current, and reports the above erros in experimental btrfs-tools.

So updating to the newer version wouldn't make much of a difference in practice, since mountall would still halt on these errors?

Revision history for this message
Loïc Minier (lool) wrote :

You also mentioned your fstab which I'm including below for reference; if you want to disable the fscks which are failing, you can set fs_passno to 0 (set last column to zero); this means that mountall wont fsck these fs on boot anymore.

# /etc/fstab: static file system information.
#
# Use 'blkid -o value -s UUID' to print the universally unique identifier
# for a device; this may be used with UUID= as a more robust way to name
# devices that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc nodev,noexec,nosuid 0 0
# / was on /dev/vda5 during installation
UUID=54e7f946-69a5-4cf7-891c-c7fad695ea4e / btrfs defaults,subvol=@ 0 1
# /boot was on /dev/vda1 during installation
UUID=79f93bfc-984d-4554-8eea-dcb4892f21f0 /boot ext3 defaults 0 2
# /home was on /dev/vda5 during installation
UUID=54e7f946-69a5-4cf7-891c-c7fad695ea4e /home btrfs defaults,subvol=@home 0 2

Revision history for this message
Loïc Minier (lool) wrote :

I agree that this issue seems specific to the steps you took; it would be nice to fix it.

I know little about btrfs subvolumes; is it ok to remove the original subvolume? Perhaps you could ask upstream whether it's ok to use btrfs as you did?

Revision history for this message
Martin Erik Werner (arand) wrote :

I have confirmed with upstream that deleting a subvolume which has subsequent snapshots IS supported

However, I was not able to reproduce this by some brief mucking about with snapshots in a new kvm install.
(Replacing @/ with a snapshot and deleting the old (original) @/-subvolume.)

So presumably this does not (exclusively?) relate to deleting snapshotted subvolumes.

Revision history for this message
AvitarX (ddwornik) wrote :

I appear to have this problem too.

Something locked up hard, and I held the power button to turn off.

I have successfully made an archive of the entire partition since then, so I can read fine.

Sometimes the system locks up and I cannot shutdown (don't know if it's related though).

root@user-desktop:/# btrfsck /dev/sdb1
couldn't open because of unsupported option features (8).
btrfsck: disk-io.c:683: open_ctree_fd: Assertion `!(1)' failed.
Aborted

And I click "I" during boot

Revision history for this message
AvitarX (ddwornik) wrote :

I'm actually wondering if mine started happening when I enabled LZO compression.

Revision history for this message
Gary M (garym) wrote :

@AvitarX, the btrfsck "unsupported option" error with LZO enabled was just reported in bug #777478. Please confirm there.

Revision history for this message
Swâmi Petaramesh (swami-petaramesh) wrote :

Having all of the same here, however not using lzo compression but zlib compression.

BTRFS fsck at boot fails with :

fsck de util-linux-ng 2.17.2
fsck de util-linux-ng 2.17.2
couldn't open because of unsupported option features (2).
fsck.btrfs: disk-io.c:683: open_ctree_fd: Assertion '!(1)' failed.
Attention... fsck.btrfs, périphérique /dev/mapper/VG1-TETHYS, signal de fin 6.
Des erreurs sérieuses ont été trouvées lors de la vérification du lecteur de disque pour /
Appuyer sur I pour ignorer, S pour passer le montage ou M pour récupération manuelle
mountall: fsck / [723] terminé avec le statut 8
mountall: Erreur non récupérable de fsck : /

Changed in btrfs-tools (Ubuntu):
status: New → Confirmed
Revision history for this message
Martin Erik Werner (arand) wrote :

For reference, I had not touched any compression setting on my install which i reported the bug initially on.

I am guessing that it is at least not directly related to compression... Though of course it may be an enhancing factor.

Revision history for this message
AvitarX (ddwornik) wrote :

I think the LZO compressions may be a red herring, I have 2 disks, and the one with LZO is giving the error, the other, with LZO and SSD is not.

Revision history for this message
whakim (wafa1024) wrote :

Just wanted to add that the exact same thing happens to me too (Ubuntu 11.04 AMD64 on a brand new Dell Inspiron 1545 laptop), even when I boot from the live CD or in recovery mode. While that error message:

fsck from util-linux-ng 2.17.2

 is being displayed, the screen flashes continuously as well. But if I hit [s] while that flashing occurs & the message is being displayed, it boots fine. I don't have LZO compression but there is one disk partition that I have not enabled mounting in fstab.

Revision history for this message
John Lewis (jlewis-johnlewis-deactivatedaccount) wrote :

@AvitarX LZO compression is not a red herring. It only appears to happen if you have a separate btrfs file-system from root AND you have balanced it (must be some difference between the way the root filesystem and home filesystems are checked on boot).

So steps to reproduce are:-

1. Fresh install of Natty with /boot as EXT4, / as BTRFS and /home as BTRFS.

2. Change mount options in /etc/fstab to include "compress=lzo".

3. Remount (mount -o remount /home) or reboot.

4. Balance filesystem "btrfs fi balance /home" and bingo borked btrfsck :)

Revision history for this message
whakim (wafa1024) wrote :

I do have /boot as EXT4 but /home & / are EXT4 too. I don't have LZO compression.

Revision history for this message
Martin Erik Werner (arand) wrote :

@John Lewis
I think compression cannot be an exclusive cause of the issue, seeing how me and whakim have not touched compression and are seing this.
What does the btrfsck tool from debian unstable report in your case with you compression setup, I would assume this might be different?
It could be that there are several issues all reporting the same nondescript error.

Compression would be a very logical explanation though, if the userspace fsck is simply outdated compared to the kernel btrfs code.

I still maintain that enabling btrfsck at all was a big mistake... I was never meant to be used like this.

...I wonder if it wold be possible to reproduce this error using only snapshots and balancing, since that would explain the non-compression cases...

Revision history for this message
doclist (dclist) wrote :

I have the same problem, I do not believe I have compression enabled. btrfsck complains of "unresolved ref root" for a snapshot I made on each of my btrfs partitions. The btrfsck is adding about 2.5 minutes to startup each boot :(

Revision history for this message
doclist (dclist) wrote :

Upon review it may not be the same problem since I do not get the
     couldn't open because of unsupported option features (2).
     fsck.btrfs: disk-io.c:683: open_ctree_fd: Assertion `!(1)' failed.
error

Revision history for this message
Carey Underwood (cwillu) wrote :

The btrfs-tools in ubuntu are quite old, and don't support several features which exist. The "unsupported option features (2)" shows which specific flag is unknown, and can be looked up in the kernel sources at /fs/btrfs/ctree.h (look for BTRFS_FEATURE_INCOMPAT_*).

It's not terribly critical however, as btrfsck doesn't make any repairs to the filesystem yet, it's purely a diagnostic tool at the moment.

Revision history for this message
Carey Underwood (cwillu) wrote :

Whoops, meant to include:

2 == (1<<1), which means BTRFS_FEATURE_INCOMPAT_DEFAULT_SUBVOL. git pickaxe points me to commit 6ef5ed last december, which added support for changing the default subvolume. It the incompat flag was set to prevent older kernels from silently mounting the wrong tree; this shouldn't affect the correctness of btrfsck's work however.

Revision history for this message
Ricardo Graça (devius) wrote :

Still present in Oneiric. As in comment #15 I have a /boot partition with ext4 and / and /home with btrfs and the compress=lzo option. I didn't perform a balance on the filesystem however, unless the system did it by itself.

Revision history for this message
AO (aofrl10n) wrote :

This bug also affects Precise.
Adding compress=lzo results in:
couldn't open because of unsupported option features (8).
btrfsck: disk-io.c:679: open_ctree_fd: Assertion `!(1)' failed.
How come that 7 months later this ug is still not assigned to anyone on the btrfs ubuntu team?

Revision history for this message
Kyle Gates (kylegates) wrote :
Revision history for this message
AO (aofrl10n) wrote :

This is still happening during the boot process in Precise and654 (fully updated as of 15-02-2011) on a LZo compressed /home partition.

Revision history for this message
Peter Würtz (pwuertz) wrote :

Can we please get a recent version of btrfs-progs after waiting for over half a year? Thanks.

Revision history for this message
Pieter (diepes) wrote :

Trying to convert ext4 to btrfs, i get same error when starting up. Using beta2 2012-04 and grub2.
!Retyped!
fsck from util-linux 2.20.1
couldn't open because of unsupported option features (2).
fsck.btrfs: disk-io.c:679: open_ctree_fd: Assertion `!(1)' failed.
...
...
...
Ignoring errors with / at user request
mount: / not mounted or bad option
mountall: mount / [990] terminated with status 32
mountall: Filesystem could not be mounted: /

Revision history for this message
AleksanderAdamowski (aadamowski) wrote :

Debian has a newer version available (0.19+20120328 currently):

http://packages.debian.org/sid/btrfs-tools

Did you try building it and installing on Ubuntu?

It's quite simple:

$ sudo apt-get build-dep btrfs-tools

$ wget http://ftp.de.debian.org/debian/pool/main/b/btrfs-tools/btrfs-tools_0.19+20120328-1.dsc http://ftp.de.debian.org/debian/pool/main/b/btrfs-tools/btrfs-tools_0.19+20120328.orig.tar.gz http://ftp.de.debian.org/debian/pool/main/b/btrfs-tools/btrfs-tools_0.19+20120328-1.debian.tar.gz

$ dpkg-source -x btrfs-tools_0.19+20120328-1.dsc

$ cd btrfs-tools-0.19+20120328/

$ dpkg-buildpackage -rfakeroot

$ sudo dpkg -i btrfs-tools_0.19+20120328-1_amd64.deb

Revision history for this message
Vladimir Wetzel (wetzel) wrote :

Thx Aleks,

// Debian has a newer version available (0.19+20120328 currently):
//
//http://packages.debian.org/sid/btrfs-tools

this one works fine for me.

Revision history for this message
Jonathan D (jona-dem) wrote :

I just had the same problem on kubuntu 12.04 :
couldn't open because of unsupported option features (8).
for my /home (/dev/sda4)

The newer version available (0.19+20120328 currently) solved it !

Thanks !

Changed in btrfs-tools (Ubuntu):
importance: Undecided → Critical
assignee: nobody → Dmitrijs Ledkovs (dmitrij.ledkov)
importance: Critical → Medium
Revision history for this message
Miha Vrhovnik (mvrhov) wrote :

This one has just bitten me in my ass on 12.04. And our mngmt. is pissed as hell because of this bug our services were unavailable for quite some time. Running on EC2 and fixing a nonbootable instance requires a special procedure. We are really wondering why after a year this is not fixed in a 12.04 LTS.

Changed in btrfs-tools (Ubuntu):
status: Confirmed → Triaged
Changed in btrfs-tools (Ubuntu Precise):
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

btrfs-tools (0.19+20120328-2ubuntu1) quantal; urgency=low

  [ Philip Muškovac ]
  * Merge from debian (LP: #894456), remaining changes:
    - 07-allow-fsck-options.patch (updated):
      + Make fsck.btrfs not fail when called with fsck options.
    - btrfs-tools-udeb.install:
      + ship btrfs in the udeb.
    - btrfs-tools.links:
      + Add btrfsck -> fsck.btrfs symlink

  [ Dmitrijs Ledkovs ]
  * Dropped changes:
    - debian/patches/04-werror.patch - included upstream
    - debian/patches/05-fix-ld.patch - applied in debian
    - 09-unused-warnings.patch - included upstream
on 2012-05-25

Changed in btrfs-tools (Ubuntu Quantal):
status: Triaged → Fix Released
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

With quantal-lts kernel & X stack to precise, this bug becomes even more evident.

Ken Sharp (kennybobs)
tags: added: i386 precise quantal
Revision history for this message
masc (masc) wrote :

in my case the (v2) space cache was preventing a repair, causing this error.

after invoking `btrfs check --clear-space-cache v2 <device>`, `--repair` stopped complaining.

Revision history for this message
Steve Langasek (vorlon) wrote :

The Precise Pangolin has reached end of life, so this bug will not be fixed for that release

Changed in btrfs-tools (Ubuntu Precise):
status: Triaged → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.