Skip to content
Advertisement

Linux dd create multiple iso files

I want to create an iso from an external hard drive. I used this command:

sudo dd if=/dev/sdb of=usb-image.iso

It works, however, the disk is large (700 GB), and i dont have space on my laptop to store that much. I was thinking about creating multiple iso files (each file 5 GB for example), this way, I can manage them by storing some parts on other drives.

Any help? Thanks

Advertisement

Answer

I’d use the split program to split the output from dd into different files. You can adjust the split size as you see fit (look at the 5000m argument):

dd if=/dev/sdb | split -b 5000m - /tmp/output.gz

This will yield files like /tmp/output.gz.aa, /tmp/output.gz.ab, etc.

Additionally, for further space storage, you can gzip your archive midstream, like this:

dd if=/dev/sdb | gzip -c | split -b 5000m - /tmp/output.gz

Later, when you want to restore, do this:

cat /tmp/output.gz.* | gzip -dc | dd of=/dev/sdb

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement