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

I am looking for a solution which allows me to access any file of my productive environment in my local virtual machine for testing. Both systems are running Ubuntu 10.04 lts.

The current solution is a combination of cron and rsync. This means that we have to transfer periodically every productive file to the testing environment. The disadvantage is that it takes time to transfer these files and costs a lot of hard disk capacity. I should also add that most of the live files are not needed during testing but there is no clear pattern to exclude files.

Another solution is a ssh mount like sshfs. But this would not allow us to create files on the local testing machine without changing files of the live system.

Is there any solution similar to a ssh mount which allows me to pull files from the live system on demand without pushing changes back to the live system?


The solution of cjc / Zerodache is exactly what I needed:

apt-get install sshfs
apt-get install unionfs-fuse

cd /root/
mkdir local_delta
mkdir live_system
mkdir test_system

sshfs /root/live_system
unionfs-fuse -o cow /root/local_delta=RW:/root/live_system=RO /root/test_system

Now /root/test_system shows all files of the live site. Files created within the test_system folder are only created in the local_delta but not on the server. Also file modifications and deletions are only written to the first branch local_delta as the second branch live_system is set to RO (read only) and the -o cow option is set.

share|improve this question
What you are asking is as clear as mud. Please work on refining your question, but remember to make sure it is asked in a way that isn't looking for a product recommendation. – Zoredache Aug 2 '12 at 17:08
Create a snapshot of your production data LUNs and map them to your test host - you'll be able to access those files without affecting production. – MikeyB Aug 2 '12 at 17:43
Would UnionFS work? – cjc Aug 2 '12 at 17:54
@Ghommey You did not flag the question as requested. Further you need to use the "@" symbol before someone's name or it doesn't notify that person. So I had no way of knowing you had commented here. – Chris S Aug 2 '12 at 19:07
up vote 2 down vote accepted

Since you are able to remotely mount the filesystem from the production setup, then my suggestion (cjc also mentioned it in a comment) is to use something like a unionfs. Unionfs is the tool used frequently on livecd/liveusb environments to present the system with read-only filesystem merged with a read-write ramdisk so that reads came from a read-only filesystem unless a file is present in the read-write area.

share|improve this answer

If you were using something like vCenter Orchestrator and were running this on top of vSphere, you could use a linked clone for this. This would create a new VM with a base disk of your live server and a delta disk with all of your changes. The HDD space that would be consumed would only be equal to the changes that you make to the clone. Then, when you are done it can be discarded until you need to spin up a new linked clone.

Since it sounds like you're on bare-metal with the server and your VM is one local to your desktop, you're going to have to stick to what you're already doing.

share|improve this answer

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.