Clone whole partition or hard drive to a sparse file
40
votes
10
answers
35263
views
I like to clone a whole partition or a whole hard drive onto a larger external disk but like to create a sparse file. I often use
dd
for cloning, but it doesn't support sparse files. As a workaround I used something like:
cp --sparse=always <(dd if=/dev/sda1 bs=8M) /mount/external/backup/sda1.raw
However this is a little too tricky for my taste and doesn't allow me to resume the process if aborted. It is funny that there is a NTFS tool for this (ntfsclone
) but no such tool exists for the native file systems of Linux (EXT2-4).
Is there some better tool for this, e.g. a dd
variant with sparse support?
I do not look for some proprietary software for disk backups but simply want to make a sparse clone copy which I can mount as loop device if required.
Asked by Martin Scharrer
(920 rep)
Jul 20, 2011, 07:48 PM
Last activity: Nov 10, 2023, 10:28 AM
Last activity: Nov 10, 2023, 10:28 AM