btrfs-convert does not work (unable to open ctree)

Bug #1228302 reported by Andrea Agnolin
46
This bug affects 10 people
Affects Status Importance Assigned to Milestone
Linux
Unknown
Unknown
btrfs-tools (Debian)
Fix Released
Unknown
btrfs-tools (Fedora)
Fix Released
Undecided
btrfs-tools (Ubuntu)
Fix Released
Medium
Dimitri John Ledkov

Bug Description

I've tried to convert an ext4 partition on /dev/sda3 to btrfs
I've run an "e2fsck -vyf" and everything was ok
Then I run btrfs-convert:

# btrfs-convert /dev/sda3
No valid Btrfs found on /dev/sda3
unable to open ctree
conversion aborted.

$ uname -a
Linux gamma 3.11.0-7-generic #14-Ubuntu SMP Mon Sep 16 18:37:27 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

ProblemType: Bug
DistroRelease: Ubuntu 13.10
Package: btrfs-tools 0.19+20130705-1
ProcVersionSignature: Ubuntu 3.11.0-7.14-generic 3.11.1
Uname: Linux 3.11.0-7-generic x86_64
ApportVersion: 2.12.4-0ubuntu1
Architecture: amd64
Date: Fri Sep 20 19:38:28 2013
InstallationDate: Installed on 2012-10-19 (335 days ago)
InstallationMedia: Ubuntu 12.10 "Quantal Quetzal" - Release amd64 (20121017.5)
MarkForUpload: True
SourcePackage: btrfs-tools
UpgradeStatus: Upgraded to saucy on 2013-09-12 (7 days ago)

Revision history for this message
Andrea Agnolin (agno94) wrote :
Revision history for this message
In , Rolf (rolf-redhat-bugs) wrote :

Description of problem:
When trying to convert an ext4 FS to BTRFS btrfs-convert refuses claiming "No valid Btrfs found in /dev/mapper/BCACHE-ROOTFS'

Version-Release number of selected component (if applicable):
btrfs-progs-0.20.rc1.20130917git194aa4a-1.fc20.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Build a system running root on LVM
2. Boot an F20 Live DVD
3. yum install btrfs-progs
4. start btrfs-convert /dev/mapper/BCACHE-ROOTFS
5. Error: No valid Btrfs found on /dev/mapper/BCACHE-ROOTFS

Actual results:
No valid Btrfs found on /dev/mapper/BCACHE-ROOTFS
unable to open ctree
conversion aborted.

Expected results:
Smooth conversion

Additional info:
http://thread.gmane.org/gmane.comp.file-systems.btrfs/28290

Revision history for this message
In , Rolf (rolf-redhat-bugs) wrote :

The more simple case provide by "Additional info" can also be used to reproduce:

Quote:
  way to reproduce error:
  $ truncate -s 4G file
  $ mkfs.ext4 file #say yes to create fs on non block device.
  $ btrfs-convert file
   No valid Btrfs found on file
   unable to open ctree
   conversion aborted.

Revision history for this message
In , Eric (eric-redhat-bugs) wrote :

Yep, this was regression reported upstream some time ago. A patch to fix it has been sent to the list, but a month later upstream still hasn't merged it (or any other patches).

When upstream accepts the fix, we can update btrfs-progs in Fedora to fix this bug.

thanks,
-Eric

affects: btrfs-tools → lebtrfs
affects: lebtrfs → linux
Revision history for this message
In , Tim (tim-redhat-bugs) wrote :

JFTR: This is also present in Fedora 19 and needs to be fixed there as well.

Revision history for this message
In , Eric (eric-redhat-bugs) wrote :

And still JFTR: If upstream ever accepts this (or for that matter any) patch, I'll gladly fix it.

"Upstream first" - live by the sword, die by the sword. ;)

Thanks,
-Eric

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
txemi (txemitron) wrote :

It also happens with ext4

#lvcreate -L 2G -n test2.ext2 vg1
#mkfs.ext2 /dev/vg1/test2.ext2
#btrfs-convert /dev/vg1/test2.ext2
No valid Btrfs found on /dev/vg1/test2.ext2
unable to open ctree
conversion aborted.

Revision history for this message
Andrea Agnolin (agno94) wrote :

I compiled from
git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-progs.git
adding this patch
https://patchwork.kernel.org/patch/2828820/
and now everything works

Revision history for this message
txemi (txemitron) wrote :

I rebuilt ubuntu package adding same patch and worked for me too.

Changed in btrfs-tools (Ubuntu):
importance: Undecided → Medium
Changed in btrfs-tools (Debian):
status: Unknown → New
Revision history for this message
pascal germroth (pascal-ensieve) wrote :

Until the package includes the patch, these are the steps to compile it manually as per Andrea Agnolin's answer:

sudo apt-get build-dep btrfs-tools
git clone git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-progs.git
cd btrfs-progs
curl https://patchwork.kernel.org/patch/2828820/raw/ | git apply
make
sudo ./btrfs-convert /my/device

Changed in btrfs-tools (Ubuntu):
status: Confirmed → Fix Committed
assignee: nobody → Dmitrijs Ledkovs (xnox)
Changed in btrfs-tools (Debian):
status: New → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package btrfs-tools - 0.19+20130705-3

---------------
btrfs-tools (0.19+20130705-3) unstable; urgency=low

  * Import patch by Shilong Wang to resolve btrfs-convert (Closes:
    #724265) (LP: #1228302)

 -- Dmitrijs Ledkovs <email address hidden> Fri, 18 Oct 2013 23:47:16 +0100

Changed in btrfs-tools (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
Andrea Agnolin (agno94) wrote :

In saucy we still we the previous version:

apt-cache policy btrfs-tools
btrfs-tools:
  Installato: 0.19+20130705-1
  Candidato: 0.19+20130705-1
  Tabella versione:
 *** 0.19+20130705-1 0
        500 http://archive.ubuntu.com/ubuntu/ saucy/main amd64 Packages
        500 http://it.archive.ubuntu.com/ubuntu/ saucy/main amd64 Packages
        100 /var/lib/dpkg/status

Revision history for this message
In , Tim (tim-redhat-bugs) wrote :

With btrfs-progs-3.12-1.fc19.i686, this works for me now in Fedora 19.

Revision history for this message
In , Eric (eric-redhat-bugs) wrote :

Great, thanks for the feedback.

Changed in btrfs-tools (Fedora):
importance: Unknown → Undecided
status: Unknown → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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