Once, you've created an EBS Volume, the next step is to attach it to an instance. There are two ways you can attach an EBS Volume to an instance.
Remember, you can only attach an EBS Volume to a server in the same availability zone. Therefore, if you want to automatically attach an EBS Volume to an instance when it is launched, you cannot use the "-any-" option for a server's availability zone. Be sure to specify the same zone as the volume.
Go to Manage -> AWS -> EBS Volumes and click the nickname of the EBS Volume that you want to attach to a running instance. In order to attach a volume to a running instance, they must both live in the same availability zone. Once a volume is created, you cannot change its availability zone. Similarly, once an instance has been launched, you cannot change its availability zone. Also, you cannot attach the same volume to multiple instances. In order to attach the same volume to multiple instances, you must take a snapshot of the original volume and then create multiple volumes from the same snapshot. A volume's status will be "available" if it's currently not attached to a running instance. Otherwise, a volume's status will be "in-use."
Click the Attach button.

Under your instance's Volumes tab you'll see the "Test" EBS Volume that you just attached to the running instance.

To detach the volume, click the eraser button under Actions.
You can also configure an EBS Volume(s) to automatically be attached to a component when it is launched. It's important that you specify that the new instance be launched in the same availability zone as the EBS Volume. If the server's availability zone is set to "-any-" or to a different availability zone, you will not be able attach the volume to the instance.
NOTE: If there is an availability zone mismatch between a volume and an unlaunched server, you will receive the following warning message: "Volume and server are in different availability zones. Force server to same zone as volume?" If you click OK, the unlaunched server will be reconfigured to launch in the same availability zone as the attached volume.
EBS Volume can either be attached to an instance at the server level or at the volume level.
Go to Manage -> AWS -> EBS Volumes and click the nickname of the EBS Volume that you want to attach to an instance. Click the Attach button at the top-right or under the Servers tab, click the "Add server for boot attachment" link.

Click OK.
Go to a server's hompage and click the Volumes tab. Click the Attach Volume link.


Click OK.
Here is the command in quotes, "mkfs.xfs /dev/sdj".
The "mkfs.xfs" is the package to be run and the "dev/sdj" is the device of the volume.
---
Also, you need to attach a boot script to attach the volume every time the server is launched.
Here is an example: "
yum -y install xfsprogs
echo "/dev/sdj /home/webapps/[directory name]/[volume name]/ xfs noatime 0 0" >> /etc/fstab
mkdir -p /home/webapps/[directory name]/[volume name]
mount /home/webapps/[directory name]/[volume name]
"
"[direcoty name]" is the name of the directory that your instance is running under
"[volume name]" is the name of the directory that your volume will reside on.
---
Now, to make this volume to appear on the root directory or your domain, you can create a link in the shell using "ln -s" Using this you can define the directory that you want to link to point to and the link name inside the root directory of the domain. An example is listed bellow in quotes:
"
ls -n /home/webapps/[directory name]/[volume name]/ [new directoy]
"
"[direcoty name]" is the name of the directory that your instance is running under
"[volume name]" is the name of the directory that your volume will reside on.
"[new directory]" is the name of the directory that you want pointing to your volume.
If you run this link in the root directory of your domain, you will have a new directory that will be pointing to your volume.
/home/webapps/[directory name]/[volume name]/
be:
/home/webapps/[directory name]/[volume name]
(I tried it the former way and got an error message)