Please merge or sync new btrfs-tools from Debian testing or unstable - lots of bugs present in Ubuntu now :(

Bug #894456 reported by AO
222
This bug affects 43 people
Affects Status Importance Assigned to Milestone
Baltix
New
Undecided
Unassigned
btrfs-tools (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Curernt version of btrfs-tools in ubuntu 0.19+20100601 is very old and have lots of bugs comparing with the latest available from Debian testing or unstable:

btrfs-tools (0.19+20111105-2) unstable; urgency=low

   * Using btrfs instead of btrfsctl in initramfs (Closes: #650614).

 -- Daniel Baumann <email address hidden> Sat, 10 Dec 2011 10:33:06 +0100
btrfs-tools (0.19+20111105-1) unstable; urgency=low

   * Switching architecture fields to linux-any.
   * Adding patch to call gzip with full path when creating manpages to
     fix FTBFS on squeeze.
   * Using compression level 9 also for binary packages.
   * Merging upstream version 0.19+20111105.
   * Updating year in copyright file.
   * Sorting overrides in rules alphabetically.
   * Prefixing variables in rules to avoid clashes.
   * Rediffing labels.patch.
   * Rediffing ftbfs.patch.
   * Rediffing linker.patch.
   * Removing gcc-4.6.patch, not required anymore.
   * Renumbering patches.
   * Avoid polluting namespace by prefixing some tools with btrfs.
   * Updating list of additional tools to be built.

 -- Daniel Baumann <email address hidden> Sat, 19 Nov 2011 03:15:21 +0100
btrfs-tools (0.19+20101101-2) unstable; urgency=low

   * Updating maintainer and uploaders fields.
   * Removing vcs fields.
   * Removing references to my old email address.
   * Updating year in copyright file.
   * Updating to standards version 3.9.2.
   * Compacting copyright file.
   * Dropping btrfs.modules, went into initramfs-tools (Closes: #612642).
   * Adding patch from Luk Claes <email address hidden> to fix FTBFS with --no-
     add-needed (Closes: #554059).
   * Adding patch from Jonathan Nieder <email address hidden> to fix FTBFS
     with gcc-4.6 (Closes: #616296).
   * Simplfying build and install overrides in rules.
   * Applying slightly modified patch from Jonathan Nieder
     <email address hidden> to fix CFLAGS handling in rules, see #616296.

 -- Daniel Baumann <email address hidden> Sun, 28 Aug 2011 09:31:25 +0200
2010
btrfs-tools (0.19+20101101-1) experimental; urgency=low

   * Merging upstream version 0.19+20101101.
   * Switching to source format 3.0 (quilt).

 -- Daniel Baumann <email address hidden> Sat, 20 Nov 2010 14:27:29 +0100
btrfs-tools (0.19+20100909-2) experimental; urgency=low

   * Update references to btrfs-tools instead of btrfs-progs (upstream name)
     in manpages (Closes: #599111).
   * Removing warnings about experimental status.
   * Updating package to debhelper 8.

 -- Daniel Baumann <email address hidden> Mon, 04 Oct 2010 21:28:58 +0200
btrfs-tools (0.19+20100909-1) experimental; urgency=low

   * Correcting credits for glibc.patch in patch file and changelog entry
     to David Sugar <email address hidden>.
   * Updating standards version to 3.9.0.
   * Merging upstream version 0.19+20100909.
   * Removing glibc.patch, merged upstream.
   * Updating standards version to 3.9.1.

 -- Daniel Baumann <email address hidden> Sat, 25 Sep 2010 18:59:07 +0200

Debian version is almost the latest from Chris Masson on git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-progs.git

Please merge or sync new btrfs-tools from Debian testing or unstable

Doing so might fix btrfsck reporting errors when dealing with a btrfs partition using compress=lzo.

couldn't open because of unsupported option features (8).
btrfsck: disk-io.c:679: open_ctree_fd: Assertion `!(1)' failed

This is on Precise but also true for older Ubuntu versions

Related branches

tags: added: upgrade-software-version
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in btrfs-tools (Ubuntu):
status: New → Confirmed
Revision history for this message
Karl Mardoff Kittilsen (nightdog) wrote :

With a btrfs-tools this old, you miss out on a great deal of features. Scrub for one, btrfs-zero-log being another, and a fix in the consistency between btrfs --help and the man page but the list here is quite long. There is also a restore utility in there to rescure unmountable systems (pull data off a broken FS).

I would really like for these tools to be available on my 12.04 LTS server by default.

Revision history for this message
syscon-hh (syscon-kono) wrote :

On the URL following you will find the btrfs-tools version 0.19+20111105-2

-> http://packages.debian.org/en/sid/btrfs-tools <-

(provided as *deb-package) which contains a lot of the features requested. This should in minimum be integrated to the ubuntu-repos next.

summary: - Old version of btrfs-tools in ubuntu
+ Please merge or sync new btrfs-tools from Debian testing or unstable -
+ lots of bugs present in Ubuntu now :(
description: updated
Revision history for this message
Holger Mauermann (mauermann) wrote :

Any chance to get new btrfs-tools in 12.04?

Revision history for this message
Brian J. Murrell (brian-interlinx) wrote :

Yes please. Shipping a version that is almost 2 years old for a filesystem that is under heavy development is really bad.

Revision history for this message
Brian J. Murrell (brian-interlinx) wrote :

I have successfully built the aforementioned debian sid package (http://packages.debian.org/en/sid/btrfs-tools) on Precise with success. It did require adding one more patch to the series though: http://permalink.gmane.org/gmane.comp.file-systems.btrfs/14273

Revision history for this message
sam tygier (samtygier) wrote :

btrfs-progs upstream now has a working fsck.

Revision history for this message
pieterjanvu (pieterjanvu) wrote :

Would love to benefits from the updated features in upstream btrfs-progs. Fingers crossed for an updated package. Debian sid has version 0.19+20120328-1 now: http://packages.debian.org/sid/btrfs-tools

Revision history for this message
Grizzly (sven-witterstein) wrote :

I hoped pangolin would SOLVE the issue of not being able to repair my btrfs-filesystems. Now I have no sound and cant repair :-(

Revision history for this message
Grizzly (sven-witterstein) wrote :

... and even in the next version (https://blueprints.launchpad.net/ubuntu/+source/btrfs-tools) the two-year old source is listed. Ts. When I find the time, I should checkout a gentoo-based distro for good :-(
Any chance at least to get it in a ppa?

Revision history for this message
Grizzly (sven-witterstein) wrote :

Answering my questin: thanks to Philip Muškovac, i might be able to repair my btrfses. On the other hands: "daily" builds can be risky, too... https://blueprints.launchpad.net/~yofel/+archive/btrfs

Revision history for this message
Grizzly (sven-witterstein) wrote :

Scrub now running!

Revision history for this message
Tessa (unit3) wrote :

Gizzly: You don't need a daily PPA, I agree that is a little unsafe. However, there's an easier solution, since it looks like Ubuntu failed to get this critical update included. You can use prevu to easily build the package from Debian/testing:

prevu http://ftp.de.debian.org/debian/pool/main/b/btrfs-tools/btrfs-tools_0.19+20120328-1.dsc

That should do the trick for you to get a useful, recent package built and available in apt. Honestly, the package builds so easily and works without problems, it's really baffling why 12.04 doesn't include something recent.

Revision history for this message
Philip Muškovac (yofel) wrote :

I found btrfs-tools 0.19+20120328-1 in wheezy, so I'll see if I can get that merged for quantal now.

Changed in btrfs-tools (Ubuntu):
assignee: nobody → Philip Muškovac (yofel)
Gary M (garym)
tags: added: natty oneiric precise
Revision history for this message
Philip Muškovac (yofel) wrote :

Debdiff against old ubuntu package

Revision history for this message
Philip Muškovac (yofel) wrote :

Debdiff against debian package.

The package works for me, except fsck.btrfs which I had to disable as it fails hard when / is mounted read-only at boot. (has to be unmounted to be checked)

Changed in btrfs-tools (Ubuntu):
assignee: Philip Muškovac (yofel) → nobody
status: Confirmed → Triaged
Revision history for this message
Philip Muškovac (yofel) wrote :

New ubuntu debdiff. Instead of removing fsck.btrfs make it a symlink to /bin/true - that at least makes mountall happy.

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

Please note, I am not a Core Developer and cannot upload your update.

= FTBFS (kind-of) =
- when build in debian sid chroot, current debian & updated ubuntu packages fail to build from source, due to changes in dh_builddeb. I filed this as a debian bug with a patch http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=673283 . It doesn't affect quantal yet, but it might come back to us later.

= debian/changelog =
- Would be helpful to note why certain patches are dropped from ubuntu packaging. I had to investigate again myself. E.g.:
  * Dropped changes:
    - debian/patches/04-werror.patch - included upstream
    - debian/patches/05-fix-ld.patch - applied in debian
    - 09-unused-warnings.patch - included upstream

symlinking /sbin/fsck.btrfs to /bin/true:
Upstream claims:
  * Latest btrfs-progs (c. 26 Mar 2012)
    - btrfsck can now repair some forms of filesystem breakage

Maybe there is some value in using btrfsck as fsck.btrfs?

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

I have attached additional changes:
* description of dropped changes
* FTBFS fix

I will try these new btrfs tools in the upcoming days.

Revision history for this message
Philip Muškovac (yofel) wrote :

* - Would be helpful to note why certain patches are dropped from ubuntu packaging. I had to investigate again myself. E.g.:
Right, thanks for adding that.

* Maybe there is some value in using btrfsck as fsck.btrfs?
The problem is that you can't run btrfsck on mounted filesystems. That includes read-only mounts. So the only way to use fsck.btrfs would be from initrd before / is mounted. In all test I did using btrfsck as fsck.btrfs it failed because / was already mounted.
On another note, some of the btrfs recovery code is in-kernel and reachable by mounting with '-o recovery'.
A different solution that came up in #btrfs on IRC would be to copy fsck.xfs for btrfs. That's a script that does nothing on boot, but tells you to use xfs_check or xfs_repair when run manually.

Revision history for this message
Jeremy Bícha (jbicha) wrote :

Philip, you're not supposed to run fsck on mounted filesystems and symlinking fsck to /bin/true is a very bad idea.

To demonstrate, here's what happens when I try with an ext4 filesystem:

$ sudo fsck /dev/sda6
fsck from util-linux 2.20.1
e2fsck 1.42 (29-Nov-2011)
/dev/sda6 is mounted.

WARNING!!! The filesystem is mounted. If you continue you ***WILL***
cause ***SEVERE*** filesystem damage.

Do you really want to continue<n>? no

check aborted.

Revision history for this message
Philip Muškovac (yofel) wrote :

That's only partly what I wanted to say. Here's a comparison of btrfsck and e2fsck (different devices as I put btrfs on an SD card for this):

Case 1: FS mounted RW
e2fsck: sees that the FS is mounted and errors out as in your post.
$ sudo btrfsck /dev/mmcblk0p1
/dev/mmcblk0p1 is currently mounted. Aborting.

Both abort as they should. OK

Case 2: FS unmounted
$ sudo e2fsck /dev/sdb1
e2fsck 1.42 (29-Nov-2011)
/dev/sdb1: clean, 249/33200 files, 35453/132528 blocks
$ sudo btrfsck /dev/mmcblk0p1
checking extents
checking fs roots
checking root refs
found 28672 bytes used err is 0
total csum bytes: 0
total tree bytes: 28672
total fs tree bytes: 8192
btree space waste bytes: 24411
file data blocks allocated: 0
 referenced 0
Btrfs Btrfs v0.19

Both do a simple check of the FS and return 0. OK

Case 3: FS mounted RO (this is the case on system bootup which we care about. mountall will call fsck -n <device> here)
$ sudo e2fsck -n /dev/sdb1
e2fsck 1.42 (29-Nov-2011)
Warning! /dev/sdb1 is mounted.
/dev/sdb1: clean, 249/33200 files, 35453/132528 blocks
$ sudo btrfsck -n /dev/mmcblk0p1
/dev/mmcblk0p1 is currently mounted. Aborting.
-> exit status 240
-> mountall sees that fsck returned with non-zero exit status and you end up on the rescue prompt.
(that's the patched btrfsck from the package, otherwise it'll fail because it doesn't recognise -n)

So, that leaves us with an fsck.btrfs that's unusable for mountall purposes. I choose to symlink /bin/true, as that's a simple way to not re-introduce bug 660649.
Solution 2 as I said would be a script that at least tells you that fsck.btrfs does nothing, and how you're supposed to use btrfsck.
Solution 3 would be to actually make -n do something useful, which would have to be done by the btrfsck developer. OR we adjust our btrfsck patch so it makes -n simply exit without doing anything.

Opinions?

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

Can we modify mountall to run fsck.btrfs before mounting the filesystem read-only?

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

FTBFS issue got resolved in Debian. I have 'rebased' the merge on top of -2.
I did it in a branch this time around, preserving separate Author for the Philip Muškovac commit.
We should resolve fsck.btrfs question before sponsoring this.
All ubuntu/debian/interdiffs can be generated from the branch, hence removing them from the bug, unless there is a desire to leave them here.

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

I have create bug 1002277 against mountall to support running fsck prior to mounting a filesystem.

Revision history for this message
Philip Muškovac (yofel) wrote :

I've updated 07-allow-fsck-options.patch based on your branch. Now btrfsck just prints the version and exits with 0 if you run it with -a/-y/-n/-r and made fsck.btrfs a symlink to btrfsck again. A simple test worked fine, but please re-test.

Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (3.6 KiB)

This bug was fixed in the package btrfs-tools - 0.19+20120328-2ubuntu1

---------------
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

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

  * Updating compression handling for udeb with newer debhelper (Closes:
    #673283).

btrfs-tools (0.19+20120328-1) unstable; urgency=low

  * Including ioctl.h in btrfs-tools (Closes: #658471).
  * Merging upstream version 0.19+20120328.
  * Updating to debhelper version 9.
  * Updating to standards version 3.9.3.
  * Updating copyright file machine-readable format version 1.0.
  * Shortening manual build targets now that upstreams makefile has been
    updated.
  * Adding patch from Donald Gordon <email address hidden> to correct getopt
    (Closes: #665434).

btrfs-tools (0.19+20111105-2) unstable; urgency=low

  * Using btrfs instead of btrfsctl in initramfs (Closes: #650614).

btrfs-tools (0.19+20111105-1) unstable; urgency=low

  * Switching architecture fields to linux-any.
  * Adding patch to call gzip with full path when creating manpages to
    fix FTBFS on squeeze.
  * Using compression level 9 also for binary packages.
  * Merging upstream version 0.19+20111105.
  * Updating year in copyright file.
  * Sorting overrides in rules alphabetically.
  * Prefixing variables in rules to avoid clashes.
  * Rediffing labels.patch.
  * Rediffing ftbfs.patch.
  * Rediffing linker.patch.
  * Removing gcc-4.6.patch, not required anymore.
  * Renumbering patches.
  * Avoid polluting namespace by prefixing some tools with btrfs.
  * Updating list of additional tools to be built.

btrfs-tools (0.19+20101101-2) unstable; urgency=low

  * Updating maintainer and uploaders fields.
  * Removing vcs fields.
  * Removing references to my old email address.
  * Updating year in copyright file.
  * Updating to standards version 3.9.2.
  * Compacting copyright file.
  * Dropping btrfs.modules, went into initramfs-tools (Closes: #612642).
  * Adding patch from Luk Claes <email address hidden> to fix FTBFS with --no-
    add-needed (Closes: #554059).
  * Adding patch from Jonathan Nieder <email address hidden> to fix FTBFS
    with gcc-4.6 (Closes: #616296).
  * Simplfying build and install overrides in rules.
  * Applying slightly modified patch from Jonathan Nieder
    <email address hidden> to fix CFLAGS handling in rules, see #616296.

btrfs-tools (0.19+20101101-1) experimental; urgency=low

  * Merging upstream version 0.19+20101101.
  * Switching to source format 3.0 (quilt).

btrfs-tools (0.19+20100909-2) experimental; urgency=low

  * Update references to btrfs-tools instead of btrfs-progs (upstream name)
    in manpages (Closes: #599111).
  * Remo...

Read more...

Changed in btrfs-tools (Ubuntu):
status: Triaged → Fix Released
Revision history for this message
pieterjanvu (pieterjanvu) wrote :

Hi, I have a few questions, sorry if they are naive:
What is the best way to go about installing this fix in precise? Is it compatible with precise?
Can we add a repository or just install the package with dpkg? If later updates are provided in the repository for this package, will it automatically update/upgrade with apt-get?

Revision history for this message
Dimitri John Ledkov (xnox) wrote : Re: [Bug 894456] Re: Please merge or sync new btrfs-tools from Debian testing or unstable - lots of bugs present in Ubuntu now :(

On 25/05/12 13:55, Pieterjan Van Uytvanck wrote:
> Hi, I have a few questions, sorry if they are naive:
> What is the best way to go about installing this fix in precise? Is it compatible with precise?
> Can we add a repository or just install the package with dpkg? If later updates are provided in the repository for this package, will it automatically update/upgrade with apt-get?
>

I am planning to provide this package for precise via archive, backports
or a ppa.

I haven't currently tested this package with precise's kernel.

This package might be backported to precise together with the quantal's
kernel.

Please stay tuned. I will be blogging about it on Planet Ubuntu.

Regards,

Dmitrijs.

tags: added: fs.oneplanning
Changed in btrfs-tools (Ubuntu Precise):
milestone: none → ubuntu-12.04.1
Changed in btrfs-tools (Ubuntu Precise):
status: New → Confirmed
importance: Undecided → Wishlist
assignee: nobody → Dmitrijs Ledkovs (dmitrij.ledkov)
Revision history for this message
Martin Pitt (pitti) wrote :

Synced into quantal in bug 1013265. Unsubscribing sponsors as this quantal task is already "fix released" and the sync (unnecessarily) has a separate bug, and this bug has no attachment to sponsor.

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

Backport requested for precise, see bug 1016438

no longer affects: btrfs-tools (Ubuntu Precise)
Revision history for this message
Stefan Lasiewski (stefanlasiewski) wrote :

> Please stay tuned. I will be blogging about it on Planet Ubuntu.

Dmitrijs, are you still planning on writing about this on Planet Ubuntu?

Revision history for this message
Grizzly (sven-witterstein) wrote :

I don't know if it belongs here, but I have precise now on btrfs, updated to yofel's ppa.
One thing is missing in chattr (e2fsprogs) also:

sudo mkdir vbox
sudo chattr +C vbox

Usage: chattr [-RVf] [-+=AacDdeijsSu] [-v Version] Files...

--> Apparently the "nodatacow"-Attribute-setting is not understood by the e2fsprogs in precise :-((

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

@ Grizzly
No this does not belong here. Please file a new bug against correct package: e2fsprogs

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related blueprints

Remote bug watches

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