You are not logged in.

Announcement

[2017.09.08] DeployStudio build v1.7.8 (checksum, release note).
[2016.08.26] DeployStudio build v1.6.19 (release note).
[2013.02.23] DeployStudio last universal build v1.5.17 (release note).

#1 2018-01-08 11:14:56

carlocarlo
Member
Registered: 2011-02-04

Revert back to HFS+ from APFS before deploying image

Hello, what is the smarter way to revert back to Apple's HFS+ from APFS in DeployStudio when downgrading from APFS HS to HFS 10.12?
My current workflow with DS 1.7.8 runtime (10.2.6 HFS) wait for user selection to partition the drive + allocate space for Recovery partition then automatically deploy the image on the first available disk.
When already formatted with APFS, I can see two identifier (/dev/disk1 and /dev/disk2) but partitioning from DS does not correctly work.
Usually I have to run the whole workflow twice so that the second time the disk is being correctly formatted with HFS+
Is it because I am supposed to work with a 10.13 runtime to correctly manage (and delete) APFS?
How can I automatically delete the APFS container?
Many thanks for your help
Carlo

Offline

#2 2018-01-18 15:27:05

Joon
Member
Registered: 2012-02-15

Re: Revert back to HFS+ from APFS before deploying image

Hi Carlo,

There is no built in way for deploystudio to handle this for you, you will have to use a script to clear the disk.

While Sierra has trouble dealing with APFS, it can actually remove containers via the terminal, so a bash script could handle this for you before you reach the partition workflow step.

diskutil apfs list
to list the containers, take the UUID of the first container.

diskutil apfs deleteContainer UUID
to delete the apfs container, after this DS can repartition the disk without issue.

Of course this isn't a script but it may help you create one using this as a starting point to do so.

You could also use the nuclear option by using:
dd if=/dev/disk0 of=/dev/zero bs=1k count=1k

disk0 will be the disk that'll be cleared by this, this will remove the complete partition table and after that 10.12 will have no issue creating a partition on the disk.

Offline

#3 2018-01-18 16:23:21

carlocarlo
Member
Registered: 2011-02-04

Re: Revert back to HFS+ from APFS before deploying image

Hello Joon many thanks for your reply
I ended up creating a script within a workflow that only formats the disk back to HFS+
Once the workflow ends, I simply choose one of the other usual workflows....

#!/bin/bash
convertDisk=$(diskutil list internal | grep -B 2 "APFS Container Scheme" | grep /dev | awk '{print $1}')
diskutil apfs deleteContainer "$convertDisk"
diskutil eraseDisk JHFS+ "Hard Disk" /dev/disk0
exit

I used "Hard Disk" (between quotes) to name the disk
Hope this helps someone with the same need
Ciao
Carlo

Offline

Board footer

Powered by FluxBB