Skip to main content
Question

partitioning post image: script not working

  • January 14, 2020
  • 4 replies
  • 25 views

Forum|alt.badge.img+4

Hi Nation,

I took the script from @mvught from here and changed it a bit, see below. The idea is to delete the recovery partition and merge it with the main partition.

When I run it 'after', it doesn't work, when I run it on 'reboot', it works perfectly.

any ideas?

#Find the boot partition and recovery partition
main=$(diskutil list internal | grep Apple_HFS | grep -v Data | grep -v iMac2 | awk '{print ($6)}');
recovery=$(diskutil list | grep "Recovery HD" |awk '{print ($7)}');

#This will merge the two partitions, with Apple_HFS absorbing the space from Recovery HD and expanding, it causes no data loss on the Apple_HFS disk.
sudo diskutil eraseVolume JHFS+ Blank $recovery ;
sudo diskutil mergePartitions JHFS+ iMac $main $recovery ;

thanks

4 replies

mvught
Forum|alt.badge.img+9
  • Contributor
  • January 14, 2020

Hello AdvancedNoob,

Does it work if you run this in the terminal? Step by step?


Forum|alt.badge.img+4
  • Author
  • Contributor
  • January 14, 2020

hi @mvught , yes it does. I ran it from netboot and on local machine without any problem. Not too sure why it doesn't work when set to 'after' on imaging.


mvught
Forum|alt.badge.img+9
  • Contributor
  • January 14, 2020

Ok, what do you use for imaging? What is your work process.
Do you still use casper imaging or how do you run it?


Forum|alt.badge.img+4
  • Author
  • Contributor
  • January 14, 2020

yes, I use casper/jamf imaging,

create dmg with autodmg, add admin with createuserpkg
wack the result in Jamf admin

usual stuff really it seems

as I say it works when set on 'reboot' which is rather odd