Skip to content

Instantly share code, notes, and snippets.

@bdparrish
Created March 28, 2019 11:28
Show Gist options
  • Save bdparrish/67d08794929396d85dfea28e6523999e to your computer and use it in GitHub Desktop.
Save bdparrish/67d08794929396d85dfea28e6523999e to your computer and use it in GitHub Desktop.
AWS format and mount nvme drive
--------------------------------------------
- Format 2 NVMe SSD Drives
--------------------------------------------
NOTE: NVMe SSD Drives are Ephemeral! Data will
survive hard and soft reboots, but not stop/start
cycles via the AWS Console.
sudo fdisk -l|more
sudo fdisk /dev/nvme0n1
n
p
1
<enter>
<enter>
w
sudo mkfs.ext4 /dev/nvme0n1
-- Repeat steps for /dev/nvme1n1
sudo fdisk /dev/nvme1n1
n
p
1
<enter>
<enter>
w
sudo mkfs.ext4 /dev/nvme1n1
--------------------------------------------
- Mount Drives
--------------------------------------------
sudo mkdir -p /mnt/ssd1
sudo mkdir -p /mnt/ssd2
sudo vi /etc/fstab
/dev/nvme0n1 /mnt/ssd1 ext4 defaults,nofail,discard,errors=continue 0 2
/dev/nvme1n1 /mnt/ssd2 ext4 defaults,nofail,discard,errors=continue 0 2
sudo mount -a
df -H
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment