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
Solved

Amazon EC2 Instance with EBS Block attached

Posted on 2016-09-28
1
102 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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Query on Geolocation in aws... 1 36
000webhost.com default error log 1 40
how to configure linux OS using Ubuntu 7 58
Moving from Mcrypt to OpenSSL 18 45
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Most of the applications these days are on Cloud. Cloud is ubiquitous with many service providers in the market. Since it has many benefits such as cost reduction, software updates, remote access, disaster recovery and much more.
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.
Both in life and business – not all partnerships are created equal. Spend 30 short minutes with us to learn:   • Key questions to ask when considering a partnership to accelerate your business into the cloud • Pitfalls and mistakes other partners…

856 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