Format and Mount EBS in Ubuntu

Format and Mount EBS in Ubuntu
Photo by Gabriel Heinzer / Unsplash

Once you have a server up and running with an extra disk, you'll need a few extra steps to get that disk ready for use.

*Note: This is for the official Ubuntu 10.04 LTS AMI

  1. SSH into your instance
  2. mount
  3. take note of the /dev/sdX that is mounted i.e. /dev/sda1 on / type ext3 (rw)
  4. ls /dev
  5. take note of the /dev/sdX that is not the one from step 3
  6. fdisk /dev/sdX
  7. At "Command" type n
  8. at "Primary or Extended" type p
  9. At Number of volumes type 1
  10. Press "Return" two time to accept the defaults
  11. Press W to write the changes and exit
  12. type "mkfs.ext4 /dev/sdX" to format in Ext4
  13. type "mkdir /media/ebs"
  14. type "mount /dev/sdX /media/ebs" to mount the drive