
On 9/17/13 3:02 PM, Raymond Wooninck wrote:
Hi Listmates,
Based on all the emails around btrfs I decided to try it for myself. I took a non-critical filesystem and tried to convert it from ext4 to btrfs. This fails terribly.
The steps followed :
1) Unmount filesystem 2) Run fsck on it 3) run btrfs-convert /dev/..
The filesystem was indicated as clean after step 2. Running Step 3 has the following output:
HQVMT4XX20:~ # btrfs-convert /dev/sda8 creating btrfs metadata. creating ext2fs image file. cleaning up system chunk. Segmentation fault
dmesg reports 6687.468953] traps: btrfs-convert[6251] general protection ip:7f0afc68e779 sp:7fffb93b0278 error:0 in libc-2.18.so[7f0afc545000+1a5000]
Based on the above I tried to check the filesystem with: HQVMT4XX20:~ # btrfsck /dev/sda8 Checking filesystem on /dev/sda8 UUID: 78c33893-dc21-4d91-81ce-db2d7aa286cc checking extents checking free space cache cache and super generation don't match, space cache will be invalidated checking fs roots root 256 inode 257 errors 800 found 5117008838 bytes used err is 1 total csum bytes: 63601216 total tree bytes: 156311552 total fs tree bytes: 56406016 total extent tree bytes: 10194944 btree space waste bytes: 36885620 file data blocks allocated: 132221116416 referenced 132221116416 Btrfs v0.20-rc1+20130701
But I can't mount the filesystem. Dmesg reports:
6688.477011] device fsid 78c33893-dc21-4d91-81ce-db2d7aa286cc devid 1 transid 23 /dev/sda8 [ 6689.254801] device fsid 78c33893-dc21-4d91-81ce-db2d7aa286cc devid 1 transid 23 /dev/sda8 [ 6749.299029] device fsid 78c33893-dc21-4d91-81ce-db2d7aa286cc devid 1 transid 23 /dev/sda8 [ 6749.301150] btrfs: disk space caching is enabled [ 6749.368809] btrfs: bad chunk start, em=0, wanted=33554432 [ 6749.368819] Failed to read block groups: -5 [ 6749.391860] btrfs: open_ctree failed
Am I doing something wrong or is this a bug ?
Both. Any fsck wouldn't be expected to reconstruct a file system that wasn't completely constructed yet. Especially in this case where the very last step of the conversion is to move the superblock into place. Before that happens, the converted file system doesn't officially exist yet. There is a bug, obviously, in that convert is segfaulting. As Frederic noted, there's an updated btrfsprogs in filesystems:btrfsprogs that should be landing in Factory soon. The issue there was a code clean up for opening and closing the tree where it didn't account for the superblock being in a nonstandard place like it is during the conversion. If you still run into an issue with the updated btrfsprogs, let me know. -Jeff -- Jeff Mahoney SUSE Labs