My general strategy is:
1) dd the MBR, save it to a file
2) Use dump to make a dump of the filesystems
3) Go to the new machine, restore the MBR from the image created with dd earlier
4) Make filesystems with newfs
5) Now restore the filesystem images created with dump using restore
The advantage of dump is that it only dumps files, and not unused space. If you have a 250GB disk with only 10GB used, dd will also copy the unused 240GB, which is a waste of time.
You can also restore dump files to a filesystem of a different size.
You can also use tar or other tools, but dump has the advantage of preserving file flags etc. by default.
I'm not sure about GPT. But I would guess that just using dd to copy the first 150MB of /dev/ad0 should always be enough? This is still fairly fast (several seconds).
As an illustration, here are my notes for a
Linux system, I boot the target system from parted magic over PXE, of course, connecting the destination drive to the source system and booting the source system is easier if that's possible.
Don't copy this mindlessly, use your brain, this is just to give you an idea of how this works.
dump:
Code:
mkdir /nfs
mount_nfs 192.168.1.37:/mnt/images /nfs
cd /nfs
dd if=/dev/sda of=image.mbr.20130206 bs=512 count=63
dump -0 -f image.boot.20130206.dump /dev/sda1
dump -0 -f image.root.20130206.dump /dev/sda2
restore:
Code:
mount_nfs 192.168.1.37:/mnt/images /nfs
cd /nfs
dd if=image.mbr.20130206 of=/dev/sda
# Nieuwe partitie: reboot opnieuw naar parted magic en remount nfs
mkfs.ext3 -L /boot /dev/sda1
mkfs.ext3 -L / /dev/sda2
mkdir /dest
mount /dev/sda2 /dest
cd /dest
/nfs/dump/restore -r -f /nfs/images.root.20130206.dump
mount /dev/sda1 /dest/boot
/nfs/dump/restore -r -f /nfs/images.boot.20130206.dump