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

tinygoblin

macrumors regular
Original poster
Feb 20, 2022
121
33
I had to erase my MBP's internal hard drive recently and reinstall macOS from external bootable USB flash drive I prepaired using createinstallmedia command in Terminal. However my partition scheme of internal APFS synthesized volume had changed upon installation succeeded: Macintosh HD volume is now mounted at the very end at disk1s5 instead of disk1s1.

Please help me to get Macintosh HD back to disk1s1 in both regular macOS boot and in Recovery because that's what I'm used to.

Here's output of diskutil list before erasing internal drive:
Code:
diskutil list
/dev/disk0 (internal, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *1.0 TB     disk0
   1:                        EFI EFI                     314.6 MB   disk0s1
   2:                 Apple_APFS Container disk1         1.0 TB     disk0s2

/dev/disk1 (synthesized):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      APFS Container Scheme -                      +1.0 TB     disk1
                                 Physical Store disk0s2
   1:                APFS Volume Macintosh HD            15.4 GB    disk1s1
   2:                APFS Volume Macintosh HD - Data     4.4 GB     disk1s2
   3:                APFS Volume Preboot                 452.2 MB   disk1s3
   4:                APFS Volume Recovery                685.5 MB   disk1s4
   5:                APFS Volume VM                      20.5 KB    disk1s5

Here's output of diskutil list after fresh installation of macOS (I have tried Big Sur 11.6.1 & 11.6.5):
Code:
diskutil list
/dev/disk0 (internal, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *1.0 TB     disk0
   1:                        EFI EFI                     314.6 MB   disk0s1
   2:                 Apple_APFS Container disk1         1.0 TB     disk0s2

/dev/disk1 (synthesized):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      APFS Container Scheme -                      +1.0 TB     disk1
                                 Physical Store disk0s2
   1:                APFS Volume Macintosh HD - Data     2.7 GB     disk1s1
   2:                APFS Volume Preboot                 284.2 MB   disk1s2
   3:                APFS Volume Recovery                626.3 MB   disk1s3
   4:                APFS Volume VM                      20.5 KB    disk1s4
   5:                APFS Volume Macintosh HD            15.3 GB    disk1s5
 
Well I've got a copy of macOS running on external drive so it should make things easier... May I ask you to drop a general idea what the process looks like? I guess all I have to do is edit "APFS Container Scheme" of "Container disk 1" and I even shouldn't have to touch Volume Group of Macintosh HD. Just not sure how to do it. On a side note, no create volume for APFS container is in diskutil man.
 
Last edited:
Why not? It's just a computer not a holy grail. And I'm not afraid to break something, currently macOS installation contains no data and can be reinstalled easily.

Here's data on APFS Container:
Code:
diskutil apfs list
APFS Container (1 found)
|
+-- Container disk1 10FCC4F5-6143-41E5-9F74-AD9A76AC42EF
    ====================================================
    APFS Container Reference:     disk1
    Size (Capacity Ceiling):      1000240963584 B (1.0 TB)
    Capacity In Use By Volumes:   18980200448 B (19.0 GB) (1.9% used)
    Capacity Not Allocated:       981260763136 B (981.3 GB) (98.1% free)
    |
    +-< Physical Store disk0s2 54848ECD-A4D2-4BDF-A539-6CAB47645CCF
    |   -----------------------------------------------------------
    |   APFS Physical Store Disk:   disk0s2
    |   Size:                       1000240963584 B (1.0 TB)
    |
    +-> Volume disk1s1 07781674-7D00-4803-8FB9-2109E944DDDD
    |   ---------------------------------------------------
    |   APFS Volume Disk (Role):   disk1s1 (Data)
    |   Name:                      Macintosh HD - Data (Case-insensitive)
    |   Mount Point:               /System/Volumes/Data
    |   Capacity Consumed:         2529787904 B (2.5 GB)
    |   Sealed:                    No
    |   FileVault:                 No (Encrypted at rest)
    |
    +-> Volume disk1s2 AB82B314-D19E-4E84-837B-EB188E4B5B3F
    |   ---------------------------------------------------
    |   APFS Volume Disk (Role):   disk1s2 (Preboot)
    |   Name:                      Preboot (Case-insensitive)
    |   Mount Point:               /System/Volumes/Preboot
    |   Capacity Consumed:         284155904 B (284.2 MB)
    |   Sealed:                    No
    |   FileVault:                 No
    |
    +-> Volume disk1s3 F7584C45-59AD-4B37-8897-C21D40B0C7A9
    |   ---------------------------------------------------
    |   APFS Volume Disk (Role):   disk1s3 (Recovery)
    |   Name:                      Recovery (Case-insensitive)
    |   Mount Point:               Not Mounted
    |   Capacity Consumed:         626294784 B (626.3 MB)
    |   Sealed:                    No
    |   FileVault:                 No
    |
    +-> Volume disk1s4 6DDAC30E-71D5-4C75-8F04-9F0B6F4296C5
    |   ---------------------------------------------------
    |   APFS Volume Disk (Role):   disk1s4 (VM)
    |   Name:                      VM (Case-insensitive)
    |   Mount Point:               /System/Volumes/VM
    |   Capacity Consumed:         20480 B (20.5 KB)
    |   Sealed:                    No
    |   FileVault:                 No
    |
    +-> Volume disk1s5 C9027495-7A11-4921-A0D2-0668E7ABE28C
        ---------------------------------------------------
        APFS Volume Disk (Role):   disk1s5 (System)
        Name:                      Macintosh HD (Case-insensitive)
        Mount Point:               Not Mounted
        Capacity Consumed:         15331536896 B (15.3 GB)
        Sealed:                    Broken
        FileVault:                 No (Encrypted at rest)
        |
        Snapshot:                  3E13A161-7421-48DE-8CA1-47FB0C581DC5
        Snapshot Disk:             disk1s5s1
        Snapshot Mount Point:      /
        Snapshot Sealed:           Yes
 
I've stumbled upon a thread where OP managed to get Macintosh HD from disk1s5 to disk1s1 by re-doing USB installer, reformatting internal SSD and reinstalling macOS:
0986a676-9bb7-4ccb-8e9d-d0181503ab18-jpeg.905302

image-jpg.905320

This is an option to get where I want however there's not enough info from OP
 
I wouldn’t be surprised if the mount points could change from boot to boot. The numbers are probably assigned at boot time in the order in which the volumes are mounted. And while it seems that the order would be the same every time, it might not be so.
 
  • Like
Reactions: NoBoMac
I feel this is not the case, I've never seen this switch on it's own. In the meanwhile I've found this GitHub Gist article describing cloning APFS Container from one disk to another using
Code:
sudo asr restore
command on a APFS container (you get a bootable macOS clone once done). In the example provided in article system HD (Macintosh HD) gets from disk1s5 to disk1s2 on the clone destination drive. I'll be trying this tomorrow, I believe that may be something what Apple uses at the factory. Luckily I've got the means...
 
Last edited:
depending on the drives mounted, the output using the
Code:
mount
Terminal command could change.

If you've used the
Code:
diskutil apfs deletecontainer disk
followed by your macOS installation drive number
disk1 or disk3, then you really should be back to having a, for you, better layout.

Code:
allannyholm@Allans-iMac ~ % mount
/dev/disk3s5s1 on / (apfs, sealed, local, read-only, journaled)
devfs on /dev (devfs, local, nobrowse)
/dev/disk3s4 on /System/Volumes/VM (apfs, local, noexec, journaled, noatime, nobrowse)
/dev/disk3s2 on /System/Volumes/Preboot (apfs, local, journaled, nobrowse)
/dev/disk3s6 on /System/Volumes/Update (apfs, local, journaled, nobrowse)
/dev/disk3s1 on /System/Volumes/Data (apfs, local, journaled, nobrowse)
map auto_home on /System/Volumes/Data/home (autofs, automounted, nobrowse)
/dev/disk1s2 on /Volumes/Macintosh HD (apfs, local, journaled)

I use the mount command to determine what disk number my system has when I replace system level files; icons and other items.

My system looks like this - and I haven't been bothered by it.

Code:
/dev/disk3 (synthesized):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      APFS Container Scheme -                      +999.9 GB   disk3
                                 Physical Store disk2s2
   1:                APFS Volume ⁨Macintosh SSD - Data⁩    325.2 GB   disk3s1
   2:                APFS Volume ⁨Preboot⁩                 267.2 MB   disk3s2
   3:                APFS Volume ⁨Recovery⁩                1.1 GB     disk3s3
   4:                APFS Volume ⁨VM⁩                      1.1 MB     disk3s4
   5:                APFS Volume ⁨Macintosh SSD⁩           15.2 GB    disk3s5
   6:              APFS Snapshot ⁨com.apple.os.update-...⁩ 15.2 GB    disk3s5s1
 
If you've used the
Code:
diskutil apfs deletecontainer disk
followed by your macOS installation drive number
disk1 or disk3, then you really should be back to having a, for you, better layout.
I'm familiar with mount, it's quite similar to diskutil mount, thanks. To my knowledge using diskutil apfs deletecontainer commandis essentially what's done when you erase internal drive in Recovery (I mean the drive as a device, first you enable it in View in Disk Utility): absolutely no APFS partitions on disk0 as a result.
 
Last edited:
Here is a good article about macOS disk structure at Eclectic Light.


The last paragraph is instructive.

One final note about Unix volume naming: these aren’t fixed. The names I have given above are those you should expect to see in macOS when volumes haven’t been deleted or recreated. If in the process of performing a clean re-install you delete the Data volume, then you should expect the different volumes within that container to end up with different Unix names from those shown. This shouldn’t make any difference, unless you or a script expects to find the Data volume at disk1s2. And that would be extremely bad practice.
 
Thanks for the article link and the extraction from it. This makes it clear someone shouldn't expect Macintosh HD (or any other volume) to switch slice (disk1s5 to disk1s1, etc.) inside APFS Container on it's own (after multiple reboots) without user/system interaction.

The good news is David Anderson at Stack Exchange / Ask Different was kind enough to take time and experiment with Disk Utility on the issue. It turns out that restoring an installer-created APFS Container (with "Macintosh HD" at disk1s5) using Disk Utility to an empty APFS Container is likely a method used at the factory since it provides the result I'm after (factory APFS Container layout with "Macintosh HD" at disk1s1 and "Macintosh HD - Data" at disk1s2 of APFS Container). It is likely Disk Utility Restore uses "asr restore" command mentioned in GitHub Gist but I'm yet to try it out. Here's a link to David Anderson's valuable answer.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.