migrate physical freeBSD to virtual

You could try cloning the disk to the VM using dump and restore like so:

http://tomclegg.net/freebsdclone

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

before this would work.
 
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.

http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/backup-basics.html#AEN25848 gives the basics.

http://www.freebsd.org/doc/en_US.ISO8859-1/books/faq/disks.html#NEW-HUGE-DISK is related, and really what is being done. Although the new disk might actually be smaller than the original.
 
dennylin93 said:
dd() just copies the data directly from the disks. Don't think it would work.

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. ;)
 
Back
Top