Interview Prep/AWS/S3, EBS and EFS

You attached a new EBS volume, but `df -h` does not show it and `/dev/sdf` does not exist.

BeginnerTroubleshootingS3, EBS and EFS
Answer

Likely causes → Attaching a volume does not format or mount it. On Nitro instances, the device shows up as /dev/nvme1n1, not /dev/sdf.

Diagnose →

aws ec2 describe-volumes --volume-ids vol-0abc --query 'Volumes[].Attachments'
lsblk -o NAME,SIZE,FSTYPE,MOUNTPOINT,SERIAL     # SERIAL shows vol0abc...
sudo file -s /dev/nvme1n1                       # "data" = no filesystem

Fix →

sudo mkfs -t xfs /dev/nvme1n1
sudo mkdir -p /data && sudo mount /dev/nvme1n1 /data
echo "UUID=$(sudo blkid -s UUID -o value /dev/nvme1n1) /data xfs defaults,nofail 0 2" | sudo tee -a /etc/fstab

Prevent → Use UUIDs and nofail in fstab, and do the formatting in user data or configuration management.

aws All AWS questions Roadmap: AWS core services

More on S3, EBS and EFS