In the process of upgrading my Mac SSD drive (which is a whole story of its own), I've come across many different methods of doing so.
At one time, I was keeping "Time Machine" backups regularly which made the whole process quick and easy; I swapped the SSD cards and restored the most recent Time Machine backup from the hard drive I was keeping the backups on.
Eventually, I came across another method that I was already familiar with already but didn't think of in this particular scenario.
It evolves a command line utility called "dd" (Wikipedia) mainly used to copy and convert files.
This cloning method works on Macs, Linux, FreeBSD and any unix-based systems. You will have to be familiar with the command line interface (Terminal).
Normally the command looks like this:
"if" is the input file - it is the original drive we wish to clone.
"of" is of course, the output file - our target drive.
Normally, in a Linux system, "sda" represents the first disk and "sdb" would represents the secondary disk.
Normally the command used to display all disks looks like this: "sudo fdisk -l".
However, this command will not work on Mac systems. Instead a different command can be used.
The MacOS disk utility (diskutil) can help achieve this task. The full command will look like this:
"diskutil list".
While this simple command and and does work in most cases; It is considered unstable as the dd utility will skip every error it encounters which can cause an error.
The "conv=noerror,sync" tells dd to replace missing input data (from the disk of origin) with empty (Null) bytes. These will be processed as normal input buffers which will ensure a successful clone.
At one time, I was keeping "Time Machine" backups regularly which made the whole process quick and easy; I swapped the SSD cards and restored the most recent Time Machine backup from the hard drive I was keeping the backups on.
Eventually, I came across another method that I was already familiar with already but didn't think of in this particular scenario.
It evolves a command line utility called "dd" (Wikipedia) mainly used to copy and convert files.
This cloning method works on Macs, Linux, FreeBSD and any unix-based systems. You will have to be familiar with the command line interface (Terminal).
Normally the command looks like this:
$ sudo dd if=/dev/sda of=/dev/sdb"sudo" is necessary as we are cloning a system drive.
"if" is the input file - it is the original drive we wish to clone.
"of" is of course, the output file - our target drive.
Normally, in a Linux system, "sda" represents the first disk and "sdb" would represents the secondary disk.
Normally the command used to display all disks looks like this: "sudo fdisk -l".
However, this command will not work on Mac systems. Instead a different command can be used.
The MacOS disk utility (diskutil) can help achieve this task. The full command will look like this:
"diskutil list".
While this simple command and and does work in most cases; It is considered unstable as the dd utility will skip every error it encounters which can cause an error.
$ sudo dd if=/dev/sda of=/dev/sdb bs=64K conv=noerror,syncNote: Mac systems usually refer to disks as "disk0", "disk1" etc. Therefore, in order to clone "disk0" to "disk1" we would use a command that looks like this:
$ sudo dd if=/dev/disk0 of=/dev/disk1 bs=64K conv=noerror,syncThe purpose of the "bs" operand is to specify the block size. 64K is usually recommended.
The "conv=noerror,sync" tells dd to replace missing input data (from the disk of origin) with empty (Null) bytes. These will be processed as normal input buffers which will ensure a successful clone.
Comments
Post a Comment