Free space left

2010-01-16 Thread Michael Niederle
How can I detect how much free space is left on a btrfs-volume?

As I read (and learned in practice!) df reports cannot be trusted if used on
btrfs-volumes.

Greetings, Michael


--
To unsubscribe from this list: send the line unsubscribe linux-btrfs in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


worse than expected compression ratios with -o compress

2010-01-16 Thread Jim Faulkner


I have a mysql database which consists of hundreds of millions, if not 
billions of Usenet newsgroup headers.  This data should be highly 
compressable, so I put the mysql data directory on a btrfs filesystem 
mounted with the compress option:

/dev/sdi on /var/news/mysql type btrfs (rw,noatime,compress,noacl)

However, I'm not seeing the kind of compression ratios that I would expect 
with this type of data.  FYI, all my tests are using Linux 2.6.32.3. 
Here's my current disk usage:

FilesystemSize  Used Avail Use% Mounted on
/dev/sdi  302G  122G  181G  41% /var/news/mysql

and here's the actual size of all files:
delta-9 mysql # pwd
/var/news/mysql
delta-9 mysql # du -h --max-depth=1
747K./mysql
0   ./test
125G./urd
125G.
delta-9 mysql #

As you can see, I am only shaving off 3 gigs out of 125 gigs worth of what 
should be very compressable data.  The compressed data ends up being 
around 98% the size of the original data.


To contrast, rzip can compress a database dump of this data to around 7% 
of its original size.  This is an older database dump, which is why it is 
smaller.  Before:

-rw--- 1 root root  69G 2010-01-15 14:55 mysqlurdbackup.2010-01-15
and after:
-rw--- 1 root root 5.2G 2010-01-16 05:34 mysqlurdbackup.2010-01-15.rz

Of course it took 15 hours to compress the data, and btrfs wouldn't be 
able to use rzip for compression anyway.


However, I still would expect to see better compression ratios than 98% on 
such data.  Are there plans to implement a better compression algorithm? 
Alternatively, is there a way to tune btrfs compression to achieve better 
ratios?


thanks,
Jim Faulkner
Please CC my e-mail address on any replies.
--
To unsubscribe from this list: send the line unsubscribe linux-btrfs in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Free space left

2010-01-16 Thread Goffredo Baroncelli
On Saturday 16 January 2010, Michael Niederle wrote:
 How can I detect how much free space is left on a btrfs-volume?
 
 As I read (and learned in practice!) df reports cannot be trusted if used 
on
 btrfs-volumes.

Try btrfs-show

$ btrfs-show
Label: bar  uuid: ec2918cd-ad47-4eac-9e85-5604b02fd922
Total devices 1 FS bytes used 302.25MB
devid1 size 964.81MB used 614.50MB path /dev/sdc1

Label: debian-root  uuid: 6e2a647f-5da2-4bd0-a7d7-9b13d13a47cc
Total devices 1 FS bytes used 23.52GB
devid1 size 232.11GB used 118.03GB path /dev/sdc3

Btrfs Btrfs v0.19


BR
G.Baroncelli


-- 
gpg key@ keyserver.linux.it: Goffredo Baroncelli (ghigo) kreij...@inwind.it
Key fingerprint = 4769 7E51 5293 D36C 814E  C054 BF04 F161 3DC5 0512
--
To unsubscribe from this list: send the line unsubscribe linux-btrfs in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Free space left

2010-01-16 Thread Dipl.-Ing. Michael Niederle
Hi, Goffredo!

 Try btrfs-show

Thanks for your advice!

btrfs-show works but it displays a lot of error message for non-btrfs devices:

 btrfs-show
failed to read /dev/sdg
failed to read /dev/sdg1
failed to read /dev/sdg2
failed to read /dev/sdg3
failed to read /dev/sdg4
failed to read /dev/md1
failed to read /dev/fd0
failed to read /dev/fd0u1440
failed to read /dev/fd1
failed to read /dev/hda
failed to read /dev/hda1
failed to read /dev/hda10
failed to read /dev/hda11
failed to read /dev/hda12
...
failed to read /dev/sr0
failed to read /dev/sr1
failed to read /dev/sr2
failed to read /dev/sr3
...
Label: Alpha4  uuid: 63b82dad-ed81-41f4-910f-7b358ceb77ba
Total devices 1 FS bytes used 11.81GB
devid1 size 20.01GB used 20.01GB path /dev/sda3

Btrfs v0.19-4-gab8fb4c

Even if I try

btrfs-show /dev/sda3

I get the same output.

Greetings, Michael
--
To unsubscribe from this list: send the line unsubscribe linux-btrfs in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Free space left

2010-01-16 Thread Goffredo Baroncelli
On Saturday 16 January 2010, you (Dipl.-Ing. Michael Niederle) wrote:
 Hi, Goffredo!
 
  Try btrfs-show
 
 Thanks for your advice!
 
 btrfs-show works but it displays a lot of error message for non-btrfs 
devices:
 
  btrfs-show
 failed to read /dev/sdg
 failed to read /dev/sdg1
 failed to read /dev/sdg2
 failed to read /dev/sdg3
 failed to read /dev/sdg4
 failed to read /dev/md1
 failed to read /dev/fd0
 failed to read /dev/fd0u1440
 failed to read /dev/fd1
 failed to read /dev/hda
 failed to read /dev/hda1
 failed to read /dev/hda10
 failed to read /dev/hda11
 failed to read /dev/hda12
 ...
 failed to read /dev/sr0
 failed to read /dev/sr1
 failed to read /dev/sr2
 failed to read /dev/sr3
 ...
 Label: Alpha4  uuid: 63b82dad-ed81-41f4-910f-7b358ceb77ba
   Total devices 1 FS bytes used 11.81GB
   devid1 size 20.01GB used 20.01GB path /dev/sda3
 
 Btrfs v0.19-4-gab8fb4c
 
 Even if I try
 
 btrfs-show /dev/sda3
 
 I get the same output.
 
 Greetings, Michael
 
Yes they search in every block devices a btrfs file-system. It may be 
smarter/faster skipping the floppy and the cd-rom..

BR
G.Baroncelli

-- 
gpg key@ keyserver.linux.it: Goffredo Baroncelli (ghigo) kreijackATinwind.it
Key fingerprint = 4769 7E51 5293 D36C 814E  C054 BF04 F161 3DC5 0512
--
To unsubscribe from this list: send the line unsubscribe linux-btrfs in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Free space left

2010-01-16 Thread Svein Erik Brostigen

Goffredo Baroncelli wrote:

Try btrfs-show
  

Ok:

$ mount
/dev/sdc on /media/452f782b-738a-4699-abfa-588eecab07ea type btrfs 
(rw,nosuid,nodev,uhelper=devkit)


$ df
/dev/sdc  932G  6.7G  925G   1% 
/media/452f782b-738a-4699-abfa-588eecab07ea


$ btrfs-show
failed to read /dev/sdb1
failed to read /dev/sdc
failed to read /dev/sdb
failed to read /dev/sda5
failed to read /dev/sda1
failed to read /dev/sda6
failed to read /dev/sda2
failed to read /dev/sda
failed to read /dev/sr0
failed to read /dev/loop1
failed to read /dev/ram2
failed to read /dev/ram10
failed to read /dev/ram11
failed to read /dev/loop7
failed to read /dev/ram1
failed to read /dev/loop0
failed to read /dev/loop5
failed to read /dev/loop2
failed to read /dev/loop3
failed to read /dev/loop4
failed to read /dev/loop6
failed to read /dev/ram12
failed to read /dev/ram4
failed to read /dev/ram13
failed to read /dev/ram5
failed to read /dev/ram8
failed to read /dev/ram14
failed to read /dev/ram15
failed to read /dev/ram0
failed to read /dev/ram3
failed to read /dev/ram6
failed to read /dev/ram9
failed to read /dev/ram7
Btrfs Btrfs v0.19

The drive used is a Seagate FreeAgent 1Tb USB drive under Ubuntu 9.10

$ uname -a
Linux ebrostig-laptop 2.6.31-18-generic-pae #55-Ubuntu SMP Fri Jan 8 
16:13:23 UTC 2010 i686 GNU/Linux


Erik

--
To unsubscribe from this list: send the line unsubscribe linux-btrfs in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Free space left

2010-01-16 Thread Goffredo Baroncelli
On Saturday 16 January 2010, you (Svein Erik Brostigen) wrote:
 Goffredo Baroncelli wrote:
  Try btrfs-show

 Ok:



 $ mount
 /dev/sdc on /media/452f782b-738a-4699-abfa-588eecab07ea type btrfs 
 (rw,nosuid,nodev,uhelper=devkit)
 
 $ df
 /dev/sdc  932G  6.7G  925G   1% 
 /media/452f782b-738a-4699-abfa-588eecab07ea
 
 $ btrfs-show
 failed to read /dev/sdb1
 failed to read /dev/sdc
^

It seems that you don't have the right to read /dev/sdc.

Retry as super user.
[...]
 Btrfs Btrfs v0.19
 
 The drive used is a Seagate FreeAgent 1Tb USB drive under Ubuntu 9.10
 
 $ uname -a
 Linux ebrostig-laptop 2.6.31-18-generic-pae #55-Ubuntu SMP Fri Jan 8 
 16:13:23 UTC 2010 i686 GNU/Linux
 
 Erik
 
 


-- 
gpg key@ keyserver.linux.it: Goffredo Baroncelli (ghigo) kreij...@inwind.it
Key fingerprint = 4769 7E51 5293 D36C 814E  C054 BF04 F161 3DC5 0512
--
To unsubscribe from this list: send the line unsubscribe linux-btrfs in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Free space left

2010-01-16 Thread Goffredo Baroncelli
On Saturday 16 January 2010, Mathieu Chouquet-Stringer wrote:
 Hello,
 
 kreij...@gmail.com (Goffredo Baroncelli) writes:
  Try btrfs-show
  [...]
 
 How do you read this then:
 
 Label: none  uuid: 27fafa43-7ad0-4e8a-ada8-36f73ef8984c
 Total devices 2 FS bytes used 79.63GB
 devid2 size 111.79GB used 111.01GB path /dev/sdb
 devid1 size 111.79GB used 111.03GB path /dev/sda
 
 I'm pretty sure I created this fs with -d raid1 -m raid1!  Speaking
 of which, is there a way to read a FS configuration: how can I tell
 this FS really uses raid1 for both data and metadata?

Even tough the raid mode is set per filesystem, btrfs has (will have) the 
capability to set the raid level per file. So it is no simple to estimate the 
free space: if every file is raid1 the real free space is half of the physical 
free space. But if some file are in raid1 (for examples /etc) and others are 
in raid0 (for example the ones under /usr which may be re-downloaded) the used 
space and the free space are difficult to estimate.

There are some efforts to fix this kind of situation (see the thread [PATCH] 
Btrfs-progs: add btrfsctl -i to print space info).

 The used column is surprising: if it's a mirror why 111.01 and
 111.03?  And why all the space is being used anyway: I mean what's
 the difference between the 79.63GB and 111.0[13]?
 
 And the output of df is confusing too:
 /dev/sdb 234441648  83501968 150939680  36% /space
 
 It's reporting twice the total space but I think I remember looking
 it up and that should be fixed in a future kernel version.
 -- 
 Mathieu Chouquet-Stringer   mchou...@free.fr
 The sun itself sees not till heaven clears.
-- William Shakespeare --
 


-- 
gpg key@ keyserver.linux.it: Goffredo Baroncelli (ghigo) kreijackATinwind.it
Key fingerprint = 4769 7E51 5293 D36C 814E  C054 BF04 F161 3DC5 0512
--
To unsubscribe from this list: send the line unsubscribe linux-btrfs in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Free space left

2010-01-16 Thread Mathieu Chouquet-Stringer
Hello,

kreij...@gmail.com (Goffredo Baroncelli) writes:
 Try btrfs-show
 [...]

How do you read this then:

Label: none  uuid: 27fafa43-7ad0-4e8a-ada8-36f73ef8984c
Total devices 2 FS bytes used 79.63GB
devid2 size 111.79GB used 111.01GB path /dev/sdb
devid1 size 111.79GB used 111.03GB path /dev/sda

I'm pretty sure I created this fs with -d raid1 -m raid1!  Speaking
of which, is there a way to read a FS configuration: how can I tell
this FS really uses raid1 for both data and metadata?

The used column is surprising: if it's a mirror why 111.01 and
111.03?  And why all the space is being used anyway: I mean what's
the difference between the 79.63GB and 111.0[13]?

And the output of df is confusing too:
/dev/sdb 234441648  83501968 150939680  36% /space

It's reporting twice the total space but I think I remember looking
it up and that should be fixed in a future kernel version.
-- 
Mathieu Chouquet-Stringer   mchou...@free.fr
The sun itself sees not till heaven clears.
 -- William Shakespeare --
--
To unsubscribe from this list: send the line unsubscribe linux-btrfs in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


btrfsck segmentation fault

2010-01-16 Thread André Goddard Rosa
Hello,

 when trying to btrfsck my filesystem, I got the following error:

# btrfsck /dev/sda7
parent transid verify failed on 13785038848 wanted 45848 found 45839
Segmentation fault

Crash occurs at extent-tree.c:find_first_block_group when it gets:

leaf = path-nodes[0];

after that btrfs_header_nritems dereferences the leaf unconditionally:

struct btrfs_header *h = (struct btrfs_header *)leaf-data;

Any thoughts on how to make it succeed?

Thank you,
André
--
To unsubscribe from this list: send the line unsubscribe linux-btrfs in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html