Skip to main content

Mount storage in jobs

Reference shared storage volumes in Slurm job scripts

Mount storage in jobs

Slurm job scripts can access shared storage volumes mounted on cluster nodes. This guide covers how to reference PVCs, NFS shares, and CephFS volumes in your job scripts.

Reference PVCs, NFS shares, and CephFS volumes in your Slurm job scripts.

TimeAbout 5 minutes
You will needA cluster with shared storage configured, a storage volume created
OutcomeA job script that reads and writes to shared storage

Reference NFS storage in a job script

If your cluster nodes have an NFS share mounted (the default catalog scripts assume /nfs), reference the mount path directly in your script:

#!/usr/bin/env bash
#SBATCH --job-name=data-processing
#SBATCH --output=/nfs/results/%j.out

INPUT_DIR=/nfs/datasets/raw
OUTPUT_DIR=/nfs/results/processed

python process.py --input "$INPUT_DIR" --output "$OUTPUT_DIR"

Reference PVC storage in Slurm-on-Kubernetes jobs

For Slurm clusters running on Kubernetes, PVCs are mounted into job pods at paths defined by the cluster administrator. Check your cluster documentation or use df -h in a Cloud Shell to see available mount points.

#!/usr/bin/env bash
#SBATCH --job-name=training
#SBATCH --output=/workspace/logs/%j.out

DATA_PATH=/workspace/datasets/training
MODEL_PATH=/workspace/models/output

python train.py --data "$DATA_PATH" --output "$MODEL_PATH"

Success looks like this: the job starts successfully, and the storage is available at the configured mount path inside the container.

Storage type considerations

TypeBest forNotes
NFSMost HPC workflowsMounted on all nodes by default on many clusters
PVCKubernetes-native workloadsNamespace-scoped; check access mode for multi-pod access
CephFSLarge-scale parallel readsHigh throughput across many nodes

Verify your storage mount paths before submitting by running ls on the expected paths from a Cloud Shell or interactive session.

Ask AI
Ask a question about Vantage Compute...