Skip to content
This repository has been archived by the owner on Dec 12, 2023. It is now read-only.

After APFS to HFS Conversion via script will casue Imagr to hang #204

Open
killer23d opened this issue Mar 6, 2018 · 9 comments
Open

After APFS to HFS Conversion via script will casue Imagr to hang #204

killer23d opened this issue Mar 6, 2018 · 9 comments

Comments

@killer23d
Copy link

killer23d commented Mar 6, 2018

I use a simple script like this to nuke all the partitions as I need HFS+ instead of APFS on all my Macs:

#!/bin/bash
#Quick Format /dev/disk0
#March 6, 2018

#Unmount and Nuke
diskutil unmountdisk /dev/disk0
sleep 2
dd if=dev/zero of=/dev/disk0 bs=512 count=1
sleep 3

#Partition HDD to HFS+
diskutil partitiondisk /dev/disk0 GPT JHFS+ Macintosh\ HD 100

exit 0

This script is set to autorun and it seems after the conversion (re-partition), Imagr will not prompt for completion of this workflow and I have to restart to start the Startoinstall workflow.

Using Terminal, I can confirm the partition scheme is HFS+, and Imagr cannot seems to detect the change.

The netboot image is created with the "make nbi" in the Wiki and nothing has been modified.

I noticed Imagr will only hang if the original file system is APFS, this issue does not happen if it is HFS+.

@grahamgilbert
Copy link
Collaborator

Why are you using this script over the built in partition and format tasks?

@grahamgilbert
Copy link
Collaborator

I would assume this is because you are yanking our the volume from under imagr. We only scan for volumes once per run as it is an expensive operation.

@killer23d
Copy link
Author

10.13.x has introduced some issues particularly with File Vault and User Approved MDM Enrollment on APFS volumes. We decided to stick with HFS for now.

I manage a fleet of garden variety of Macs that has APFS, HFS and CoreStorage. I've tried to use the "partition" and "format" option in Imagr and it doesn't seems to work reliability on CoreStorage or APFS volumes.

All the Macs that we circulate will needed to be wiped and I chose a "nuclear" (DD) approach because diskutil can't partition when there is a CoreStorage or APFS volume on the drive. DD is the easiest and quickest way to nuke everything.

We are using JAMF for most things and I am testing Imagr to mass deploy 10.13 only.

However, what I find interesting is that my current workflow (dd -> partition -> startoinstall) works fine on HFS volumes; just APFS will cause it to hang.

Without adding more work on your end, maybe if there is a menu option or terminal command that I can force quit and re-launch Imagr without restarting?

@grahamgilbert
Copy link
Collaborator

Split your config into two workflows. This will cause the volumes to be reloaded.

@killer23d
Copy link
Author

Correct, I have 2 workflows for my process. Imagr hangs and will not reload if the drive is repartition from APFS to HFS. If the starting FS is HFS, then it will re-partition and I get a prompt for completion and can start another workflow.

  1. Run the nuke script (auto run)
  2. Startoinstall

@grahamgilbert
Copy link
Collaborator

I’m afraid I don’t follow. The disk discovery code runs when workflows are loaded. This happens when a workflow finishes, the app starts or “reload config” is clicked. I was suggesting using two workflows to force this code path to be taken.

@killer23d
Copy link
Author

killer23d commented Mar 6, 2018

I have 2 workflows, the first one is the script on post 1; second one is to initiate startoinstall.

It seems that when the script finished running, all options in Imagr are greyed out. While I can see the "Choose Target" is refreshed with the new volume name, the prompt to start another workflow/Restart/Shutdown does not show up. The only thing I can do is restart and netboot again.

I've attached the config file and you can see what I mean.

imagr_config.plist.txt

I can confirm the script completed successfully as the drive is on HFS+ and is clean.

Attached is the screenshot of a machine I just tested. Imagr options are all grey out and the prompt is missing.
img_1364

@killer23d
Copy link
Author

Another reason why I use a script to wipe is that all my Macs have FileVault enabled. Imagr cannot see the volume until I mount it in Disk Utility.

@fpiesche
Copy link

fpiesche commented Jul 24, 2018

I'm running into the same issue. In my case I'm using workflows consisting only of a script each to wipe the drive to APFS/HFS+ and separate workflows to deploy macOS 10.12, 10.13 or 10.14 because the Mac is running off a Fusion Drive, which Imagr cannot repartition normally.

I'm attaching my config. This works in general, except sometimes (though not every time) Imagr gets "stuck" in the same state as shown in the screenshot above by @killer23d when running the "Partition: HFS+" workflow. The disk wipe has indeed completed successfully at this point - if I Command+Q Imagr, restart it and run one of the imaging workflows with HFS+ images, everything is exactly as it should be.
imagr_config_autoimagrnbi.txt

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants