I want to clone a hard disk using dd. Because I want to keep a process on the machine alive continuously, I would like to do this while the filesystem is still mounted. I understand this is not the "ideal" way to do this, but it also seems from Googling that it is possible.
The clone is being used as a backup; in the event of a hard disk failure I would like to have an image to dd back onto a new hard disk. The OS that is running lives on the disk I want to clone.
The process I have running does do some disk I/O but not with the disk I wish to clone. As far as I know, only the OS/system processes would be reading or writing to the disk while I do this operation. What I want to know is if this light use is likely to ruin the whole cloned image? I imagine that there's a danger of getting a few files corrupted if they're being written as they are read by dd, but I have no idea how likely it is to ruin the backup. Can anyone share some insights?
Short of putting the it on a disk and trying to start it, is there any way I can verify the integrity of the image?
Thanks!
dd
over a RAID 1 (mirroring) solution? RAID 1 system will even be able to keep running after a single HD failure. Linux/UNIX can create software RAIDs, even starting with existing non-RAID volumes. Replacing the disk requires a reboot, scheduled at any convenient time. (Hot swap hardware RAID is zero-downtime.) Leaving this as a comment, not an answer, as your question currently asks about the risks of usingdd
, not the best solution, which I of course respect. – type_outcast Nov 23 '15 at 19:55dd
from a mounted disk, you should probably remount it RO. This will allow it to stay mounted, but stop the OS writing to it, so you won't get an inconsistent copy. – Tom Hunt Nov 23 '15 at 20:37