Skip to content

Instantly share code, notes, and snippets.

@adeubank
Created May 28, 2021 18:51
Show Gist options
  • Select an option

  • Save adeubank/9bc2017f52979315532d5bd9da4a9838 to your computer and use it in GitHub Desktop.

Select an option

Save adeubank/9bc2017f52979315532d5bd9da4a9838 to your computer and use it in GitHub Desktop.

Revisions

  1. adeubank created this gist May 28, 2021.
    16 changes: 16 additions & 0 deletions mount_nvme1n1.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,16 @@
    # 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