On Thu, 7 May 2026, [email protected] wrote:

On Thu, May 07, 2026 at 10:33:06AM +0200, Hans wrote:
Hi folks,

just a question: Is there a tool in debian, which can create partition images
of mounted harddrives?

There is a bit of a contradiction in this: while a file system is mounted [1]
read/write, its backing image "on disk" is necessarily inconsistent, since
changes occurring to it take some time to go from buffer cache to disk (this
is why you get the performance). Many structural changes are just in RAM and
end up somewhat later on "disk" (i.e. on the block device, whatever it is,
see footnote).

If you (re)mount read only, things are looking better.

Ideally, you have a snapshotting file system (zfs, btrfs), or a snapshotting
block mapping layer (LVM) beneath your file system. Then you can "freeze" a
snapshot and copy that while letting the file system move on.

I'll second this. I use dump/restore via lvm snapshots. I run fsck on the snapshot before dumping and then I verify against the (ro) mounted snapshot.

Obviously this only works on extfs based fs but I don't see why it wouldn't work via dd on almost any fs.

(I also do sync before taking the snapshot).

The only time I got verify errors was down to a faulty ram chip.

Tim.

Reply via email to