Solved

Amazon EC2 Instance with EBS Block attached

Posted on 2016-09-28
1
97 Views
Last Modified: 2016-10-05
So I've setup an EC2 instance and took advice from here instead of expanding the root volume to add an additional EBS storage block.

I thought everything was working correctly until when copying some files I got an out of storage error.   So I ran df -h and I see that I have these volumes:
/dev/xvda1 it's almost full
/dev/xvde1 it's 500 gigs all empty

I'm updating files in the /var/www/html/ directory which I thought resided on the 500 gig hard drive not the small root one.  Is there an easy/quick method to move /var/www/html to the 500 gig drive and have site still work correctly?
0
Comment
Question by:N R
1 Comment
 
LVL 34

Accepted Solution

by:
Duncan Roe earned 500 total points
ID: 41822765
I think you have to stop the site while you move stuff. Best is to take it down to single user. Create a top-level directory on your second drive and move www to be under it. Alternatively copy and verify new copy is good before deleting old one.

Now the important part: how to graft the moved directory back into the fie system. 2 alternatives
  1. Use a symbolic link
  2. Use a bind mount
Symbolic links can have undesirable side effects so cross off alternative 1.
A bind mount is practically invisible to applications software, so use that. Suppose you mounted /dev/xvde1 as /mnt/xvde1 and created directory /mnt/xvde1/var_copy to hold mnt/xvde1/var_copy/www. Leave /var/ww as an empty directory and put this line ion your /etc/fstab
/mnt/xvde1/var_copy/www  /var/www   none        bind             0   0

Open in new window

Enter mount -a to mount the moved directory then use telinit to put your system back to the default runlevel
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Fine Tune your automatic Updates for Ubuntu / Debian
Or at least that’s the word according to a new blog from Tech Target on AWS’s new Managed Services (MS) offering. According to the blog, AWS is launching their AWS MS program to expedite the adoption of cloud by Fortune 1000 and Global 2000 companie…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question