OK - I normally just use DD to clone things (e.g. an RPi raspbian image or SD card, onto another medium)…
But it drives me insane sometimes knowing that just because I’m copying a 256 GB partition - it shouldn’t worry about all them empty zero’d bits - but it copies them anyway… i.e. why can’t it be smarter and not attempt to copy empty data? Seems a very common question out there in the wild… and I’ve never seen an answer (other than doing things like pipe it through gzip or bzip or something).
So - here’s the thing :
I’m trying to clone a 256 USB 3 thumb (Samsung brand - it’s genuine) drive with Raspbian on it to a 2 TB USB 3 thumb drive (that’s got a Samsung logo silk screen onto it - but I strongly suspect it’s a fake).
Note : I’m doing all these things on my Ryzen 7 desktop machine running Ubuntu 20.04… mostly via a powered USB 3 hub…
“dd” was taking WAY too long so I canned it (and the inefficiency of “dd’ing” empty bits annoyed the crap out of me).
Installed clonezilla - but it continually barfs with ugly red writing I can barely read (red text on black terminal) - something about the partitions being mounted… so I unmount them and try again, then it complains in the text UI that there’s nothing to clone from or to - so how to do I use it to clone stuff that’s mounted… tried it as “me” and started from “sudo” : same results…
So - I tried “ddrescue” (apt get install gddrescue)… and seriously, despite someone saying it doesn’t clone empty data, it must be - because I let it run and finish and it must have taken EIGHT hours!
And the copying was dodgy anyway - because if I try to boot the Pi from it I get a kernel panic… and I’m guessing it’s default behaviour is to assume it’s copying from a possible bad source and doing lotsa CRC and stuff on the data it reads before writing - i.e. probably too much overhead…
I may just go back to using simple “dd”… if it keeps happening then I’m probably thinking this is because it’s a VERY shonky Chinese knock off of a Samsung thumb drive with shoddy parts and components… buyer beware and all that…
Because last time I did this - cloning from an SD-card to an external USB C “3” Samsung SSD - I used DD - and it took ages (but not EIGHT HOURS), but it worked in the end…
Hmmm - I just remembered Raspbian desktop installs some GUI app to clone your SD card… might try that… but I expect it will brown out as there’s not usually enough power in the Pi (Pi4B 8 GB) to do I/O on TWO USB 3 devices… might have to use a powered USB 3 hub to accomplish this… nothing’s ever easy… and I’d rather do it on the Ryzen 'cause it’s got way more grunt than the Pi…