Solved

Amazon EC2 Instance with EBS Block attached

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
list of sudo access for date range 5 34
IP 10.0.1.2 / 255.0.0.0 61 73
Internal CA server 6 88
How to use IFS to get output of range in comma separator in bash? 2 42
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.
When speed and performance are vital to revenue, companies must have complete confidence in their cloud environment.
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
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.

685 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