[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: ODROID XU4 and UEFI - Re: Cautionary tale: how to kill an SDCard with one simple command



On 25/07/18 21:00, Adam Borowski wrote:
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

Thanks for that, I'll take a look.

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.

I fount btrfs a bit scary, with (when I last looked) too many things unimplemented and insufficient filesystem/kernel version/implementation checks.

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.

[Nod] The thing that caused me problems (on a PC) a few weeks ago was moving an OS between discs, and eventually working out that I had to forcibly update GRUB and then rebuild the initramfs to get details like the initial fstab correct.

--
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]


Reply to: