Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Amazon EC2 Instance with EBS Block attached

Posted on 2016-09-28
1
Medium Priority
?
136 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:Nathan Riley
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 35

Accepted Solution

by:
Duncan Roe earned 2000 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

There is no doubt that cloud is gaining importance. Many of you must have read about this technology and its growing importance. More and more organisations are embracing this technology not forgetting start-ups. The process begins by dipping …
There’s a movement in Information Technology (IT), and while it’s hard to define, it is gaining momentum. Some call it “stream-lined IT;” others call it “thin-model IT.”
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

721 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