XFS文件系统有多少保留blocks块?

你有没有考虑过,XFS文件系统保留了多少块?这些值是可以通过以下命令获得的:

# xfs_info /root/test
meta-data=/dev/vda2              isize=256    agcount=4, agsize=6400 blks
         =                       sectsz=512   attr=2, projid32bit=1
         =                       crc=0        finobt=0
data     =                       bsize=4096   blocks=25600, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0 ftype=0
log      =internal               bsize=4096   blocks=853, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0

查看xfs文件系统保留块数

[root@yunweixia.com ~]# xfs_io -x -c "resblks" /root/test
reserved blocks = 8192
available reserved blocks = 8192

查看xfs文件系统保留快的百分比

保留块百分比为:100 * “保留块”/(agsize * agcount)用户可能会惊讶地看到小于 1% 的值,而较旧的文件系统通常默认为 5%。这条评论在fs/xfs/xfs_mount.c源代码解释了原因:

/*
* We default to 5% or 8192 fsbs of space reserved, whichever is
* smaller.  This is intended to cover concurrent allocation
* transactions when we initially hit enospc. These each require a 4
* block reservation. Hence by default we cover roughly 2000 concurrent
* allocation reservations.
*/

原创文章,作者:运维侠,如若转载,请注明出处:https://www.yunweixia.com/knowledgebase/xfs-filesystem-reserved-blocks-count-explained.html

(0)
运维侠的头像运维侠共建用户
上一篇 2025年7月23日 18:11
下一篇 2025年7月25日 18:11

相关推荐

发表回复

登录后才能评论