2

Edit

I could find a solution to how recreate a fusion drive and a "Macintosh HD" volume so that OS X can be reinstalled. I suggest to people facing similar issue to simply read the answer that I posted to my own question, which will provide them a step by step procedure.


I need to reinstall MacOS X Mojave on an iMac iMac 27'' 2019 (A2115 EMC 3194).

Because of corrupted fusion data structures, the fusion drive was not visible from the installer, so that I had to reset the SSD and HDD:

  • dd if=/dev/zero of=/dev/disk0 (fully wipes the SSD)
  • dd if=/dev/zero of=/dev/disk1 count=1 (wipes MBR of HDD)

Above commands made both drives visible from the Disk Utility. (They were previously hidden by the Fusion drive container.) Then, from the Disk Utility, the two drives were erased and formatted in APFS, with GPT partition scheme.

Strangely, diskutil resetFusion detects the logical volumes from the SSD and HDD but is unable to detect the solid state drive as a physical drive. (The order of disks is inverted here, but we see that the disk1 of the SSD is not listed.)

-bash-3.2# diskutil resetFusion

Internally-located hardware disk device known to the currently-running macOS:
Rotational                               (disk0)

Volumes exported by partitions or storage systems hosted on the above device:
SSD SM0032L                              (disk3s1)
HDD ST1000DM003                          (disk4s1)

Your computer must have exactly 1 solid-state and 1 rotational disk drive

How to fuse the APFS partitions ? Here's the current scheme.

-bash-3.2# diskutil list
/dev/disk0 (internal, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *1.0 TB     disk0
   1:                        EFI EFI                     209.7 MB   disk0s1
   2:                 Apple_APFS Container disk4         1000.0 GB  disk0s2

/dev/disk1 (internal):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                         28.0 GB    disk1
   1:                        EFI EFI                     314.6 MB   disk1s1
   2:                 Apple_APFS Container disk3         27.7 GB    disk1s2

/dev/disk2 (disk image):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        +2.1 GB     disk2
   1:                  Apple_HFS macOS Base System       2.0 GB     disk2s1

/dev/disk3 (synthesized):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      APFS Container Scheme -                      +27.7 GB    disk3
                                 Physical Store disk1s2
   1:                APFS Volume SSD SM0032L             20.5 KB    disk3s1

/dev/disk4 (synthesized):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      APFS Container Scheme -                      +1000.0 GB  disk4
                                 Physical Store disk0s2
   1:                APFS Volume HDD ST1000DM003         20.5 KB    disk4s1
(...)

Should I use logical volume commands, delete the synthetized volumes of disks 3 and 4 and then create from the command line the volume of disk3 according to the original scheme here below?

I know how to use gpt commands to show and edit the gpt tables.

Here was the original situation:

-bash-3.2# diskutil list
/dev/disk0 (internal):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                         28.0 GB    disk0
   1:                        EFI EFI                     314.6 MB   disk0s1
   2:                 Apple_APFS Container disk3         27.7 GB    disk0s2

/dev/disk1 (internal, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *1.0 TB     disk1
   1:                        EFI EFI                     209.7 MB   disk1s1
   2:                 Apple_APFS Container disk3         1000.0 GB  disk1s2

/dev/disk2 (disk image):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        +2.1 GB     disk2
   1:                  Apple_HFS macOS Base System       2.0 GB     disk2s1

/dev/disk3 (synthesized):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      APFS Container Scheme -                      +1.0 TB     disk3
                                 Physical Stores disk0s2, disk1s2
   1:                APFS Volume Preboot                 185.9 MB   disk3s2
   2:                APFS Volume Recovery                510.6 MB   disk3s3
   3:                APFS Volume VM                      2.1 GB     disk3s4
   
(...)
3
  • Maybe should I use diskutil ap createContainer disk0s2,disk1s2 like suggested by klanomath's answer here? apple.stackexchange.com/questions/309739/… . Is it better to have the SSD as main and the HDD as secondary?
    – OuzoPower
    Commented Jun 6, 2023 at 11:20
  • TBH, I'd just get an external 1TB SSD and run off that. Fusion Drives are double the weakness, and IME they get slower as the volume fills. A USB 3 or TB SSD will be faster.
    – benwiggy
    Commented Jun 6, 2023 at 13:31
  • I agree, but it is for a customer and the amount of user data is tiny (~5 GB). The use seems casual. Even the small 32GB SSD would suffice. There is always some (small) risk of damages when opening the machine that I prefer to avoid in this case. I found a solution to recreate the fusion drive (see my answer below). The only remaining problem is that the installer does not list the fusion drive.
    – OuzoPower
    Commented Jun 6, 2023 at 13:47

1 Answer 1

1

After a lot of trial and error, I found how to create the fusion drive. To allow the reinstallation of Mac OS X, it is also necessary to create a "Macintosh HD" volume afterwards.

Here are the steps:

  1. Go in the Disk Utility
  2. Erase each of the two drives and select APFS with GPT partitioning scheme
  3. Leave the GUI, go in the Terminal and enter diskutil list.
  4. Delete APFS containers on disk0s2 and disk1s2 that the Disk Utility may have created automatically on those partitions. Typically, see if there are containers created for disk3, disk4, or disk23, that point to either disk0s2 or disk1s2. Existing containers are deleted by diskutil apfs deletecontainer disk0s2 and diskutil apfs deletecontainer disk1s2.
  5. Create the new container that will be the Fusion drive: diskutil ap createContainer -main disk0s2 -secondary disk1s2. (Specifying -main and -secondary flags is optional.)
  6. Not necessary, but if you type diskutil resetFusion, this seems having effect of naming your volume as "Fusion drive" in Disk utility.
  7. Important: Lastly, enter diskutil ap addVolume disk3 APFS "Macintosh HD". If you don't have a "Macintosh HD" volume, the installer of OS X Mojave (or else version) won't see any disk and you won't be able to install the operating system.

What follows was solved thanks to David Anderson's comment. The procedure here above was updated accordingly:

However, there is still a major bug that currently prevents me reinstalling Mojave: Although the Fusion drive is correclty viewed from diskutil list in the Terminal, as well as by the disk utility, the Mojave installer doesn't list any drive where to install OS X (i.e. it does not see the fusion drive).

5
  • Why not use diskutil ap create disk0s2 disk1s2 "Macintosh HD" in place of diskutil ap createContainer disk0s2 disk1s2? Or, use diskutil ap addVolume disk3 APFS "Macintosh HD" after entering diskutil ap createContainer disk0s2 disk1s2? Commented Jun 6, 2023 at 15:23
  • 1
    Thank you David, you're the king! Two nights ago, I also had the inspiration that the Mac could be expecting some "Macintosh HD" 'label' to see the fusion drive. So, although the Mac I already had split the fusion and installed the OS on the SSD, I decided to build the fusion drive again. After booting the SSD was disk1 and the HDD disk 0 for this time, so I decided to explicitely specify '-main' and '-secondary', to ensure the SSD comes as main. It was not working if specifying "Macintosh HD" after the two disks. So, I used the second alternative you mentioned. And the install works!
    – OuzoPower
    Commented Jun 8, 2023 at 17:53
  • You should update your answer to explain what worked. Also, you should accept your answer so others know a solution was found. I am not sure if you can do this now or if you will have to wait till later to accept. Commented Jun 8, 2023 at 18:01
  • 1
    I was updating my answer whilst you commented. Also edited my original post, and could accept my answer. The only thing that I could not do is voting up my answer instead of the original post.
    – OuzoPower
    Commented Jun 8, 2023 at 18:26
  • Thank you! This worked for me, finally. Saved my mac mini setup. Just one thing, maybe it was a typo, but createContainer command did not take disk0s2, I have to use the disk0 or disk4 only
    – odedia
    Commented Oct 4, 2023 at 0:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .