On Wed, Jul 25, 2018 at 08:15:03PM +0000, Mark Morgan Lloyd wrote: > Really depends what you mean by an "image backup". I do a lot of stuff using > "ye olde traditional" dd, either between devices or more often making an > image of the entire device (i.e. including partition table etc.) to a file > and manipulate it there (e.g. by deleting a directory tree /after/ the data > has been copied). > > However when using something like dd there's a major problem: you either > want the storage medium to be removed so you can copy the filesystems > offline, or you need to shut every possible piece of running software down > (including things like your SSH daemon) so that nothing's writing to the > disc when you're trying to copy it. Needless to say the same considerations > apply when using dd to do a sector-by-sector copy from one device to > another.
man fsfreeze Some filesystems (at least btrfs) can also enumerate all writes since a certain point of time, which allows backing up the full filesystem even without freezing writes, with incremental versions done very cheaply. > There are still ways of working round that sort of problem. For example, you > can copy an entire device using dd to capture boot segments and partition > layout, inspect and recreate the filesystems using mkfs, then use > [something] to copy files one at a time into the new filesystems taking care > that some bootloaders need a wakeup call when a file moves. Usually dd-ing the partition table and u-bootage, then rsync on filesystem data works pretty well. Unlike btrfs ways, rsync is not atomic, but most people consider it good enough. Meow! -- // If you believe in so-called "intellectual property", please immediately // cease using counterfeit alphabets. Instead, contact the nearest temple // of Amon, whose priests will provide you with scribal services for all // your writing needs, for Reasonable And Non-Discriminatory prices.

