Drive Commands

Use drive commands to discover, initialize, and manage the lifecycle of DirectPV-managed drives on Kubernetes nodes.

For step-by-step procedures on common drive operations, see Managing Drives.

Commands

CommandDescription
label drivesAdd, update, or remove labels on drives for scheduling
list drivesDisplay drive status, capacity, and volume information
repairRepair XFS filesystem errors on drives
suspend drivesSuspend drives for maintenance (mounts volumes read-only)
resume drivesResume suspended drives to restore normal operation

Common workflows

Add drives to DirectPV

  1. Run discover to probe nodes and generate a drives.yaml file.
  2. Review and edit drives.yaml to select the drives you want to add.
  3. Run init to format and initialize the selected drives.

Repair a faulty drive

  1. Identify the drive using list drives --status=error.
  2. Suspend the drive using suspend drives.
  3. Restart the pods that use the drive's volumes, and make sure those volumes are unbound from the drive.
  4. Run repair to attempt XFS filesystem recovery.
  5. Resume the drive using resume drives.
  6. Restart the pods that use the drive's volumes again, so they use the repaired drive.

Schedule workloads to specific drives

  1. Add labels to drives using label drives.
  2. Configure your StorageClass to use label-based scheduling.

For details on scheduling strategies, see Scheduling and Schedule by Label.

On this page