Live filesystem “capture” into a virtual disk image



ah… the joys of *nix utilities…. I’ve just successfully tested a “capture” of a live, running system into a virtual disk image. No, I don’t mean that I booted up with an imaging utility. I took a live, booted and logged in system and imaged the primary hard drive that it was living on, into a file on another machine. (Yeah, I know, there are probably a few people reading this and saying they’ve done that and most people that would need to do this already know how…. sorry I missed the memo.) Not too long ago, VMWare released a tool to do something like this (that tool is for windows…) This should work on any platform that supports dd and netcat (although I’m not sure if piping output from one program to another works with a dos command shell – maybe cygwin would be a good environment to accomplish this with.) Anyway… here are the details.


I’m putting the finishing touches on a backup server and wanted to have vmware server installed and setup on it “just in case”, because with all the storage it could certainly host a virtualized mail server or something in a pinch. Well, my main concern was how to quickly and easily get an image file of a LIVE filesystem. I know I could boot up to ghost4linux or ghost4unix or something and image over a network, but that increases the downtime. Now, realistically if this were a live system you’d probably want to disable as many network services as possible first so that there wasn’t new information. This method will start at bit 0 of the drive and progress straight through. In other words, there’s no going back because something changed.

On the machine that will “receive” the image, here’s what you do…. sudo nc -l -p 9998 | dd of=testimage.img this starts netcat listening on port 9998 for data and anything it get’s will be written to testimage.img *(my first attempt at port 9999 gave the following:: Can’t grab 0.0.0.0:9999 with bind :: I suspect something else was already using port 9999.)

Ok, now on the system to be imaged… with netcat installed (and dd)… sudo dd if=/dev/hda | nc ipaddressofreceiversystem 9998 (in other words, we start up dd with the primary drive (drive to be imaged) as the input file and pipe it to netcat (telling netcat to connect to the address of our recipient system at the correct port (same as specified on the receiver.))

Now, for a 2GB test image this took, maybe 5 minutes, I didn’t time it, but it was not long. I found someone estimating about like this…. “Typically 36GB drive may take 50 minutes over 100Mbps link.” So, that might give you an idea of what kind of time to expect.

But, the file created here is not suitable for vmware to use… yet. If you have qemu-img (from the qemu emulator) you can convert it like this…. qemu-img convert testimage.img -O vmdk testimage.vmdk and then vmware can use it as an existing disk image. But if you don’t have qemu (it’s free/open source) you might download that, or try and see if vmware-vdiskmanager can convert to the vmdk from a raw image file. Scratch that, I’ve just found the vmware forums for accomplishing this and they look messy – get qemu and use qemu-img for this it will be much easier.

Related Posts

Blog Traffic Exchange Related Posts
  • Mail Server Rejecting all Messages - Check your Blacklists relays.ordb.org is listing the WORLD It's unusual for mail servers to suddenly start rejecting messages internally and from external sources. That's exactly what I saw though over the weekend. A mailserver running mdaemon on Windows 2000 was rejected ALMOST every message that was sent it's way whether it was an internal mail sender and recipient......
  • Konqueror 3.5 not recognizing JPG's I noticed this evening that I wasn't getting the usual thumbnails of jpg images in Konqueror (KDE's file browser.) On investigation, there were error messages like this.... konqueror: WARNING: Pixmap not found for mimetype application/x-crossover-jpg being given. So, I looked in my home directory's kde folder (.kde) and deeper in......
  • Remote Tech Support using VNC (Ultravnc SC and x11vnc+wrapper script) Ok, some time back I'd done a writeup on UltraVNC SC, which is a nice customizable (windows version) VNC server that essentially let's someone doing remote support build their own downloadable .exe that runs and automatically tries to make a direct connection to a "listening" vnc viewer. It's good for......
Blog Traffic Exchange Related Websites
  • What Is Virtual Private Server A virtual private server (VPS) is a simulated hardware of a host server that enables a remote operating system to run. In the terms of web developers, a web hosting company is able to host several 'virtual' servers through one "physical" (or host) server. A "private" server is a separate......
  • How To: Programmatically Open Folders Recently as a part of support activity, I came across a unique task. This application had a windows service running on cluster of 8 different servers. To ensure that windows service is up and running, I had to check the timestamps of the log files this service was updating periodically.......
  • Pc Repair Using Registry Cleaners How can you speed up your pc when it starts slowing down? For you to fix this issue, you need to understand why it happens. Generally, slow operations on a PC are caused by a problem within the windows registry. This is the devote the pc system where all of......
www.pdf24.org    Send article as PDF   

Similar Posts


See what happened this day in history from either BBC Wikipedia
Search:
Keywords:
Amazon Logo

Comments are closed.


Switch to our mobile site