I'm using a fairly vanilla Ubuntu 10.04 server installation, and I'm experimenting with BTRFS.
How can I create a BTRFS RAID1 mount?
I've got two (2) 1Gig drives that I popped in the server and after running the following commands, it appears I've got a 2 Gig partition, not 1 Gig as I would expect.
$ sudo mkfs.btrfs -m raid1 -d raid1 /dev/sdb /dev/sdc
WARNING! - Btrfs Btrfs v0.19 IS EXPERIMENTAL
WARNING! - see http://btrfs.wiki.kernel.org before using
failed to open /dev/btrfs-control skipping device registration
adding device /dev/sdc id 2
failed to open /dev/btrfs-control skipping device registration
fs created label (null) on /dev/sdb
nodesize 4096 leafsize 4096 sectorsize 4096 size 1.82TB
Btrfs Btrfs v0.19
Okay ... errors. But if I plow ahead, I can mount this, and when I do a df
, I see 2 Gigs free:
$ mkdir btrfs && sudo mount -t btrfs /dev/sdc $(pwd)/btrfs
$ cd btrfs && df . -h
Filesystem Size Used Avail Use% Mounted on
/dev/sdc 1.9T 28K 1.9T 1% /home/jamie/btrfs
I'd expected to see only one.
I found the following on the btrfs wiki, specifically the Gotchas page (quoted verbatim):
Since you're running Ubuntu 10.04, which uses Linux kernel version 2.6.32, it appears you're seeing the "surprising" behaviour described by the first bullet point. So, in all likelihood, the filesystem you created really is RAID1,
df
is just over-reporting its size.