大网数据广告活动
服务器运维问答

xfs_fsr reports insufficient freespace on large VM images

· 52CE 我爱测

I have several systems using glusterfs and xfs partitions. Some of these systems are hosts for VMs (using libvirt and with qcow2 for storage). I noticed that there was some substantial fragmentation in several cases so I ran xfs_…

问题原文

原帖链接 · user3889271 · CC BY-SA 4.0

I have several systems using glusterfs and xfs partitions. Some of these systems are hosts for VMs (using libvirt and with qcow2 for storage).

I noticed that there was some substantial fragmentation in several cases so I ran xfs_fsr to defrag. Two of my VMs are rather large and I receive an "insufficient freespace" when attempting to defrag the partitions they are hosted on.

Is there a way around this? I'm not sure I understand the -f option, is that what I should use?

EDIT: I took out a related question that I will ask in a different post.

已采纳解答

原帖链接 · shodanshok · CC BY-SA 4.0

xfs_fsr defragments a file by copying it to a new temporary location and atomically swap the new (contiguous) file with the old one. This obviously means that it really need sufficient space to make the temporary copy (ie: at least as much free space as the file you are defragmenting).

From xfs_fsr man page:

xfs_fsr improves the layout of extents for each file by copying the entire file to a temporary location and then interchanging the data extents of the target and temporary files in an atomic manner. This method requires that enough free disk space be available to copy any given file and that the space be less fragmented than the original file. It also requires the owner of the file to have enough remaining filespace quota to do the copy on systems running quotas. xfs_fsr generates a warning message if space is not sufficient to improve the target file.

Its -f option enable you to specify the progress file location which, in turn, is used when restoring an interrupted defrag session. Again, from the man page:

-f leftoff

Use this file instead of /var/tmp/.fsrlast to read the state of where to start and as the file to store the state of where reorganization left off.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2018-10-15)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。