Can anyone tell me the command to format iMac for APFS?

Discussion in 'iMac' started by Spudner, Jun 8, 2019.

  1. Spudner, Jun 8, 2019
    Last edited: Jun 8, 2019

    Spudner macrumors member

    Spudner

    Joined:
    Aug 13, 2018
    Location:
    Canada
    #1
    I get the error message "Could not create a Preboot Volume for APFS install" when trying to format drive and reinstall Mac OS on iMac 12,2. Here is the diskutil list. Any advice on a command line? Sorry, I don't know quite how to interpret the diskutil list in order to formulate a working command.

    Attached is my DiskUtil List.
     

    Attached Files:

  2. nambuccaheadsau macrumors 68000

    nambuccaheadsau

    Joined:
    Oct 19, 2007
    Location:
    Nambucca Heads Australia
    #2
    Have you downloaded the OS, Mojave etc., burnt it tio an 8GB+ thumb drive using sayt Diskmaker X for the appropriate OS, and booted from the thumb drive? What sort of hard drive are you trying to format APFS?
     
  3. Spudner, Jun 8, 2019
    Last edited: Jun 8, 2019

    Spudner thread starter macrumors member

    Spudner

    Joined:
    Aug 13, 2018
    Location:
    Canada
    #3
    No, I went to reinstall with High Sierra on a flash drive. I tried this and got the above error. The hard drive is a 1TB HDD.
     
  4. casperes1996 macrumors 68040

    casperes1996

    Joined:
    Jan 26, 2014
    Location:
    Horsens, Denmark
    #4
    You should not be using APFS with an HDD on high Sierra anyway. Stick to hfs+. It’ll perform better on an hdd
     
  5. chabig macrumors 603

    Joined:
    Sep 6, 2002
    #5
    Avoid the command line. Use Disk Utiity. It’s much easier.
     
  6. Spudner thread starter macrumors member

    Spudner

    Joined:
    Aug 13, 2018
    Location:
    Canada
    #6
    I get errors going through Disk Utility.
    --- Post Merged, Jun 8, 2019 ---
    OK, no problem. But what would be the command line for it?
     
  7. chrfr macrumors 604

    Joined:
    Jul 11, 2009
    #7
    What is the error you get through Disk Utility? It’s probably related to the other problems.
     
  8. casperes1996 macrumors 68040

    casperes1996

    Joined:
    Jan 26, 2014
    Location:
    Horsens, Denmark
    #8
    diskutil apfs create /dev/diskID "new drive name".

    But again, stick to HFS+. There's a reason APFS isn't automatically converted onto HDDs with HS, and it took until Mojave to even get Fusion support for APFS. - The way data management is handled with APFS can create a damn lot of fragmentation of data, which will destroy performance of spinning drives - it's not really an issue with SSDs, but for HDDs performance tanks. - Newer revisions of APFS in the later operating systems treat HDDs and SSDs differently, but APFS under HS does not.
     
  9. Spudner, Jun 8, 2019
    Last edited: Jun 8, 2019

    Spudner thread starter macrumors member

    Spudner

    Joined:
    Aug 13, 2018
    Location:
    Canada
    #9
    OK, so would it would be this then:

    diskutil HFS+ create /dev/diskID "new drive name"

    For new drive name, can I put anything (with quotation marks?)?
     
  10. casperes1996 macrumors 68040

    casperes1996

    Joined:
    Jan 26, 2014
    Location:
    Horsens, Denmark
    #10
    No. diskutil apfs is not the format for diskutil. It's a whole mode for diskutil to operate in. Formatting with HFS+ does not use the same syntax, it uses the classical formatting method.
    That syntax is
    diskutil eraseDisk JHFS+ "Name of Disk" diskID

    But you should be able to just use Disk Utility.
     
  11. chabig macrumors 603

    Joined:
    Sep 6, 2002
    #11
    Since Disk Utility is just a GUI front end for the command line tools, the command line probably won’t work either.

    I think you probably have hosed things to the point that it’s not repairable. You ought to be able to start over with Disk Utility by partitioning the disk. That should wipe out all of the data structures below the partition table.
     
  12. Spudner thread starter macrumors member

    Spudner

    Joined:
    Aug 13, 2018
    Location:
    Canada
    #12
    But my problem is that I don't know whcih disk name to put. (see above screenshot)
     
  13. Fishrrman macrumors P6

    Fishrrman

    Joined:
    Feb 20, 2009
    #13
    "Attached is my DiskUtil List."

    YIPES.

    With "a list" like that, it's time to nuke the drive and start over.

    Suggestion:
    THE FOLLOWING WILL ERASE THE DRIVE AND EVERYTHING ON IT.

    1. Power down
    2. Insert flashdrive installer into a USB port
    3. Press the power on button and immediately hold down the option key until the startup manager appears
    4. Select the flashdrive installer with the pointer and hit return.
    5. If it opens to the OS installer, QUIT IT and go back to the utilities menu.
    6. Open Disk Utility
    7. Select the topmost icon that represents your PHYSICAL internal drive
    8. Click the erase button. You want "Mac OS extended with journaling enabled, GUID partition format".
    9. Give the drive any name you want. My suggestion, keep it simple.
    10. Once the erase is done, I suggest you click the "First aid" button.
    11. Run the first aid/repair disk function. Do you get a "good report"?
    12. If you DO, REPEAT the repair disk function FIVE TIMES IN A ROW.
    13. Do you get a good report every time?
    If so, time to move on to the next step.
    14. Quit Disk Utility and open the OS installer
    15. Aim the installer at the internal drive and let it go.
    Does this work?
     
  14. chrfr macrumors 604

    Joined:
    Jul 11, 2009
    #14
    That’s normal when booted to recovery, or at least internet recovery. My fully functional Air running 10.14.5 with a FileVault encrypted SSD reports all those untitled disks as well.
     
  15. casperes1996 macrumors 68040

    casperes1996

    Joined:
    Jan 26, 2014
    Location:
    Horsens, Denmark
    #15
    First try doing it through Disk Utility. Not just a volume erase, but a drive erase or repartitioning.
    In the View menu, make sure "Show all devices" or whatever it's called, and not just "Show Volumes" is selected.
    Pick your drive and then run either Erase or Partition. With HFS+ with journaling.

    But to answer your question, if the diskutil list outputs the same for disk 0 when you're about to run the diskutil eraseDisk command, it's disk0. But beware that the ordering is not fixed. It's disk0 on your screenshot, but depending on which order the motherboard initialises the drives, this ordering can change. So run list again before eraseDisk, and find one that matches disk0 in your screenshot.
     
  16. mmomega macrumors 68030

    mmomega

    Joined:
    Dec 30, 2009
    Location:
    DFW, TX
    #16
    boot from a USB disk.
    Then you can use terminal and disk utility to get things done.

    If I am formatting my drive. I will boot from the USB, once it gets to the point of asking me to reinstall, time machine or diskutilty, I choose Terminal from the menu bar.

    In Terminal I'll do "diskutil erasedisk HFS+ Untitled /dev/disk0"

    This command will format your main disk to "Mac OS extended journaled" and name the drive Untitled.
    If you want it to be APFS just change to "diskutil erasedisk APFS Untitled /dev/disk0"

    This is a format though = everything will be erased from the main disk drive almost immediately after hitting the Enter Key.
     
  17. mikehalloran macrumors 65816

    Joined:
    Oct 14, 2018
    Location:
    The Sillie Con Valley
    #17
    You can’t format an HDD to APFS in the shipping version of High Sierra. It was only an option during beta where it caused a lot of problems. High Sierra runs fine on an HDD though some of its features are unavailable.

    A 12.1 iMac is a 2011. It won’t run Mojave with the stock GPU.

    Install an SSD. This will improve the performance and is easy on a 2011.
     

Share This Page

16 June 8, 2019