Solaris 10: How to image a machine

backupdisk-imagesolarissolaris-10

I've got a Solaris 10 workstation that I'd like to create a full image backup from. The machine has 2 drives, one UFS for system root, and 1 ZFS for data storage.

I intend to add a third HD to keep the backup images of both primary drives (including any zfs snapshots). The purpose is not disaster recovery, but rather to allow me to easily blow away a series of application installation/configuration changes I intend to try.

What's the best way to do this? I'm not too familiar with Solaris, but have some basic Linux knowledge.

I looked at CloneZilla, but it does not support Solaris. I'm OK with just a dd | gzip > image style solution, but I'd need some way to first zero-out the non-used blocks on the primary drives to aid gzip. They are are much larger than my 3rd drive, but hardly have any real data.

Update to clarify:

  1. I specifically want to avoid using any file-system snapshot functionality, because part of the app configuration changes involve/depend slightly on existing and new snapshots. Ideally the full collection of snapshots should be part of the backup.

  2. Virtualization not an option, because the goal is to do performance evaluation on a very specific HW configuration. For the same reason, the spurious "back up" snapshots could skew performance data.

Thank you

Best Answer

You already have the solution. Use dd inside solaris to do this on each filesystem

dd if=/dev/zero of=file.iso bs=1M count=<the amount of free space you have in megabytes>

You will likely run out of space for a few seconds at the very end of the file creation, as soon as you get your disk full error, delete the file, shutdown the machine and image from a linux live disk with

dd if=</dev/disc_to_be_imaged> of=file_on_third_disk bs=1M

the "bs=" flag roughly dictates your performance, depending on the kind of storage bus you're using, you might want to try higher values, 1M block size is reasonable on pretty much any hardware and it is fast enough for sub-terabyte sizes.

I can add details to the answer if you need to dig deeper before trying it, but this is pretty much hassle-free. I use it on production SAP machines regularly.

EDIT:

Getting uneven feedback about the presence of /dev/zero on Solaris. If it's there, use that.

If it isn't, use

mkfile -v <number> g (where g stands for gigs, use m, k,b for smaller sizes) <filename>

This will create a zero-padded file which achieves the same result. (As far as the manpage goes, mkfile is a solaris wrapper around /dev/zero so it's literally the same technique in a different dress).

Example:

mkfile -v 100 g /root/zeropad.iso

This would create a 100 gigabytes file in /root called "zeropad.iso".

Hope this is helpful.

Related Topic