I have also copied filesystems with tar over ssh. Assuming you want to copy /var, then:
Code:
pchost# cd /var
pchost# tar cfpB - . | ssh vmhost "(cd /new/mount/point/var; tar xfpB -)"
but you would have to do a few things before this:
- boot the DVD/CD in fixit mode
- ifconfig the network connection
- run disklabel to partition the disk
- run newfs to make new filesystems on each partition
- mount the new filesystem
dd will work, but has some downsides. The image produced will be exactly the same size as the whole original disk. Since the original disk is likely not entirely full, you end up copying a lot of blank space and end up with a huge image. This is particularly bad with dynamic-sized image files used by VMs.
dump and restore are the way that will let you create a differently-sized target and copy the system over to it.
I have used dd before with netcat (nc) to clone one system to another. But this is only useful for two identical systems with the same size hard disk. Since the OP mentioned going to a different system (VMWare), I didn't offer this. Two examples where I used dd was to build 14 Sun Netra boxes (all with same disk) and to rebuild an IBM Blade system by cloning from another identically setup blade. So I know it works but could take over 2 hours depending on how large the disk you're cloning from/to is.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.