Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

Following situation: There is a Ubuntu 10.10 Server running with many custom configurations and programs (can't set it up from scratch). One of these programs stores a lot of data (> 1TB) in /var/ProgA/. The physical drive is 2TB in size and I don't have another one lying around to create a full size image on it. Excluding the data of ProgA the whole machine takes only up about 30GB of harddisk.

Question: How can I create a virtual machine from it and exclude the /var/ProgA directory so I end up with a 50GB virtual image?

What I found so far (dd and QEMU) always clones the whole disk. I searched the net for a while now, but had no luck. Maybe somebody can point me in the right direction.

Cheers! Steffen

share|improve this question
The only way I can think of would be to move that directory to an external device.. – NickW Apr 15 '13 at 14:20
but the resulting image would still be 2TB big, or which tool can resize the virtual disk during the process? And a link to an external drive would propably also upset the prozess... – SteffenW Apr 15 '13 at 14:42
It wouldn't be an instantaneous thing, but if you moved the directory to an NFS mount (or even another partition), symlinked it back, then used dd, you could just clone the disk and use the nofollow option, it wouldn't follow the symlink to the external mount.. – NickW Apr 15 '13 at 14:50
I'm thinking about moving this data to an external drive. so e.g. using this I would only need a 50GB Virtual drive to begin with? Wouldn't it still need a 2TB virtual image, cause it copies the whole disk? Or is my thinking wrong? – SteffenW Apr 15 '13 at 15:01
From what I'm seeing, yeah, that seems to need a disk as big as the original one. – NickW Apr 15 '13 at 15:28

Your Answer


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

Browse other questions tagged or ask your own question.