Skip to content

Instantly share code, notes, and snippets.

@szarnyasg
Created January 1, 2022 08:25
Show Gist options
  • Save szarnyasg/0c7fa0245a7c170ac1aac743ad65fd05 to your computer and use it in GitHub Desktop.
Save szarnyasg/0c7fa0245a7c170ac1aac743ad65fd05 to your computer and use it in GitHub Desktop.

AWS SSD persistence

i3

Run 1

sudo mkfs -t ext4 /dev/nvme0n1
sudo mkdir /data
sudo mount /dev/nvme0n1 /data
sudo chown -R ${USER}:${USER} /data
touch /data/my.test
sudo reboot

Run 2

sudo mount /dev/nvme0n1 /data
sudo chown -R ${USER}:${USER} /data
ls -la /data

The file is there.

Run 3

Stop the machine from the console, start it again. It gets a new IP and a new disk.

sudo mount /dev/nvme0n1 /data

The mount fails with:

mount: /data: wrong fs type, bad option, bad superblock on /dev/nvme0n1, missing codepage or helper program, or other error.

r5d

Run 1

sudo mkfs -t ext4 /dev/nvme1n1
sudo mkdir /data
sudo mount /dev/nvme1n1 /data
sudo chown -R ${USER}:${USER} /data
touch /data/my.test
sudo reboot

Run 2

sudo mount /dev/nvme1n1 /data
sudo chown -R ${USER}:${USER} /data
ls -la /data

The file is there.

Run 3

Stop the machine from the console, start it again. It gets a new IP and a new disk.

sudo mount /dev/nvme1n1 /data

The mount fails with:

mount: /data: wrong fs type, bad option, bad superblock on /dev/nvme1n1, missing codepage or helper program, or other error.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment