Partition, format, mount a aws ebs store - tooltwist/documentation GitHub Wiki

All instructions to be done as root user.

Partition first

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

Create a new filesystem

mkfs -t ext4 /dev/sdf

Mount the new filesystem

mount /dev/sdf /mnt/ebs  

It is assumed /mnt/ebs has permissions and has been created.

Add entry into /etc/fstab to make the filesystem mount automatically

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.