Command Line Tool (longhornctl)

Command line interface (CLI) for Longhorn operations and troubleshooting.

The longhornctl tool is a CLI interface to Longhorn operations. It interacts with Longhorn by creating Kubernetes Custom Resources (CRs) and executing commands inside a dedicated Pod for in-cluster and host operations.

Common usage scenarios

  • Installation:
    • longhornctl install preflight: Perform preflight dependencies installation and setup before installing Longhorn.
  • Operations:
    • longhornctl export replica: Extract data from a Longhorn replica data directory to a designated directory on its host machine. This is useful for recovering data when Longhorn is unavailable.
    • longhornctl trim volume: Reclaim unused storage space within a Longhorn volume.
  • Troubleshooting:
    • longhornctl check preflight: Identifies potential issues before usage.
    • longhornctl get replica: Retrieve details about Longhorn replicas on the host.

Usage

For more information about the available commands, see this document in the GitHub repository, or run longhornctl help in your terminal.


Copyright © 2019-2026 Longhorn a Series of LF Projects, LLC. Documentation Distributed under CC-BY-4.0.


The Linux Foundation has registered trademarks and uses trademarks. For a list of trademarks of The Linux Foundation, please see our Trademark Usage page.


For website terms of use, trademark policy and other project policies please see lfprojects.org/policies.