Solved

Amazon EC2 Instance with EBS Block attached

Posted on 2016-09-28
1
78 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
Comment Utility
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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Don’t let your business fall victim to the coming apocalypse – use our Survival Guide for the Fax Apocalypse to identify the risks and signs of zombie fax activities at your business.
Big data transfers via information superhighways require special attention and protection. Learn more about the IT-regulations of the country where your server is located. Analyze cloud providers and their encryption systems for safe data transit. S…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

743 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now