Many macOS users are interested in how to merge hard disk partitions. Wizards often advise you to completely format your hard drive and reinstall macOS. This, of course, is a solution, but it is very radical and not always the most convenient. There are other options that help you achieve what you want much faster and easier.
Below is a way to delete a disk partition in macOS (merge with an existing one) using Terminal. It is somewhat more difficult for “dummies” to understand, but quickly and concretely.
Attention , the names of discs (more precisely, their chapters) may be different. If in doubt, first look at the names of your sections, for example, in the Finder.
So, back to the instructions. In the Terminal window, enter:
There will be a lot of information about the discs, in particular their names. Let’s say we have disk0s3 and disk0s2.
Remember that the data on both drives being merged will be cleared. We enter into the Terminal:
sudo diskutil eraseVolume HFS + Blank / dev / disk0s3
diskutil eraseVolume HFS + Blank / dev / disk0s3
diskutil eraseVolume HFS + MacSX / dev / disk0s3
This is for those who understand the information after the first command, if in doubt, you can check at this stage if everything is in order:
Finally, we enter:
diskutil mergePartitions HFS + 'Macintosh HD' / dev / disk0s2 / dev / disk0s3
That’s it, we wait and check, if all the section names were entered correctly, it should be completed successfully.
But still, for the sake of interest, let’s return to the option through formatting. On older versions of Mac, you can do this through Disk Utility. There you need to select a disk, and click Partition.
Click on the [ + ] sign to add a new partition. By clicking on “Current” we can choose how many partitions we want to see on the disk, decide for yourself whether you need to partition the disk on a Mac (additionally or in general).
We configure all the parameters, the number of sections and format them.
If you need to resize a partition on Mac OS without full formatting or deleting the partition, use iPartition.