Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

JustMartin

macrumors 6502a
Original poster
Feb 28, 2012
787
271
UK
See if I can make this as clear as possible.

IMac2019 running Big Sur

I have an external drive (3Tb) with a collection of files on it
At some point in the past, I partitioned the drive into two 1.5Tb partitions - one held the files, the other was empty
I pointed Time Machine at the empty drive
Turns out that I had miscalculated how much space I needed, so moved Time Machine back to using a Time Capsule
Now, for various reasons I want to recover the unused 1.5Tb and merge it back to the partition with stuff on it.
For reference, Time Machine is now pointing to a completely different attached hard drive

I went into disk utility
Clicked on the partition I wanted to remove
Hit the - button
Confirmed and got....

Partitioning disk “Seagate Expansion Desk Media” (disk3)

Running operation 1 of 1: Remove “Martins External Backup Partition” (disk3s3) and grow “Martins External” (disk3s2)…
Couldn’t unmount disk. : (-69888)

Operation failed…

I restarted in recovery mode and tried again - exactly the same thing.
I tried erasing the container from Disk Utility, that worked, but same error on attempting to remove the partition

I can manually mount and unmount that partition from disk utility

I can't find anything much to do with that error number. My guess is that there is something that TM left behind that has effectively locked the partition
 
Here's what to do:

1. Back up the partition you wish to SAVE by cloning it to another drive using either CarbonCopyCloner or SuperDuper. Both of these utilities are FREE to download and use for 30 days, "doing it my way" will cost you nothing.

2. Once your backup is created and stored off to the side, use disk utility to ERASE THE ENTIRE DRIVE. Open disk utility and (VERY IMPORTANT) make sure you go to the view menu and choose "show all devices". In disk utility, choose "the top line" that represents the PHYSICAL drive. Then click the erase button...

3. If this is to be a "non-bootable" data drive (no system files on it), then I STRONGLY SUGGEST that you erase it to HFS+ and NOT to APFS.
(that's "Mac OS extended with journaling enabled, GUID partition format")

4. Now that the drive is erased and is a single partition, connect the cloned backup you just created. Open either CCC or SD and "re-clone" the backup BACK TO the original drive.

That should do it.
 
Last edited:
Here's what to do:

1. Back up the partition you wish to SAVE by cloning it to another drive using either CarbonCopyCloner or SuperDuper. Both of these utilities are FREE to download and use for 30 days, "doing it my way" will cost you nothing.

2. Once your backup is created and stored off to the side, use disk utility to ERASE THE ENTIRE DRIVE. Open disk utility and (VERY IMPORTANT) make sure you go to the view menu and choose "show all devices". In disk utility, choose "the top line" that represents the PHYSICAL drive. Then click the erase button...

3. If this is to be a "non-bootable" data drive (no system files on it), then I STRONGLY SUGGEST that you erase it to HFS+ and NOT to APFS.
(that's "Mac OS extended with journaling enabled, GUID partition format")

4. Now that the drive is erased and is a single partition, connect the cloned backup you just created. Open either CCC or SD and "re-clone" the backup BACK TO the original drive.

That should do it.
Thank you.

I knew there was a nuclear option. I’m hoping someone can point me at figuring out what’s causing the problem and fixing it. I’m comfortable working at a terminal level.
 
See what's mounted where
mount

Get a list of partitions
diskutil list

Try to unmount the partitions you want to affect
diskutil unmount disk#s#

If that doesn't work, so if there's any open files on the partitions
lsof | grep insertvolumenamehere
 
  • Like
Reactions: Brian33
Figured it out or at least found an approach that worked.
The original disk had been formatted JHFS+
The second partition that I created was formatted as APFS
This meant that my disk looked somewhat like

/dev/disk3
Partition scheme disk3
EFI disk3s1
Apple HFS+ Needed_Partition disk3s2
Apple APFS Container disk5 disk3s3
/dev/disk5 (synthesized)
APFS Container Scheme disk5
Physical store disk3s3
APFS Volume Partion_togo disk5s1

There were no files on the partition I wanted to remove (apart from standard hidden ones for things like spotlight)
And I could manually unmount and mount drives from Disk Utility and the command line

So, the partitions I wanted to merge were disk3s2 and disk5s1 - both in separate containers and one of them nested in an APFS container. I suspect that diskutil tried to dismount one of the APFS volumes, either the container or the contents and was prevented because the other was still mounted. Very much guesswork I'm afraid

Anyway, after a bit of googling I decided the best thing to do would be to try and delete the container

$ sudo diskutil apfs deleteContainer disk5

That worked - leaving me with a 1.5Tb partition and 1.5Tb unassigned. I then used disk utility to change the partition size and I got my space back.
 
  • Like
Reactions: Fishrrman
In Disk Utility.app, select View -> Show All Devices, which should allow you to erase a container partition and change it's format from APFS at the same time to HFS+ for example.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.