You are not logged in.

#1 2014-10-25 02:37:37

anadon
Member
Registered: 2012-08-08
Posts: 35

btrfs raid 1 acting like raid 0

In getting and formatting 2 X 4tb WD green drives by "mkfs.btrfs -m raid1 -d raid1 /dev/sdc /dev/sdd" and then mount by "mount /dev/sdc /mnt" each drive if filled half the size of a copied file -- raid 0 behavior.  I find this even more odd because when I run "btrfs fi df /mnt" it prints the following:

Data, RAID1: total=3.00GiB, used=2.51GiB
System, RAID1: total=32.00MiB, used=16.00KiB
Metadata, RAID1: total=1.00GiB, used=3.03MiB
GlobalReserve, single: total=16.00MiB, used=0.00

"btrfs fi show /mnt" prints

Label: none  uuid: 4a7536a5-14ea-4f8a-8fe1-672d666f6cbb
    Total devices 2 FS bytes used 2.52GiB
    devid    1 size 3.64TiB used 4.03GiB path /dev/sdc
    devid    2 size 3.64TiB used 4.03GiB path /dev/sdd

and gparted shows each drive as having used ~1.26GB.  What is going on?

Offline

#2 2014-10-25 05:02:27

davidm
Member
Registered: 2009-04-25
Posts: 371

Re: btrfs raid 1 acting like raid 0

Measuring the space used/free in btrfs is very tricky and the output often is a little misleading.

I have about 900GB of space total in a RAID1 configuration with four disks of various mixed sizes.  I currently have about 50GB left free and am using LZO compression.

Here are various outputs for comparison:

# btrfs fi df /
Data, RAID1: total=445.00GiB, used=414.60GiB
System, RAID1: total=32.00MiB, used=72.00KiB
Metadata, RAID1: total=2.00GiB, used=1.08GiB
GlobalReserve, single: total=372.00MiB, used=0.00
# btrfs fi show /
Label: 'removed'  uuid: 98xxaxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
        Total devices 4 FS bytes used 415.74GiB
        devid    1 size 153.38GiB used 151.03GiB path /dev/sda
        devid    2 size 74.53GiB used 73.00GiB path /dev/sdb
        devid    3 size 232.89GiB used 231.00GiB path /dev/sdc
        devid    4 size 465.76GiB used 439.03GiB path /dev/sdd
# df


Filesystem     1K-blocks      Used Available Use% Mounted on
/dev/sda       485786196 436330996  67668432  87% /

Note how 'btrfs fi show /' shows the actual physical space whereas 'btrfs fi df /' shows roughly half the amount as the data is RAID1.

Could some of the seeming discrepancy be due to compression in use on the file?

Last edited by davidm (2014-10-25 05:04:27)

Offline

#3 2014-10-25 13:29:52

anadon
Member
Registered: 2012-08-08
Posts: 35

Re: btrfs raid 1 acting like raid 0

Nope, maximally compressed by lzop, file size decreases by 8MB to 2.69GB.  The file has to be split across drives.

Offline

#4 2014-10-25 13:50:25

anadon
Member
Registered: 2012-08-08
Posts: 35

Re: btrfs raid 1 acting like raid 0

According to http://lwn.net/Articles/577961/ it may be the case that gparted cannot be trusted to show accurate file system usage.  I'm going to have to ask the gparted guys.

Offline

#5 2014-10-25 13:57:06

anadon
Member
Registered: 2012-08-08
Posts: 35

Re: btrfs raid 1 acting like raid 0

gparted is not being well maintained it appears in regards to btrfs.  I suppose this should be withdrawn?  I'm not used to tools not working.

Offline

Board footer

Powered by FluxBB