These instructions on how to mount an Amazon EBS volume apply to CentOS Linux specifically but with little modification can be applied to all Linux distributions. By attaching EBS volumes (aka. disks) to your instance you can get around the majority file space issues that might encounter when hosting popular websites or those which contain a lot of data (e.g. image galleries, music sites, podcasts, etc.)
- Note down the instance id of the instance you want to add more storage to
- In your AWS account go to the volumes link (under Elastic Block Store) click the Create Volume Button and choose how big you want this device to be.
- Attach the new EBS volume to your instance by right clicking it and choosing Attach Volume. Select the instance id from the list that you noted down in step 1. and give the new device a name to reference it on the instance, e.g. /dev/sdf
- Login into your instance on the command line and do and run (# represents the command prompt):
# ls /dev
You should see that /dev/sdf has been created for you - Format /dev/sdf by running:
# mkfs.ext3 /dev/sdf
It will warn you that this an entire device. You should type y to allow the process to continue unless you want to create specific partitions on this device - Create a directory to mount your new drive as on the filesystem, for example we’ll use /files:
# mkdir /files - Add a reference in the fstab file to mount the newly formatted drive onto the /files directory by running the following command:
# echo "/dev/sdb /files ext3 noatime 0 0" >> /etc/fstab - Mount the drive by running:
# mount /files - Check your drive has mounted correctly with the expected amount of file space by running:
# df -h /files
No comments:
Post a Comment