This guide will cover:
✅ Attaching volumes in the cloud
✅ Detecting and formatting new volumes
✅ Mounting manually and auto-mounting on boot
✅ Best practices for cloud deployments
AWS EC2: Attach an EBS volume via EC2 Console → “Attach Volume” → select instance.
Azure VM: Attach a Managed Disk via Azure Portal → “Attach existing disk”.
OpenStack: Use Horizon → Volumes → “Attach to Instance”.
Once attached, reboot is usually not required, but some cloud providers require rescans for new devices.
SSH into your instance and check new disks:
lsblk
Example output:
xvda 8:0 0 20G 0 disk
└─xvda1 8:1 0 20G 0 part /
xvdf 202:0 0 50G 0 disk
Here, xvdf
is the newly attached volume.
If it’s a new volume, create a filesystem (example with ext4):
sudo mkfs -t ext4 /dev/xvdf
Check the filesystem:
sudo file -s /dev/xvdf
1️⃣ Create mount directory:
sudo mkdir -p /mnt/data
2️⃣ Mount volume:
sudo mount /dev/xvdf /mnt/data
3️⃣ Verify:
df -h
1️⃣ Get UUID of the volume:
blkid /dev/xvdf
2️⃣ Edit /etc/fstab
:
UUID=xxxx-xxxx /mnt/data ext4 defaults,nofail 0 2
nofail
ensures instance boots even if volume is temporarily missing (useful for cloud volumes).
noatime
→ improves performance by not updating access times.
discard
→ enables TRIM for SSDs (if supported).
Example fstab line:
UUID=xxxx-xxxx /mnt/data ext4 defaults,noatime,discard,nofail 0 2
✔️ AWS EC2 → Attach a 500 GB EBS volume for database storage
✔️ Azure VM → Attach multiple Managed Disks in RAID 0 for high-performance workloads
✔️ OpenStack → Attach Cinder volumes to scale web server storage
Check mounted volumes:
df -h
Monitor I/O usage:
iostat -x 5
Ensure proper permissions for applications:
sudo chown -R appuser:appgroup /mnt/data
Attaching and mounting cloud volumes is essential for scalable Linux deployments in AWS, Azure, OpenStack, or other clouds.
Detect new volumes with lsblk
Format and mount with mkfs
+ mount
Auto-mount using UUID in /etc/fstab
with nofail
for reliability
Apply mount options for performance and safety
🚀 With these steps, your cloud servers can easily expand storage, handle databases, and manage persistent workloads safely.