Created
May 28, 2021 18:51
-
-
Save adeubank/9bc2017f52979315532d5bd9da4a9838 to your computer and use it in GitHub Desktop.
This script will make a filesystem and mount a nvme1n1 device and modify the /etc/fstab for remounts on reboot -
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
# This script will make a filesystem and mount the device and modify the /etc/fstab for remounts on reboot - | |
#!/bin/bash | |
if ( lsblk | fgrep -q nvme1n1 ); then | |
mkfs.ext4 /dev/nvme1n1 | |
mkdir -p /ephemeral1 | |
mount /dev/nvme1n1 /ephemeral1 | |
devid=$(lsblk --noheadings --output UUID /dev/nvme1n1) | |
echo "UUID=$devid /ephemeral1 ext4 defaults,noatime 1 1" >> /etc/fstab | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment