Suchen

Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.

Chapter 5. Trim options on an LVM-VDO volume

download PDF

You can mount your file system with the discard option, which informs the VDO volume of the unused space. Another option is to use the fstrim application, which is an on-demand discarding, or mount -o discard command for immediate discarding.

When using the fstrim application, the admin needs to schedule and monitor an additional process, while using mount -o discard command allows for immediate recovery of space when possible.

Note that it is currently recommended to use fstrim application to discard unused blocks rather than the discard mount option because the performance impact of this option can be quite severe. For this reason, nodiscard is the default.

5.1. Enabling discard mount option on VDO

This procedure enables the discard option on your VDO volume.

Prerequisites

  • An LVM-VDO volume exists on your system.

Procedure

  • Enable the discard on your volume:

    # mount -o discard /dev/vg-name/vdo-name mount-point

Additional resources

  • xfs(5), mount(8), and lvmvdo(7) man pages

5.2. Setting up periodic TRIM operation

This procedure enables a scheduled TRIM operation on your system.

Prerequisites

  • An LVM-VDO volume exists on your system.

Procedure

  • Enable and start the timer:

    # systemctl enable --now fstrim.timer

Verification

  • Verify that the timer is enabled:

    # systemctl list-timers fstrim.timer

    Example 5.1. Possible output of the verification procedure

    # systemctl list-timers fstrim.timer
    NEXT                         LEFT         LAST  PASSED  UNIT         ACTIVATES
    Mon 2021-05-10 00:00:00 EDT  5 days left  n/a   n/a     fstrim.timer fstrim.service
Note

You will not see any reference to a VDO volume, because the fstrim.timer runs across all mounted filesystems.

Additional resources

  • fstrim(8) man page
Red Hat logoGithubRedditYoutubeTwitter

Lernen

Testen, kaufen und verkaufen

Communitys

Über Red Hat Dokumentation

Wir helfen Red Hat Benutzern, mit unseren Produkten und Diensten innovativ zu sein und ihre Ziele zu erreichen – mit Inhalten, denen sie vertrauen können.

Mehr Inklusion in Open Source

Red Hat hat sich verpflichtet, problematische Sprache in unserem Code, unserer Dokumentation und unseren Web-Eigenschaften zu ersetzen. Weitere Einzelheiten finden Sie in Red Hat Blog.

Über Red Hat

Wir liefern gehärtete Lösungen, die es Unternehmen leichter machen, plattform- und umgebungsübergreifend zu arbeiten, vom zentralen Rechenzentrum bis zum Netzwerkrand.

© 2024 Red Hat, Inc.