How do I replicate a SSD drive and copy the MBR so that that replicated SSD is identical?
3 Answers
I've had success cloning system installed on USB sticks using dd command.
dd if=/dev/sda of=/dev/sdb
Where I'm assuming /dev/sda is your source and /dev/sdb is your destination. It's important not to mess these up or you're overwriting your good disk with 0s.
You'll probably want to run dd from a bootable utility disk. Don't dd a live system, because you may get a corrupt filesystem on the destination disk.
You can identify disks attached using fdisk -l. But this won't tell you which one's source and destination. You'll have to mount them and see which one contains your system files and then proceed to dd it.
Also, when you're cloning whole device, it will likely work when both your device is by same manufacturer and same type. Even though disks say they're 16 GB, some are a few bytes longer, some are shorter. fdisk -l will report size and make sure these are the same. If your source is larger than destination you can try:
- gparted to resize source partition
- gparted to create partition on destination drive of the same size
- dd /dev/sda1 /dev/sdb1 to copy partitions
- grub to make /dev/sdb bootable. You'll have to search how to install grub.
- 295
Using dd will certainly work, but it's not ideal for SSDs because it will cause all sorts of problems with TRIM and garbage collection, as it will be writing to the entire SSD. A better option is to use something that only copies used parts of the drive -- I think partimage and similar type utilties can do this.
- 201
- 1
- 9
I've always found that clonezilla, which uses dd is the easiest way to accomplish your task. It is a modified Debian distribution.
- 210