Last active
May 30, 2025 17:47
-
-
Save yosoyjay/d0903b745bec2afd7f51acb39bddf1e0 to your computer and use it in GitHub Desktop.
NVMe for GB200
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Need to exclude nvme0n1 | |
| NVME_DISKS_NAME=$(ls /dev/nvme*n1 | grep -v nvme0n1) | |
| NVME_DISKS=$(ls /dev/nvme*n1 | grep -v 0n1 | wc -l) | |
| MD_DEV=/dev/md/nvme-raid0 | |
| RAID_MNT=/mnt/resource_nvme | |
| echo "Number of NVMe Disks: $NVME_DISKS" | |
| if [ "$NVME_DISKS" == "0" ] | |
| then | |
| exit 0 | |
| else | |
| mkdir -p $RAID_MNT | |
| # Needed incase something did not unmount as expected. This will delete any data that may be left behind | |
| mdadm --stop $MD_DEV | |
| mdadm --create $MD_DEV -f --run --level 0 --raid-devices $NVME_DISKS $NVME_DISKS_NAME | |
| mkfs.xfs -f $MD_DEV | |
| mount $MD_DEV $RAID_MNT | |
| fi | |
| chmod 1777 $RAID_MNT |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment