btrfs balance 具体在做些什么?

系统安装、升级讨论
版面规则
我们都知道新人的确很菜,也喜欢抱怨,并且带有浓厚的Windows习惯,但既然在这里询问,我们就应该有责任帮助他们解决问题,而不是直接泼冷水、简单的否定或发表对解决问题没有任何帮助的帖子。乐于分享,以人为本,这正是Ubuntu的精神所在。
回复
zhangjint5
帖子: 304
注册时间: 2011-01-02 12:31

btrfs balance 具体在做些什么?

#1

帖子 zhangjint5 » 2017-08-06 10:44

如题!

我曾经有个 btrfs 分区,里面有很多文件。空间使用到 96% (大分区,仍然有 20多个G左右的剩余空间)就报告空间不足,即使此时使用 rm 命令删除文件,使用 chmod,chown 这类不会占用存储空间的命令,都报错,说磁盘空间不足。是不是与长期没有 btrfs balance 有关?

每次 btrfs balance 看到机械硬盘不停歇的工作几个小时,中担心会突然挂掉~! :em06 固态硬盘还行,几分中完事!

所以我想知道 btrfs balance 到底在做什么?谁能用人类的语言简单说说!
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: btrfs balance 具体在做些什么?

#2

帖子 poloshiao » 2017-08-06 11:02

btrfs balance 到底在做什么
1. https://btrfs.wiki.kernel.org/index.php/Balance_Filters
From kernel 3.3 onwards, btrfs balance can limit its action to a subset of the full filesystem, and can be used to change the replication configuration (e.g. moving data from single to RAID-1).

2. https://btrfs.wiki.kernel.org/index.php/FAQ
4.12 What does "balance" do?
4.13 Does a balance operation make the internal B-trees better/faster?
4.14 Does a balance operation recompress files?
4.15 Do I need to run a balance regularly?
回复