Other Image/disk backup in FreeBSD of arbitrary disk?

Is there a good way to create an image backup of a disk to a tape under FreeBSD? Ideally the method could backup any disk, regardless of partitioning, filesystem type(s), etc., and allow easy cloning, restoration, reconstruction of the imaged disk onto a new, fresh disk (of equal or greater size).
 
From my experience, it is not possible. Some filesystems (mis)use drive geometry to have orientation points (earlier it was interesting for performance). What you look for is not backup, but an image of a disk. Backups are typically more powerful than images, because they can be incremental, often are filesystem-independent (when restoring them; implies disk-independent, of course) and save time and space.

Many people have the illusion that they need easy-to-restore images that boot instantly and work like they worked before. In my opinion, such restoration is still a task for the admin and rarely for end users.

There are some interesting things to know about: a plain dd can work, if you use the same drive or drive with the exactly same number of blocks (LBA). Unfortunately, such an image wastes space and is not incremental. To hold such an image, you need a second one which is large enough to store it.

In my opinion it is better to use dedicated tools to make a full disk backup. You need to know the partition layout and the filesystem types, sizes. You save the bootloader and use the appropriate backup tools on filesystems to save them.

A better approach would be to tell us what filesystems you will probably use on the disk. You cannot tell us you will use every one that exists.
 
Most of the time restoring from backup is a lot slower than simply sticking an install disk in there and do a clean install. If you've done this a couple of times you can install a new system within a couple of minutes (document the installation!). You want to backup the data and some configuration files. I wouldn't backup the OS itself.
 
dd(1) generally works. You can restore to a disk that is larger than the original, but not smaller, and any extra space is wasted without some additional work.

But dd(1) is a poor tool for a backup. It copies bytes, whether they are used or not. Copying a disk that is only 10% full still must read and write 100% of the capacity. Compression can save some space in the image file size, but the time is still wasted.

There is some comparison of dd(1), dump(8), and Clonezilla in Backup Options For FreeBSD.
 
I would definitely go with dump(8), and restore(8)!
In fact. I use them to "clone" FreeBSD installs. I simply perform a fresh install, on bare metal, tweak the kernel conf file to suite my needs. Then perform make(1) world/kernel && make(1) install kernel/world. When completed. I bounce the box. If all goes as anticipated. I either
  1. add additional ports, common to all systems I manage, then dump the file systems to external media
  2. dump the file systems to external media
This way, I can simply boot new metal to the bootonly CD/DVD, slice, format the drive(s) then restore(8) whichever dump(8) from the external media I want to install. Bounce the box, and I'm ready to go. :)
Do read wblock@'s Backup article. It's easy reading for any user level. A great "cheat sheet" too. :)

--Chris
 
dd(1) generally works. You can restore to a disk that is larger than the original, but not smaller, and any extra space is wasted without some additional work.

Think I tried this once with NTFS and it failed (but maybe it was only PEBKAC, I cannot tell).
 
Is there a good way to create an image backup of a disk to a tape under FreeBSD? Ideally the method could backup any disk, regardless of partitioning, filesystem type(s), etc., and allow easy cloning, restoration, reconstruction of the imaged disk onto a new, fresh disk (of equal or greater size).

You definitely need file system agnostic tools, and dd(1), dump(8)/restore(8) are not among these.

You want to try one of the following:
  1. cp(1) ( cp -pR <source dir> <target dir> -- doesn't copy hard links
  2. rsync(1) ( rsync -aAHX <source dir> <target dir>) -- doesn't copy system EA's (user EA's only)
  3. clone(1) ( clone -c rwoff <source dir> <target dir>)

In all three cases, <source dir> and <target dir> may be whole file system trees. These tools would work across different file systems, e.g. can be used to clone an UFS volume to ZFS, or NTFS to UFS, ZFS, ...

rsync and clone can be used for incremental synchronizations.
 
Back
Top