As part of my new Hacintosh build (this is the 4th in a series of posts about it), I wanted to move the two internal hard drives from the old computer to the new. In the old computer, I had the internal system drive and two additional internal drives – a 1Tb drive for TimeMachine and a 2 Tb drive for Music, Pictures, and Movies.
I could have just pulled the drives from the old computer and plugged them into the new computer and been done. But with HDD hardware, it’s not a question of if they will fail but when and 6 years into their life they are obviously more prone to failure than they were when they were new. Also, I wanted to increase the sizes. Now 6 years later, disk space is cheap and resources get consumed so I wanted to increase the size of the drives in the new computer but still function with the same layout. So in addition to my system drive in the new computer, I would also end up with two 6 Tb drives taking on the same roles as in the old computer.
And therefore this long post is all about how I did eventually succeed in getting the drives migrated. It was way more complicated than it should have been. I should not have been surprised since my problem with Apple is that while things work well within their tidy little world, but as soon as you go beyond the mainstream, you find lots of problems and this is certainly one of those cases. If you want to skip the failed attempts, jump right to Attempt 9 where I describe the attempt that did succeed. But for the sake of anyone trying other things, I’ll describe where those other problems hit me and could you too. Note that I’m no expert on the subject of hard drive migration but given that it took a few days to work through all of this, I’ve got a lot more familiarity with this than I did at the start!
As usual, if anything written here causes computer failure or data loss or anything else happens to you as a consequence of what I have written, whether legal, physical, or emotional, it’s all on you. And if things like creating partitions, typing in terminal, or making changes in the BIOS are tasks with which you are unfamiliar or uncomfortable, now is a good time to click the “Back” button in your browser and go somewhere else. But thanks for visiting.
Attempt 1 – UBCD Clonezilla
Years ago I got a copy of Ultimate Boot CD (UBCD) on to a USB Flash Drive (UFD). I’ve held on to that and found it has been useful on a couple of occasions. If you don’t end up doing anything else in this post, get yourself a copy of it to have on hand for the future. It’s handy to have and you never know when you won’t be able to get it.
Since I’ve used the UBCD before, I figured this was going to be easy. I installed both the old and new hard drives in the new computer (I have 2 bays and can use the 2 bays to go from one to the other then I can repeat the process with the next old and new pairs of drives). I booted from the UBCD UFD. Note that when booting my Dell 9020, I need to use F12 to select the UFD to boot from. And each time you boot the UBCD UFD, it will ask you to choose what you want to boot. I always choose “Partition Magic” and “64-bit from RAM”.
Once it booted up, I ran Clonezilla and did a “local to local” and “device to device” clone. I selected the source and target disks very carefully and even though I ran in expert mode, I only changed one thing in turning off the boot flag copy – my drives are not boot drives, so none of that should matter.
This attempt failed due to a disk error. Frankly, it’s kind of annoying that the defaults for doing a clone are to completely fail the clone if it encounters one error. But I learned my lesson.
Attempt 2 – UBCD Clonezilla
I did the same process as Attempt 1 except this time I was a little better about keeping track of the options for Clonezilla.
- device to device, Enter
- Expert, enter
- disk to local disk, enter
- select source disk (carefully!), enter
- select target disk (carefully!), enter
- deselect -g, deselect -e1, select -rescue, enter
- no change, enter
- no change, enter
- enter
- Y, enter
- Y, enter
- Y, enter
It took about 1-3/4 hours for this to run on a 1 Tb drive. And I was happy to see that the clone was successful, at least as far as Clonezilla was concerned.
I rebooted into MacOS and the drive was found successfully. Except the size of the drive was really confused. In one case, it showed that the drive was 6 Tb but in another way it showed it was 1 Tb. In Disk Utility, I tried to resize the partition but even though it showed me there was blank space, it wouldn’t let me expand into it. It seemed pretty clear that the drive had a locked in partition size based on the clone process.
Attempt 3 – Disk Utility in Recovery
Although my drives were not boot drives, I figured I would follow the general instructions for Mac drive cloning by doing it in Recovery. Just in case there was something better about being in Recovery mode. Note that to boot into Recovery mode on an OpenCore system, you need to hit the space bar on boot up to show Recovery.
Once in Disk Utility, be sure to always click View -> Show All Devices.
I selected the new disk that will be the clone target and clicked to unmount. And with the target disk still selected, I clicked the Erase button and chose MacOS Journaled (which is HFS+) and left it with GUID Parition (GPT) and clicked Erase, then Done when it finished.
Now with a clean disk again, and this time cleaned and Erased by MacOS, I started the Restore process. With the target disk still selected, I clicked on Restore and tried to chose the source drive to do the restore. It wouldn’t let me chose it.
Apparently, Disk Utility doesn’t like to work with HFS+ like this. And even though it was going to clone an HFS+ drive to a new HFS+ drive, it didn’t want to let me do it.
I’m starting to get annoyed by this process.
Attempt 4 – Disk Utility and UBCD Clonezilla
Okay, so it seems that cloning the whole hard drive through Clonezilla causes problems for MacOS but at the same time, MacOS’s Disk Utility can’t do the job itself. So my thinking was to use both tools to do what their strengths are.
I started by Erasing the drive in Disk Utility (and yes, I had already done that in the step above but here again for good measure). Same settings with MacOS Journaled and GPT.
Then I rebooted into the UBCD and ran Clonezilla. This time I did things a bit different including this time doing a partition clone and using the “-r” resize flag.
- device to local device
- partition to partition
- deselect -g, deselect -e1, select -r, select -rescue, select -v, enter
- enter
- enter
- enter
- Y, enter
- Y, enter
It took about 2 hours to clone the 1 TB partition and Clonezilla reported a success.
However rebooting into MacOS showed that MacOS was now really confused. Not only did it have the same problems as before with 6 Tb in one place and 1 Tb in another, but Disk Utility failed to select the disk reporting a problem with the “node structure”. It turned out the “node structure” complaint is based on the fact that TimeMachine drives are loaded with “hard links” and MacOS doesn’t like working with them – even though it created them in the TimeMachine backup.
Attempt 5 – cp in Terminal
I reformatted the drive in Disk Utility again and figured I would just attack it as simply as possible. I wanted to just do a “cp” of the drive. I got stuck right off the bat here when I tried to read the source TimeMachine hard drive and discovered that Terminal wasn’t allowed to view it. I then discovered that I could allow that by using the System Settings -> Security & Privacy -> Privacy -> Full Disk Access, select Terminal.
Okay, now I can see the files and I can do the copy. But I know from experience that copying files in Terminal means that the files end up with the permissions for the current user and the current dates unless you use the right flag. That’s the “-p” flag which preserves both.
I kicked off the copy and got a screenful of errors right away. Right, I forgot to use sudo. I did it again with sudo.
Still got a screenful of errors. There’s something about copying a TimeMachine drive this way that won’t allow permissions to be copied. Unfortunately, there’s no switch on the cp command in Unix to allow you to preserve the dates but ignore the permissions. So I just redirected the error output to /dev/null and tried the cp command again.
Well, technically it may have been working. But after an hour, it had barely gotten through the first TimeMachine backup directory. It would literally take days if the the process could ever really succeed. So I had to kill that and give up on this approach.
Attempt 6 – SuperDuper copy newer
I’m generally under the impression that most tasks that I only do once are not things I want to buy software to do. But given the challenges I’d encountered to this point, it seemed like the shortest solution was going to be buying special software just for the cloning. SuperDuper has been around for ages and is well rated so I wanted to give it a shot.
I figured I would try “copy newer” because that cp command did at least copy over some stuff and maybe I could make it go faster this way. Boy did that turn out to have been a stupid idea. SuperDuper did a full analysis on all of the files one by one and it was going to take way to long. I had to kill it and fortunately, SuperDuper did allow the process to be stopped.
Attempt 7 – SuperDuper clone
Okay maybe the problem is that MacOS really prefers to work with APFS drives now instead of HFS+ drives. So what if I clone the HFS+ drive and then do an APFS conversion after the fact? And instead of using Clonezilla to do the cloning, I can use SuperDuper to do it.
So I reformatted the new drive again and still as HFS+. Then I used SuperDuper to clone the drive. The good news is that this process did seem to get off to a good start. But the longer it went, the slower it got. After 23 hours, it had just barely gotten to the half way point on the 1TB drive. And worse, the copy speed was continuing to go down. I had a pretty good sense that if I let it go another two days, it would get down to a speed so slow it was barely doing anything. I had to kill it again. I regretted spending the money on SuperDuper to only have ended up waiting more days.
Attempt 8 – old Mac Disk Utility
Perhaps the problem is that the new Disk Utility prefers APFS and the old one would work better with HFS+ drives. So I decided to do the cloning of the drives in the old computer instead of the new one. This had the added benefit of me being able to do more setup work in the new computer environment while the old computer was slogging away with the clone.
I was able to reformat and then kick off a restore. When I came back to the computer to see how it was going a while later, the screen had gone dark from the screensaver but it wouldn’t wake up. The computer had apparently frozen completely during the restore.
Attempt 9 – Disk Util, UBCD, and mergePartitions – success
I actually went back to Attempt 2 to try it again just to make sure I wasn’t crazy – it still failed as before.
I had stumbled upon a post about somebody trying to something similar to what I was trying to do with a Time Machine drive. I read through it and tried a couple of times and eventually figured out the procedure that actually worked. It’s a little convoluted but for a one-time thing that had already wasted days of my time, I was happy something finally worked. And while the result is an HFS+ drive still, I don’t think that’s really that big a deal to me at this point – APFS seemed like it was going to be more trouble than it was worth.
I booted up with the UBCD UFD again. Same options of Partition Magic and the 64-bit RAM choices. Once in the UBCD desktop, I clicked on Erase Disk. I chose the write zeros to the whole drive option and when it was clear that was going to take longer than I wanted, I canceled it. The key was to have wiped out at the least the first part of the drive so there was no boot table remaining from past failed attempts and the drive would look new to MacOS.
Then I booted into MacOS. It said that the drive was not usuable and did I want to Initialize it. Sure. But this time in Disk Utility, I created 2 partitions, both of them HFS+. The first partition size was ever so slightly larger than the original disk’s size.
Then I rebooted again to the UBCD UFD and got back to the UBCD desktop. I ran Clonezilla with slightly different choices. Note in particular that the resize this time is turned off.
- device to local device
- partition to partition
- deselect -e1, deselect -r, select -rescue, select -v, enter
- enter
- enter
- enter
- Y, enter
- Y, enter
Then I booted back into MacOS and confirmed that the drive looked correct. At this point, there are now two partitions on the target drive where one of them is an exact match for the prior drive and the second is the rest of the drive.
In Disk Utility, I noted the disk IDs in the target drive for the two partitions that I wanted to merge. (And of course, now that the clone is complete, the source drive can be disconnected anyway to reduce confusion.) Then in Terminal I ran this command:
sudo diskutil mergePartitions hfs+ foo disk1s2 disk1s3
Note that the format and disk name “foo” are ignored and the return of the command will even tell you that – they just didn’t bother implementing a version of this command that didn’t need those parameters set. The merge actually runs pretty quickly and at the end, the result should be a single partition that covers all the space that you want it to cover.
I repeated this process for my second drive. And I goofed on the partition sizing where I ended up with the target a few bytes smaller than the source so I had to do that a second time.
After finishing the clones and getting the disks installed in the new computer, then I needed to tell TimeMachine to use the new disk. Then I told it to Backup Now and as soon as it started, it returned with a warning that the TimeMachine disk had backups from an old computer on it and did I want to claim those backups. Yes!! That was the major reason to do all of this. So now, when I look in TimeMachine, I can see backups as far back as the original TimeMachine drive and not just of the current build of this computer. It’s kind of funny to think of all the effort I put in to getting the TimeMachine drive cloned especially since I may never need any of the backups. But obviously, the point to backups is to have them just in case. And now I do.