I have a USB stick who's contents (including partition table) I want to duplicate onto another, larger USB stick. Right now, I have to dd
the entirety of a 16 GB stick onto a 128 GB stick and then extend the final partition on the 128 GB stick.
Let's call the original stick /dev/sdba
and the new stick /dev/sdbb
.
# Read image off old stick
dd bs=4M if=/dev/sda of=some.img conv=fsync
# Compress
gzip some.img
# Very slow transfer of some.img over the network
# Decompress
gzip --decompress some.img.gz
# Write image onto new, larger stick
dd bs=4M if=some.img of=/dev/sdb conv=fsync
# Extend partitions, following prompts of gparted
gparted
p
Fix
p
How do I avoid having to copy all the dead space of the original USB stick?