Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 05-02-2009, 12:42 PM   #1
Registered: Aug 2007
Location: Zurich, Switzerland
Distribution: Gentoo
Posts: 999

Rep: Reputation: 141Reputation: 141
btrfs filesystem - problems with btrfsctl when shrinking & defragmenting fs

Hello folks

I'd like to try out the new butter filesystem / btrfs but I'm having some problems with the features I'm more interested in - the defragmentation and the shrinking/growing of the fs - both to be triggered by the "btrfsctl" executable.

First of all some details about the system on which I am performing the tests:
- Gentoo distribution
- Kernel 2.6.28
- btrfs-progs package version 0.18
- btrfs kernel module 0.17

I created a 5GB file, formatted and mounted it:
dd if=/dev/zero of=2delete.img bs=100k count=50000
mkfs.btrfs 2delete.img

WARNING! - see before using

fs created label (null) on 2delete.img
        nodesize 4096 leafsize 4096 sectorsize 4096 size 4.77GB
Btrfs Btrfs v0.18
mount -v -o loop 2delete.img /mnt/temp/
df -h /mnt/temp/
Filesystem            Size  Used Avail Use% Mounted on
/dev/loop0            4.8G   28K  4.8G   1% /mnt/temp
Then I tried to shrink it, or defragment it, but the error message I get is always the same one:
btrfsctl -r -1M /mnt/temp    
ioctl:: Inappropriate ioctl for device
btrfsctl -d /mnt/temp
ioctl:: Inappropriate ioctl for device
This doesn't work too:
btrfsctl -a           
Scanning for Btrfs filesystems
failed to read /dev/sr0
And this doesn't bring back any interesting information:
btrfsctl -A /dev/loop0
operation complete
Btrfs Btrfs v0.18
I tried out all this as well with a "real" HDD (but it's an external one, connected through USB2) and I get exactly the same results.

Am I doing something wrong? Well, I think I did the same as explained here so probably the support is not yet ok, or?
Thanks a lot.
Old 05-06-2009, 12:14 PM   #2
Registered: Aug 2007
Location: Zurich, Switzerland
Distribution: Gentoo
Posts: 999

Original Poster
Rep: Reputation: 141Reputation: 141
Solved - I needed the kernel module and the userspace utilities to be on the same version number. Stupid mistake - thanks anyway... .


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
LVM and shrinking the root filesystem coreychch Linux - Newbie 5 11-22-2015 10:35 PM
LXer: Linux Don't Need No Stinkin' ZFS: BTRFS Intro & Benchmarks LXer Syndicated Linux News 0 04-23-2009 02:30 AM
LXer: Using The BTRFS Filesystem On Debian Lenny LXer Syndicated Linux News 0 04-01-2009 01:40 PM
LXer: Kernel 2.6.29: Corbet Says Btrfs Next Generation Filesystem LXer Syndicated Linux News 0 01-13-2009 05:00 PM
LXer: Linux Foundation End User Summit: New BtrFS Filesystem and Knowledge Center LXer Syndicated Linux News 0 10-18-2008 04:12 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:46 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration