Partition, Format, Mount a AWS EBS store - tooltwist/documentation GitHub Wiki
All instructions to be done as root user.
Assuming /dev/sdf was the device that was attached when the EC2 instances was created.
fdisk /dev/sdf
- Enter m for menu
- Enter n to add a new partition
- Enter p for primary partition
- Enter 1 for first partition on the disk
- Select Enter and take defaults for the First Cylinder and Last Cylinder
- Enter w to write the partition table to disk
mkfs -t ext4 /dev/sdf
mount /dev/sdf /mnt/ebs
It is assumed /mnt/ebs has permissions and has been created.
Edit /etc/fstab and add an entry like this.
/dev/sdf /mnt/ebs ext4 defaults 0 0
Do the command
mount -a
to check that the filesystems are mounted ok.