LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 08-13-2019, 11:29 PM   #1
lucmove
Member
 
Registered: Aug 2005
Location: Brazil
Distribution: Debian Stretch
Posts: 934

Rep: Reputation: 80
Btrfs - how much free space do I have?


I've been reading a lot about Btrfs and I know that calculating free space in it "is complicated," but note that this is a very new file system where no snapshots have ever been made. The problem is that 'df -h' and 'btrfs filesystem usage' give me different numbers:

Code:
# df -h
Filesystem       Size  Used   Avail Use% Mounted on
/dev/sda2        909G  871G   37G   96%  /dev/home/btuser

# btrfs filesystem usage /dev/sda2

Overall:
    Device size:		 908.32GiB
    Device allocated:		 874.02GiB
    Device unallocated:		  34.30GiB
    Device missing:		     0.00B
    Used:			 863.77GiB
    Free (estimated):		  43.18GiB	(min: 43.18GiB)
    Data ratio:			      1.00
    Metadata ratio:		      1.00
    Global reserve:		 512.00MiB	(used: 0.00B)

Data,single: Size:871.01GiB, Used:862.13GiB
   /dev/sda2	  871.01GiB

Metadata,single: Size:3.01GiB, Used:1.64GiB
   /dev/sda2	   3.01GiB

System,single: Size:4.00MiB, Used:112.00KiB
   /dev/sda2	   4.00MiB

Unallocated:
   /dev/sda2	   34.30GiB
So how much free space do I really have? Is it 43GB or 34GB?
 
Old 08-14-2019, 04:29 PM   #2
permaroot
Member
 
Registered: Aug 2019
Location: Arden, NC
Distribution: Manjaro, Centos7, Arch
Posts: 98

Rep: Reputation: 34
Quote:
Originally Posted by lucmove View Post
I've been reading a lot about Btrfs and I know that calculating free space in it "is complicated," but note that this is a very new file system where no snapshots have ever been made. The problem is that 'df -h' and 'btrfs filesystem usage' give me different numbers:

Code:
# df -h
Filesystem       Size  Used   Avail Use% Mounted on
/dev/sda2        909G  871G   37G   96%  /dev/home/btuser

# btrfs filesystem usage /dev/sda2

Overall:
    Device size:		 908.32GiB
    Device allocated:		 874.02GiB
    Device unallocated:		  34.30GiB
    Device missing:		     0.00B
    Used:			 863.77GiB
    Free (estimated):		  43.18GiB	(min: 43.18GiB)
    Data ratio:			      1.00
    Metadata ratio:		      1.00
    Global reserve:		 512.00MiB	(used: 0.00B)

Data,single: Size:871.01GiB, Used:862.13GiB
   /dev/sda2	  871.01GiB

Metadata,single: Size:3.01GiB, Used:1.64GiB
   /dev/sda2	   3.01GiB

System,single: Size:4.00MiB, Used:112.00KiB
   /dev/sda2	   4.00MiB

Unallocated:
   /dev/sda2	   34.30GiB
So how much free space do I really have? Is it 43GB or 34GB?
you have 10.25GB free.

device size minus allocated = 34.30 - If I understand this is space not allocated for use.

allocated minus used = 10.25G, which if added to the unallocated equals the "estimated" free space

Last edited by permaroot; 08-14-2019 at 04:30 PM.
 
Old 08-14-2019, 05:19 PM   #3
lucmove
Member
 
Registered: Aug 2005
Location: Brazil
Distribution: Debian Stretch
Posts: 934

Original Poster
Rep: Reputation: 80
Quote:
Originally Posted by permaroot View Post
you have 10.25GB free.
device size minus allocated = 34.30 - If I understand this is space not allocated for use.
allocated minus used = 10.25G, which if added to the unallocated equals the "estimated" free space
Sorry, I don't understand at all.

Where does that 10.25GB come from? There is no mention of 10.25GB whatsoever and I can't see how it could come out of any calculation.

I am confused about Btrfs, but I trust 'df.' Yes, I know, df can't really handle Btrfs, but...

Code:
# df -h
Filesystem       Size  Used   Avail Use% Mounted on
/dev/sda2        909G  871G   37G   96%  /dev/home/btuser
...and I know those numbers are correct. The partition really is supposed to be 909GB in size and the amount of data is knwon to be around 871GB. I have a copy in EXT4 (874GB) and XFS (869GB). And 909 minus 871 is 38, so the available free space is about right too.

You see, I get 34GB free in EXT4 and 40GB in XFS. Same exact data. Btrfs says I have either 43GB or 34GB of free space because I can't read the information correctly. Between 43GB and 34GB, I couldn't decide whether Btrfs is so space efficient that it will give me as much as 43GB of free space or rather it will give me as little as 34GB because its journaling is so heavy.

And you tell me I only have 10.25GB! Why?
 
Old 08-14-2019, 05:32 PM   #4
permaroot
Member
 
Registered: Aug 2019
Location: Arden, NC
Distribution: Manjaro, Centos7, Arch
Posts: 98

Rep: Reputation: 34
What is your lsblk and lsblk -f and fdisk -l output?

Last edited by permaroot; 08-14-2019 at 05:36 PM.
 
  


Reply


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] docker on btrfs using much space in /var/lib/docker/btrfs taumeister Linux - Containers 2 01-25-2018 04:13 PM
btrfs filesystem df /mnt/btrfs/ shows bothe data and metdata with raid1 and single. gonus Linux - Software 3 07-17-2014 02:48 PM
LXer: Rollback To A Working State With btrfs + apt-btrfs-snapshot On Ubuntu 12.10 LXer Syndicated Linux News 0 11-25-2012 10:42 AM
ext4 vs btrfs, and with btrfs do I still need to use LVM? blue_k Linux - Software 4 08-17-2012 11:31 PM
How much free space do I have in my machine? Nosram Linux - General 1 02-08-2004 09:31 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 08:26 AM.

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