如何创建BTRFS RAID1安装?
我有两(2)个1Gig驱动器,我在服务器中弹出,运行以下命令后,看起来我有一个2千兆分区,而不是我预期的1千兆.
$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
好的……错误.但如果我向前推进,我可以装载它,当我做df时,我看到2 Gigs自由:
$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
我希望只看到一个.
解决方法
on a -d raid1 volume,df will show total raw space,space used by data (not counting duplication),and the difference between those two numbers. This can be surprising since you’ll run out of space before the Use% reaches 50. (up to and including 2.6.33 — reporting changed in 2.6.34)
In 2.6.34,space used by data (factoring in duplication for raid1),and raw free space,taking Metadata and data into consideration. You can still hit an “out of space” condition well before free space reaches 0,especially if,under raid1,your allocated space is unbalanced,and the system finds it impossible to find space for your new write on two separate disks.
由于您运行的是使用Linux内核版本2.6.32的Ubuntu 10.04,因此您看到第一个要点所描述的“令人惊讶”的行为.因此,您创建的文件系统很可能是RAID1,df只是过度报告其大小.