Le 08/01/2026 à 00:30, Martin Castillo a écrit :
Hi,
I'm deleting a harddrive with 4 partitions. I created mapfiles of
partition 3 and 4 with partclone -D respectively and used something like
ddrescue -yD bigfilewithzeros /dev/sdb3 part3.mapfile to overwrite only
the used parts.
Then I remembered, freed areas will not be overwritten and, thus some
deleted files might still be recoverable. So I do need to overwrite the
whole disk, but want to save me the time to overwrite those sectors I
already overwrote.
I know ddrescuelog can be used to transform and merge mapfiles.
So I first shifted the partition-based mapfiles to represent the whole-
disk addresses:
ddrescuelog --shift -b 4096 -o 58983168s part3.mapfile >hdd-section-of-
part3.mapfile
ddrescuelog --shift -b 4096 -o 117902336s part4.mapfile >hdd-section-of-
part4.mapfile
Now I want to merge the finished sections of these mapfiles, and this
fails:
ddrescuelog -z hdd-section-of-part4.mapfile hdd-section-of-part3.mapfile
>merged
diff -u hdd-section-of-part3.mapfile merged # practically no difference
diff -u hdd-section-of-part4.mapfile merged # practically no lines in
common
I expected the finished areas from partition4 to be marked as finished
in 'merged', but instead it contains just a copy of hdd-section-of-
part3.mapfile.
What am I doing wrong?
Martin Castillo
I've nothing to say about ddrescuelog -z, but you could achieve what you
want do do without modifying the mapfile with this command:
"ddrescue --fill-mode=? --force /dev/zero /dev/sdb3 part3.mapfile"