-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #970 from Azure/feature/371
format and mount NVME disk when present
- Loading branch information
Showing
1 changed file
with
20 additions
and
0 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
playbooks/roles/cyclecloud_cluster/projects/common/cluster-init/scripts/1-nvme.sh
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/bash | ||
|
||
NVME_DISKS_NAME=`ls /dev/nvme*n1` | ||
NVME_DISKS=`ls -latr /dev/nvme*n1 | wc -l` | ||
|
||
echo "Number of NVMe Disks: $NVME_DISKS" | ||
|
||
if [ "$NVME_DISKS" == "0" ] | ||
then | ||
exit 0 | ||
else | ||
mkdir -p /mnt/nvme | ||
# Needed incase something did not unmount as expected. This will delete any data that may be left behind | ||
mdadm --stop /dev/md* | ||
mdadm --create /dev/md128 -f --run --level 0 --raid-devices $NVME_DISKS $NVME_DISKS_NAME | ||
mkfs.xfs -f /dev/md128 | ||
mount /dev/md128 /mnt/nvme || exit 1 | ||
fi | ||
|
||
chmod 1777 /mnt/nvme |