You are not logged in.

#1 2015-08-05 03:36:42

66666thats6sixes
Member
Registered: 2015-05-25
Posts: 11

Can anyone explain these btrfs disk usage numbers?

Hey everyone

Recently my 2tb hard drive formatted with btrfs was starting to fill up, so I bought two more with the intent of converting the setup to a raid5 array in btrfs.  I know its still somewhat experimental, but I have a backup so it's not the end of the world if something happens.  Anyways, my old drive had an actual size of 1.82TB, with 1.25TB in use.  I plugged the new drives in and added them to the fs, then ran 'btrfs balance start -dconvert=raid5 -mconvert=raid5 /media'.  It ran for a few hours an exited successfully. Once it finished, I ran 'btrfs fi show', 'btrfs fi df /media', and 'btrfs fi usage /media' and I don't quite understand the results I got:

[redacted@tcl ~]$ sudo btrfs fi df /media
[sudo] password for redacted: 
Data, RAID5: total=2.50TiB, used=1.25TiB
System, RAID5: total=64.00MiB, used=240.00KiB
Metadata, DUP: total=512.00MiB, used=27.84MiB
Metadata, RAID5: total=4.00GiB, used=1.72GiB
GlobalReserve, single: total=512.00MiB, used=0.00B
[redacted@tcl ~]$ sudo btrfs fi show /media
[sudo] password for redacted: 
Label: none  uuid: c5d7abfe-2c1f-4e10-b3c7-9d027545a381
	Total devices 3 FS bytes used 1.25TiB
	devid    1 size 1.82TiB used 1.25TiB path /dev/sdc
	devid    2 size 1.82TiB used 1.25TiB path /dev/sdb
	devid    3 size 1.82TiB used 1.25TiB path /dev/sdd

btrfs-progs v4.1.2
[redacted@tcl ~]$ sudo btrfs fi usage /media
WARNING: RAID56 detected, not implemented
WARNING: RAID56 detected, not implemented
WARNING: RAID56 detected, not implemented
Overall:
    Device size:		   5.46TiB
    Device allocated:		   1.00GiB
    Device unallocated:		   5.46TiB
    Device missing:		     0.00B
    Used:			  55.69MiB
    Free (estimated):		     0.00B	(min: 8.00EiB)
    Data ratio:			      0.00
    Metadata ratio:		      0.22
    Global reserve:		 512.00MiB	(used: 0.00B)

Data,RAID5: Size:2.50TiB, Used:1.25TiB
   /dev/sdb	   1.25TiB
   /dev/sdc	   1.25TiB
   /dev/sdd	   1.25TiB

Metadata,DUP: Size:512.00MiB, Used:27.84MiB
   /dev/sdb	   1.00GiB

Metadata,RAID5: Size:4.00GiB, Used:1.72GiB
   /dev/sdb	   2.00GiB
   /dev/sdc	   2.00GiB
   /dev/sdd	   2.00GiB

System,RAID5: Size:64.00MiB, Used:240.00KiB
   /dev/sdb	  32.00MiB
   /dev/sdc	  32.00MiB
   /dev/sdd	  32.00MiB

Unallocated:
   /dev/sdb	 579.99GiB
   /dev/sdc	 580.99GiB
   /dev/sdd	 580.99GiB

So I would expect it to show the used space to be 1.25TB, and the total space to be 2*1.82=3.64TB, given my understanding of raid5.  I understand that reading disk usage in btrfs, especially in a raid array, is not quite so naive an operation as it is for a standard ext4 partition, but could someone explain how to parse this information?  And does it even all add up correctly?  For what its worth, the partition seems to be working fine, I can read and write to it, I just want to make sure something isn't messed up before it smacks me in the face down the line.

Offline

#2 2015-08-05 13:13:35

nstgc
Member
Registered: 2014-03-17
Posts: 393

Re: Can anyone explain these btrfs disk usage numbers?

Everytime I've converted from one raid level to another I've had to run a balance with -dusage=50 to get rid of near-empty chunks.

Offline

Board footer

Powered by FluxBB