Bug 721160

Summary: Missing btrfs support
Product: [Fedora] Fedora Reporter: Jan Kratochvil <jan.kratochvil>
Component: libguestfsAssignee: Richard W.M. Jones <rjones>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 14CC: crobinso, mbooth, rjones, virt-maint
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 721275 (view as bug list) Environment:
Last Closed: 2012-06-06 17:55:03 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 721275    

Description Jan Kratochvil 2011-07-13 21:44:24 UTC
Description of problem:
Tried to play with btrfs in kvm but it is difficult without guestfish.

Version-Release number of selected component (if applicable):
guestfish-1.10.4-1.fc15.x86_64
guestfish-1.8.8-1.fc14.x86_64

How reproducible:
Always

Steps to Reproduce:
Run guestfish
btrfs
btrfsck

Actual results:
><fs> btrfs
btrfs: unknown command
><fs> btrfsck
btrfsck: unknown command
><fs> 

Expected results:
Such command there.

Additional info:

Comment 1 Richard W.M. Jones 2011-07-14 07:31:01 UTC
We have support for making btrfs filesystems.  But we should add
commands for the btrfs tools.

Can you give me a brief overview of which tools / operations
are the most important and popular and that we should work on
first?

Comment 2 Jan Kratochvil 2011-07-14 07:48:18 UTC
I am not any expert but:
btrfs filesystem resize
btrfsck
fdisk - not filed above; there is sfdisk but I do not find sfdisk easy enough.

But when booting in kvm with init=/bin/sh I got:
ERROR: unable to resize '/'
after re-fdisk-ing /dev/vda2 to be larger so guestfish probably may not help.


sh-4.2# btrfsck /dev/vda2
found 3012730880 bytes used err is 0
total csum bytes: 2760168
total tree bytes: 186318848
total fs tree bytes: 174235648
btree space waste bytes: 52924033
file data blocks allocated: 3124961280
 referenced 2796343296
Btrfs Btrfs v0.19
sh-4.2# btrfs filesystem resize max /
Resize '/' of 'max'
ERROR: unable to resize '/'
sh-4.2# cat /proc/version 
Linux version 2.6.38.6-27.fc15.x86_64 (mockbuild.fedoraproject.org) (gcc version 4.6.0 20110428 (Red Hat 4.6.0-6) (GCC) ) #1 SMP Sun May 15 17:23:28 UTC 2011
sh-4.2# rpm -q kernel
kernel-2.6.38.6-27.fc15.x86_64

Comment 3 Richard W.M. Jones 2011-07-14 07:56:46 UTC
(In reply to comment #2)
> I am not any expert but:
> btrfs filesystem resize
> btrfsck
> fdisk - not filed above; there is sfdisk but I do not find sfdisk easy enough.

Note that if you want to rescue a VM, you can use
virt-rescue.  The btrfs tools are all included:

><rescue> btrfs<tab>
btrfs              btrfs-image        btrfs-vol          btrfstune
btrfs-convert      btrfs-map-logical  btrfsck            
btrfs-debug-tree   btrfs-show         btrfsctl           

The resize issue seems to be a separate btrfs thing.

We should add support for resizing to virt-resize as well,
which will be particularly important since F16 installs may
default to btrfs.

Comment 4 Richard W.M. Jones 2011-07-14 12:21:51 UTC
I added btrfs-filesystem-resize API in libguestfs 1.11.17:

http://git.annexia.org/?p=libguestfs.git;a=commitdiff;h=a001a0d710ec61d8bc11841f44ac0d1f296040ea

Comment 5 Cole Robinson 2012-06-06 17:55:03 UTC
Since F14 is EOL and there's some support for this upstream + current fedora, closing as CURRENTRELEASE