On 30/12/2021 12.44, David T-G wrote:
Carlos, et al --
...and then Carlos E. R. said... % % Hi, % % I use this bash code (script) to image partitions - I arrived there with % help here:
Thanks! This is a tight little function.
Yes :-) The idea is to read from disk only once. Calculating the checksum is one huge disk read operation, and reading it in order to copy elsewhere is another huge read operation. Compression is fast on a fast CPU, but my laptops aren't, so the --fast switch should improve things. Space is not that important, I just want to not waste it, like on empty sectors. The verification phase is for paranoia, and is very slow, doesn't parallelize. But I think it is better safe than sorry, with a backup.
% % function hacer() % { % echo % echo "Doing partition $1 ($2) on $3" ... % % Used this way: % % time hacer sda1 "5S" "sda1_WINBOOT" % time hacer sda2 "250M" "sda2_WINDOWS" [snip]
I'm still curious about $2, though. It isn't used anywhere else, so it looks like it's just a way for you to provide eye candy. Is that supposed to actually drive the copy size, or is it just a visual reminder?
Just visual reminder of the time it usually takes: 5 seconds, 250 minutes... :-) But it could be anything else you'd want.
TIA & Happy New Year
:-D
Same :-) -- Cheers / Saludos, Carlos E. R. (from 15.2 x86_64 at Telcontar)