[CentOS] imaging a drive with dd

Fri Mar 3 01:59:29 UTC 2017
Warren Young <warren at etr-usa.com>

On Mar 2, 2017, at 6:53 PM, Warren Young <warren at etr-usa.com> wrote:
> 
> Why reinvent the wheel?

Oh, I forgot to say, LVM2, ZFS, and btrfs snapshots don’t image the *entire* drive including slack space.  They set a copy-on-write point which is near-instantaneous, so that whenever one of the current data blocks changes, its content gets copied to a new space on the disk and modified there, so that rolling back amounts to moving a bunch of pointers around, not downing the whole machine and wiping out your prior setup, including all that mail you’ve accumulated in the meantime.

If you’re after some unstated goal, such as off-machine backups, there’s generally a way to send a copy of the snapshot to another machine, such as via SSH.  This is also more efficient than copying a raw dd image.  Not only does it skip over slack space, you can send the snapshot to another similar machine and “play back” the snapshot there, effectively mirroring the machine, taking only as much time as needed to transmit the *changes* since the last snapshot.

If you’ve use a virtual machine manager with snapshotting features, these filesystems’ features are a lot like that.  Quick, efficient, and quite robust.