Servers are useless without storage. In cloud, storage is separate, attachable, and persistent. This part explains how AWS storage and Linux disks actually work together.
Elastic Block Store (EBS) is a virtual hard disk. It exists independently from your EC2 instance.
lsblk
This shows all attached disks.
New EBS volumes appear as /dev/xvdf, /dev/nvme*, etc.
mkfs.ext4 /dev/xvdf
Formatting prepares the disk for data. Never format a disk that already has data.
mkdir /data
mount /dev/xvdf /data
Now the disk is usable at /data.
Without this, disk disappears after reboot.
nano /etc/fstab
/dev/xvdf /data ext4 defaults,nofail 0 2
OS disk is temporary. Data disk is sacred. Always separate them.
Next: Production Server Setup →