# creating btrfs raid5 filesystem

## Adel Ahmed

I've formattted 4 x 1TB hard disks as follows:

mkfs.btrfs -m raid5 -d raid5 /dev/sdb /dev/sdc /dev/sde /dev/sdf

thinking this is the way to format a 3 TB + 1 TB of parity

I wanted to test out the FS, so I wrote as much zeroes as I can to test the caps of the FS:

dd if=/dev/zero of=test bs=1G count=4096

thinking it would run out of space at 3TB, it did not, I have 3.5 TB and it's still writing.

what am I doing wrong, I want to make sure this FS can tolerate the failure of 1 drive.

thanks

----------

## ct85711

 *Quote:*   

> I want to make sure this FS can tolerate the failure of 1 drive. 

 

well, I would think the easy way to test that 1 drive failed, by simply unplugging one of the drives.  It should fall into a degraded mode once the array is constructed.

----------

## Ant P.

 *Adel Ahmed wrote:*   

> what am I doing wrong

 

Giving it a sparse file? Try /dev/full or /dev/urandom instead.

----------

## frostschutz

I don't know how smart btrfs is but zeroes can be optimized away (not writing them in the first place, or compression, or deduplication).

Try with random data instead (shred or cryptsetup on a loop file - urandom is way too slow)

----------

## Adel Ahmed

crpa I haed forgotten abo ut compression, I'll try again with shred, thanks

----------

## Adel Ahmed

ok so 3 days later, no I/O errors 3 TBs written and everything seems fine.

thanks everyone

----------

## toralf

 *Ant P. wrote:*   

> Try /dev/full or /dev/urandom instead.

 Doesn't /dev/full returns '\0' too like /dev/null ?Try this :

```
for i in null zero full; do echo $i; dd if=/dev/$i bs=32 count=1 2>/dev/null | base64; done
```

----------

