搜索

此内容没有您所选择的语言版本。

Chapter 9. Freeing space on thinly-provisioned logical volumes using fstrim

download PDF

You can manually run fstrim to return unused logical volume space to the thin pool, which can be available for other logical volumes.

Red Hat recommends running fstrim daily.

Prerequisites

  • Verify that the thin pool logical volume supports discard behavior.

    Discard is supported if the output of the following command for the underlying device is not zero.

    # cat /sys/block/<device>/queue/discard_max_bytes
    Note

    If discard_max_bytes returns 0, you can still execute the fstrim command on the thin logical volume to reclaim unused blocks to the thin pool. However, the discard or trim will not be passed down to the block layer.

Procedure

  1. Run fstrim to restore physical space to the thin pool.

    # fstrim -v <mountpoint>

    For example, the following command discards any unused space it finds on the logical volume mounted at /gluster_bricks/data/data, and provides verbose output (-v).

    # fstrim -v /gluster_bricks/data/data
Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

© 2024 Red Hat, Inc.