Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

So I used the guide in this answer to mount a new volume to /var/www:

Allowing apache to access multiple volumes under AWS

However, after doing it, my /var/www appears to have been cleaned out. I know the files all still exist, because running a quick df shows no change in the disk usage in the original volume (/dev/xvda1). Where can I find these files? I really need to get them back.

share|improve this question
What did you do with the files that were there? – Michael Hampton Sep 24 '13 at 1:58
I didn't do anything outside of the commands listed in the answer. There's a lost+found directory where the files were - could they be in there? – Fibericon Sep 24 '13 at 1:59
Unmount the new directory. – Michael Hampton Sep 24 '13 at 1:59
Wow, I was about to slam my head on my desk. Please make that an answer so I can mark it as the correct one. – Fibericon Sep 24 '13 at 2:03
up vote 4 down vote accepted

Mounting a filesystem at a mount point hides any files that may be in that directory on the parent filesystem.

To resolve the issue, move your old files somewhere else temporarily and create a new empty directory to hold the mount point. Then move the files into the new filesystem.

sudo -i
mv /var/www /var/www.old
mkdir /var/www
mount /dev/xvd** /var/www
mv -v /var/www.old/* /var/www
rmdir /var/www.old
share|improve this answer
@MikeyB's answer is quite elegant in its own right, but this is a much more succinct explanation of the OP's issue. – jscott Sep 24 '13 at 2:14

Michael Hampton's answer is most correct, though I've posted about this before.

The easiest way of moving the files over to the new mountpoint is:

# cd /var/www
# vi /etc/fstab # (add the new disk to the fstab now so you don't forget!)
# mount /var/www
# mv * /var/www
share|improve this answer
Evil genius, yes. Though it's not immediately clear there what's going on. – Michael Hampton Sep 24 '13 at 2:07
I like teaching a man to fish. – MikeyB Sep 24 '13 at 2:08

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.