Skip to content

Duplicate one hard disk partition to another hard disk

Using dd to duplicate one hard disk partition to another hard disk:

dd if=/dev/sda2 of=/dev/sdb2 bs=4096 conv=notrunc,noerror

Replace /dev/sda2 and /dev/sdb2 with your partitios.
Note that notrunc means do not truncate the output file. Noerror means to keep going if there is an error.

Dipin Krishna

Written by Dipin Krishna

Senior full-stack engineer — 15 years across Django, Laravel, SwiftUI and the infrastructure underneath. Available for contract work.

Work with me →

Leave a note

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.