How to use internal HDD as a file sharing drive if I boot from external SSD on mac mini?
Thanks to a comment from @benwiggy I was able to solve my problem. Appears you need to explicitly unmount the disk before partitioning it. Not sure why it was mounted anyway. In any case, after unmounting with
&gt; diskutil unmountDisk force /Volumes/my_disk_name

Partitioning went without error.