linux – 如何格式化BTRFS Raid 1挂载?

前端之家收集整理的这篇文章主要介绍了linux – 如何格式化BTRFS Raid 1挂载?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在使用相当普通的Ubuntu 10.04服务器安装,我正在尝试使用BTRFS.

如何创建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

我希望只看到一个.

解决方法

我在 btrfs wiki上找到了以下内容,特别是 Gotchas页面(引用的逐字):
  • 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只是过度报告其大小.

原文链接:https://www.f2er.com/linux/398143.html

猜你在找的Linux相关文章