How to merge two partitions on external hard drive when the “partition” option is greyed out

disk-utilityexternal-diskhard drivehigh sierrapartition

I have an external hard drive that is connected to my computer by a SATA/eSATA cable. Diskutility recognizes the hard drive as two separate drives as shown in the following two images:

mac_screenshot_1

mac_screenshot_2

I can't seem to merge the two partitions (MacBackup & MacBackup2) together because the "Partition" option is greyed out. How do I fix this?

Best Answer

To elaborate the answer by @klanomath this is what you must do step-by-step:

  1. get the disk identifier for both disks you want to merge by "diskutil list [disk name]". Choose any of the two disk names, like:

     diskutil list MacBackup
    

This returns something like

   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:     FDisk_partition_scheme                        *320.1 GB   disk3
   1:                 DOS_FAT_32 MULTIMEDIA              160.0 GB   disk3s1
   2:                  Apple_HFS TIMEMACHINE             160.0 GB   disk3s2

In the IDENTIFIER column, get the disk identifiers for both disks, here: disk3s1 and disk3s2

  1. merge the two disk partitions by "mergePartitions [format] [new disk name][disk identifier 1] [disk identifier 2]". If you want to use the "MacBackup3", you would then enter:

    diskutil mergePartitions JHFS+ MyMedia disk3s1 disk3s2
    

The first disk [disk identifier 1] is the only one that diskutil tries to preserve the data for. If it can't because the disk has no resizable data format, it will give a warning message:

The chosen disk does not support resizing.
Do you wish to format instead? (y/N)

Caution! If you enter "y", your data on [disk identifier 1] will be deleted. This is the last chance to abort by "N". If you have backed up the data, you can go on with "y" - your disk partitions will be merged.