Re: btrfs: mixing raid0 and raid1 - How?
On sábado, 16 de abril de 2016 12:05:05 (CEST) Matthias Bodenbinder wrote:
> 38# df -h /mnt/test/
> Dateisystem Größe Benutzt Verf. Verw% Eingehängt auf
> /dev/sdg 699G 17M 466G 1% /mnt/test
df is not reliable for btrfs raids, it is better to use btrfs fi df to check
actual used space.
Using btrfs-tools and kernel from sid (4.4):
root@mychabol:/mnt/temporal# dd if=/dev/zero of=disk1 bs=1 count=0 seek=750M
root@mychabol:/mnt/temporal# dd if=/dev/zero of=disk2 bs=1 count=0 seek=500M
root@mychabol:/mnt/temporal# dd if=/dev/zero of=disk3 bs=1 count=0 seek=250M
root@mychabol:/mnt/temporal# mkfs.btrfs -f -draid1 -mraid1 disk1 disk2 disk3
btrfs-progs v4.4
See http://btrfs.wiki.kernel.org for more information.
Label: (null)
UUID: 4fbfda48-3a10-4e1b-92d8-96be759c2a8c
Node size: 16384
Sector size: 4096
Filesystem size: 1.46GiB
Block group profiles:
Data: RAID1 83.00MiB
Metadata: RAID1 83.00MiB
System: RAID1 12.00MiB
SSD detected: no
Incompat features: extref, skinny-metadata
Number of devices: 3
Devices:
ID SIZE PATH
1 750.00MiB disk1
2 500.00MiB disk2
3 250.00MiB disk3
root@mychabol:/mnt/temporal# losetup /dev/loop0 disk1
root@mychabol:/mnt/temporal# losetup /dev/loop1 disk2
root@mychabol:/mnt/temporal# losetup /dev/loop2 disk3
root@mychabol:/mnt/temporal# mkdir test
root@mychabol:/mnt/temporal# mount /dev/loop0 test
root@mychabol:/mnt/temporal# btrfs fi df test/
Data, RAID1: total=75.00MiB, used=0.00B
System, RAID1: total=8.00MiB, used=16.00KiB
Metadata, RAID1: total=75.00MiB, used=112.00KiB
GlobalReserve, single: total=16.00MiB, used=0.00B
root@mychabol:/mnt/temporal# df -h test/
S.ficheros Tamaño Usados Disp Uso% Montado en
/dev/loop0 750M 17M 491M 4% /mnt/temporal/test
Like in your case, df thinks that there are only 491M usable. However, if I
try to fill the volume
root@mychabol:/mnt/temporal# cd test/
root@mychabol:/mnt/temporal/test# dd if=/dev/zero of=file.zero
dd: escribiendo en 'file.zero': No queda espacio en el dispositivo
1345402+0 registros leídos
1345401+0 registros escritos
688845312 bytes (689 MB, 657 MiB) copied, 3,10508 s, 222 MB/s
root@mychabol:/mnt/temporal/test# ls -lh
total 657M
-rw-r--r-- 1 root root 657M abr 16 13:24 file.zero
root@mychabol:/mnt/temporal/test# df -h .
S.ficheros Tamaño Usados Disp Uso% Montado en
/dev/loop0 750M 674M 64K 100% /mnt/temporal/test
With the 75M of metadata, you can check that this fills the three devices.
Moreover
root@mychabol:/mnt/temporal/test# rm file.zero
root@mychabol:/mnt/temporal/test# df -h .
S.ficheros Tamaño Usados Disp Uso% Montado en
/dev/loop0 750M 17M 657M 3% /mnt/temporal/test
Try to do the same to see if df gets more accurate.
Still btrfs is quite young, I am not sure if there are serious issues in 3.17,
I would make some experiments before actual use.
Bests
Luis
Reply to: