Gentoo Archives: gentoo-user

From: Andrea Conti <alyf@××××.net>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Re: Fast checksumming of whole partitions
Date: Sun, 06 Jun 2010 10:21:28
Message-Id: 4C0B764D.5030008@alyf.net
In Reply to: [gentoo-user] Re: Fast checksumming of whole partitions by 7v5w7go9ub0o <7v5w7go9ub0o@gmail.com>
1 > 1. boot up knoppix
2 > 2. create a partition: mkdir /work
3 > 3. mount /work to the root partition: mount /dev/sdc /work
4 > 4. cd /work/usr/bin
5 > 5. run dcfldd: ./dcfldd
6
7 This is fine, provided that
8
9 1- if the root partition is [part of] what you're copying, you *must*
10 mount it read-only (mount -o ro /dev/sdc /work)
11
12 2- the dcfldd executable is linked statically. If it uses dynamic
13 linking, your "live" system -- knoppix in this case -- must have exactly
14 the same library versions (especially glibc) as the gentoo system.
15
16 >> Or is there a way to do such copies from a one disk to another while
17 >> one disk is booted???
18
19 The point is not with being "booted" (i.e., part of the running system)
20 or not: you *cannot* reliably perform a sector-by-sector copy of any
21 write-mounted partition without special support either at the FS or
22 block device level (i.e. snapshots).
23
24 > Sure, but the running disk/sector would have temporary files that would
25 > not consistently hash when you did the hash check.
26
27 That is only a minor part of the problem. The real issue is that if
28 *anything* writes to the source partition while you are halfway through
29 copy, you risk ending up with inconsistencies in the filesystem
30 metadata. Doing a fsck on the copy will probably fix that, but you risk
31 losing or corrupting data.
32
33 And no, hashing as described in the previous post will *not* catch any
34 differences in this case, as the "source" hash is computed from what is
35 read during the copy (which, barring hardware problems, is what gets
36 written on the target disk) and not from the whole contents of the
37 source partition after the copy (or at any single point in time).
38
39 > If you do this, try it in linux without bringing up X.
40
41 That's definitely not enough: at the very least, boot up in single-user
42 mode and remount all your partitions read-only (mount -o remount,ro).
43 This will break things on a running system (e.g anything that writes to
44 /var and /tmp will throw errors or stop working), but it will allow you
45 to produce consistent partition images.
46
47 andrea

Replies

Subject Author
Re: [gentoo-user] Re: Fast checksumming of whole partitions Mick <michaelkintzios@×××××.com>
[gentoo-user] Re: Fast checksumming of whole partitions 7v5w7go9ub0o <7v5w7go9ub0o@×××××.com>