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.
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
| Type | Best for | Notes |
|---|---|---|
| NFS | Most HPC workflows | Mounted on all nodes by default on many clusters |
| PVC | Kubernetes-native workloads | Namespace-scoped; check access mode for multi-pod access |
| CephFS | Large-scale parallel reads | High 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.