How to Mount EBS Volumes on EC2 with XFS or EXT4 File Systems
This article details how to create an XFS or Ext4 file system using EBS volumes in AWS.
1. Launching a Server
First, you'll need to start with a server that has a root volume. You can use the commands df -th and lsblk to check the currently available disks.
2. Creating and Attaching a New EBS Volume From the AWS console, create a new EBS volume. Be sure to specify the volume type, size, and ensure it is in the same availability zone as your server. Once the volume is created, attach it to your server.
3. Formatting the Disk
After attaching the volume, verify it is connected using lsblk. Before formatting, check if the disk is already formatted with the blk_id command . To format the disk with an XFS file system, use the command mkfs.xfs.
4. Mounting the File System
Create a directory to serve as a mount point for the new file system . You can temporarily mount the disk using the mount command. For permanent mounting, which ensures the volume persists after a server reboot, add an entry to the /etc/fstab file.
5. Verifying and Using the Disk
Finally, use the df -th command to verify that the new file system is successfully mounted. You can then create a test file on the new file system to confirm it's accessible and ready for use.
Tags :- Amazon Web Services (AWS), EBS, EC2, file system, XFS, Ext4, Linux, mount, partition, storage, volume, mkfs.xfs, lsblk, fstab, cloud computing.
Comments
Post a Comment