corpnewt / gibMacOS

Py2/py3 script that can download macOS components direct from Apple
MIT License
5.85k stars 775 forks source link

stuck on "diskpart create partition primary id=xx" #272

Open NoNameJe opened 1 year ago

NoNameJe commented 1 year ago

Please change code MakeInstall.py 270 line
print("Using GPT...") print(self.hfs_id) dp_script = "\n".join([ "select disk {}".format(disk.get("index",-1)), "clean", "convert mbr", #please first convert to another "convert gpt", # sencondy convert to gpt Because this will not stop on error "create partition primary size=200", "format quick fs=fat32 label='BOOT'", "create partition primary noerr", #without id=xxx "select partition 2", "set id={} override noerr".format(self.hfs_id) # set id ]) If the disk is already gpt , "convert gpt" will return error,so first convert to mbr

corpnewt commented 1 year ago

Hey there - thanks for this. I may take some time to see if I can detect if the disk is MBR or GPT before building the diskpart command script to avoid having to convert twice.

-CorpNewt

Masamune3210 commented 1 year ago

If you do a list disk in diskpart, it shows which ones are gpt vs mbr in its own column, you could scrape that probably, but I'm sure there is a more programmatic way to ask the system