Skip to content

Instantly share code, notes, and snippets.

@papapana
Forked from cetinajero/macos_boot_keys.md
Created October 30, 2021 21:25
Show Gist options
  • Select an option

  • Save papapana/e519c0c25719a7b851c9dda454eaf54f to your computer and use it in GitHub Desktop.

Select an option

Save papapana/e519c0c25719a7b851c9dda454eaf54f to your computer and use it in GitHub Desktop.

Revisions

  1. @cetinajero cetinajero revised this gist Aug 8, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion macos_boot_keys.md
    Original file line number Diff line number Diff line change
    @@ -106,7 +106,7 @@ hdiutil mount ~/Downloads/Win10_2004_Spanish\(Mexico\)_x64.iso -mountpoint /Volu
    Validate if the install.wim file is greater than 4GiB minus 1 byte

    ```bash
    if ((`wc -c</Volumes/ISO/sources/install.wim`>2**32-1));then echo Exceeds;fi
    if (( `wc -c</Volumes/ISO/sources/install.wim` > 2**32-1 )) ; then echo Exceeds ; fi
    ```

    Copy the small ISO files to the USB
  2. @cetinajero cetinajero revised this gist Aug 8, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion macos_boot_keys.md
    Original file line number Diff line number Diff line change
    @@ -100,7 +100,7 @@ echo -e "DEFAULT boot\n\nLABEL boot\n\tMENU LABEL boot\n\tCOM32 chain.c32\n\tAPP
    Mount the ISO

    ```bash
    hdiutil mount ~/Downloads/Win10_1909_Spanish\(Mexico\)_x64.iso -mountpoint /Volumes/ISO
    hdiutil mount ~/Downloads/Win10_2004_Spanish\(Mexico\)_x64.iso -mountpoint /Volumes/ISO
    ```

    Validate if the install.wim file is greater than 4GiB minus 1 byte
  3. @cetinajero cetinajero revised this gist Aug 8, 2020. 1 changed file with 6 additions and 0 deletions.
    6 changes: 6 additions & 0 deletions macos_boot_keys.md
    Original file line number Diff line number Diff line change
    @@ -103,6 +103,12 @@ Mount the ISO
    hdiutil mount ~/Downloads/Win10_1909_Spanish\(Mexico\)_x64.iso -mountpoint /Volumes/ISO
    ```

    Validate if the install.wim file is greater than 4GiB minus 1 byte

    ```bash
    if ((`wc -c</Volumes/ISO/sources/install.wim`>2**32-1));then echo Exceeds;fi
    ```

    Copy the small ISO files to the USB

    ```bash
  4. @cetinajero cetinajero revised this gist Aug 8, 2020. 1 changed file with 15 additions and 9 deletions.
    24 changes: 15 additions & 9 deletions macos_boot_keys.md
    Original file line number Diff line number Diff line change
    @@ -58,7 +58,7 @@ Format the USB
    diskutil list

    # diskutil partitionDisk MountPoint [numberOfPartitions] [APM|MBR|GPT] [part1Format[FAT32|ExFAT|JHFS+|APFS|...] part1Name part1Size[%|R] part2Format part2Name part2Size part3Format part3Name part3Size ...]
    diskutil partitionDisk /dev/disk2 1 MBR FAT32 W10_1909SPA R
    diskutil partitionDisk /dev/disk2 1 MBR FAT32 W10_2004X64 R
    ```

    Set the partition as active ([boot flag](https://en.wikipedia.org/wiki/Boot_flag))
    @@ -87,14 +87,14 @@ sudo ./syslinux-mac -i /dev/disk2s1
    Write the syslinux's modules (COM32 modules)

    ```bash
    mkdir /Volumes/W10_1909SPA/syslinux
    cp syslinux-4.07/com32/chain/chain.c32 /Volumes/W10_1909SPA/syslinux
    mkdir /Volumes/W10_2004X64/syslinux
    cp syslinux-4.07/com32/chain/chain.c32 /Volumes/W10_2004X64/syslinux
    ```

    Write the syslinux's config (syslinux.cfg)

    ```bash
    echo -e "DEFAULT boot\n\nLABEL boot\n\tMENU LABEL boot\n\tCOM32 chain.c32\n\tAPPEND fs ntldr=/bootmgr" > /Volumes/W10_1909SPA/syslinux/syslinux.cfg
    echo -e "DEFAULT boot\n\nLABEL boot\n\tMENU LABEL boot\n\tCOM32 chain.c32\n\tAPPEND fs ntldr=/bootmgr" > /Volumes/W10_2004X64/syslinux/syslinux.cfg
    ```

    Mount the ISO
    @@ -103,22 +103,28 @@ Mount the ISO
    hdiutil mount ~/Downloads/Win10_1909_Spanish\(Mexico\)_x64.iso -mountpoint /Volumes/ISO
    ```

    Copy the ISO files to the USB
    Copy the small ISO files to the USB

    ```bash
    rsync -avh --info=progress2 /Volumes/ISO/ /Volumes/W10_1909SPA/
    rsync -avh --info=progress2 --exclude=sources/install.wim /Volumes/ISO/ /Volumes/W10_2004X64/
    # or
    rsync -avh --progress /Volumes/ISO/ /Volumes/W10_1909SPA/
    rsync -avh --progress --exclude=sources/install.wim /Volumes/ISO/ /Volumes/W10_2004X64/
    # or
    cp -Rpv /Volumes/ISO/ /Volumes/W10_1909SPA/
    cp -Rpv /Volumes/ISO/ /Volumes/W10_2004X64/
    ```

    Copy the install.wim file to the USB in smaller parts

    ```bash
    wimlib-imagex split /Volumes/ISO/sources/install.wim /Volumes/W10_2004X64/sources/install.swm 3800
    ```

    Unmount the USB

    ```bash
    diskutil unmountDisk /dev/disk2
    # or
    hdiutil unmount /Volumes/W10_1909SPA/
    hdiutil unmount /Volumes/W10_2004X64/
    ```

    ## Configure Windows Installer to always ask for the version to install
  5. @cetinajero cetinajero revised this gist Jun 1, 2020. 1 changed file with 2 additions and 4 deletions.
    6 changes: 2 additions & 4 deletions macos_boot_keys.md
    Original file line number Diff line number Diff line change
    @@ -56,11 +56,9 @@ Format the USB

    ```bash
    diskutil list
    diskutil partitionDisk /dev/disk2 1 MBR FAT32 W10_1909SPA R

    # diskutil partitionDisk MountPoint [numberOfPartitions] [APM|MBR|GPT] [part1Format part1Name part1Size part2Format part2Name part2Size part3Format part3Name part3Size ...]

    # $ diskutil partitionDisk disk4 3 GPT JHFS+ Volume1 25% APFS Volume2 25% ExFAT Volume3 R
    # diskutil partitionDisk MountPoint [numberOfPartitions] [APM|MBR|GPT] [part1Format[FAT32|ExFAT|JHFS+|APFS|...] part1Name part1Size[%|R] part2Format part2Name part2Size part3Format part3Name part3Size ...]
    diskutil partitionDisk /dev/disk2 1 MBR FAT32 W10_1909SPA R
    ```

    Set the partition as active ([boot flag](https://en.wikipedia.org/wiki/Boot_flag))
  6. @cetinajero cetinajero revised this gist Jun 1, 2020. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions macos_boot_keys.md
    Original file line number Diff line number Diff line change
    @@ -57,6 +57,10 @@ Format the USB
    ```bash
    diskutil list
    diskutil partitionDisk /dev/disk2 1 MBR FAT32 W10_1909SPA R

    # diskutil partitionDisk MountPoint [numberOfPartitions] [APM|MBR|GPT] [part1Format part1Name part1Size part2Format part2Name part2Size part3Format part3Name part3Size ...]

    # $ diskutil partitionDisk disk4 3 GPT JHFS+ Volume1 25% APFS Volume2 25% ExFAT Volume3 R
    ```

    Set the partition as active ([boot flag](https://en.wikipedia.org/wiki/Boot_flag))
  7. @cetinajero cetinajero revised this gist May 2, 2020. 1 changed file with 1 addition and 4 deletions.
    5 changes: 1 addition & 4 deletions macos_boot_keys.md
    Original file line number Diff line number Diff line change
    @@ -35,10 +35,7 @@ An ISO with a `DOS/MBR` _boot sector_ is required.
    ```bash
    file ubuntu-20.04-desktop-amd64.iso
    sudo gdd if=ubuntu-20.04-desktop-amd64.iso of=/dev/disk2 bs=4096 status=progress

    iso_md5=$(md5 -q ubuntu-20.04-desktop-amd64.iso)
    dev_md5=$(sudo dd if=/dev/disk2 bs=4096 count=662904 | md5 -q)
    [ "$iso_md5" = "$dev_md5" ] && echo Validated || echo Failed
    sudo cmp /dev/disk2 ubuntu-20.04-desktop-amd64.iso
    ```

    ## Create a UEFI bootable USB from an ISO file
  8. @cetinajero cetinajero revised this gist May 2, 2020. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions macos_boot_keys.md
    Original file line number Diff line number Diff line change
    @@ -38,6 +38,7 @@ sudo gdd if=ubuntu-20.04-desktop-amd64.iso of=/dev/disk2 bs=4096 status=progress

    iso_md5=$(md5 -q ubuntu-20.04-desktop-amd64.iso)
    dev_md5=$(sudo dd if=/dev/disk2 bs=4096 count=662904 | md5 -q)
    [ "$iso_md5" = "$dev_md5" ] && echo Validated || echo Failed
    ```

    ## Create a UEFI bootable USB from an ISO file
  9. @cetinajero cetinajero revised this gist May 2, 2020. 1 changed file with 13 additions and 1 deletion.
    14 changes: 13 additions & 1 deletion macos_boot_keys.md
    Original file line number Diff line number Diff line change
    @@ -22,12 +22,24 @@ Open the _Terminal.app_ from within macOS Recovery (`⌘` + `R`) and type:
    resetpassword
    ```

    ## Burn a CD/DVD from an ISO file
    ## Burn a CD/DVD from an ISO9660 ISO file

    ```bash
    hdiutil burn image.iso
    ```

    ## Burn a USB from an ISOHybrid ISO file

    An ISO with a `DOS/MBR` _boot sector_ is required.

    ```bash
    file ubuntu-20.04-desktop-amd64.iso
    sudo gdd if=ubuntu-20.04-desktop-amd64.iso of=/dev/disk2 bs=4096 status=progress

    iso_md5=$(md5 -q ubuntu-20.04-desktop-amd64.iso)
    dev_md5=$(sudo dd if=/dev/disk2 bs=4096 count=662904 | md5 -q)
    ```

    ## Create a UEFI bootable USB from an ISO file

    The `/efi/boot/bootx64.efi` _bootloader_ is required.
  10. @cetinajero cetinajero revised this gist May 1, 2020. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions macos_boot_keys.md
    Original file line number Diff line number Diff line change
    @@ -30,6 +30,8 @@ hdiutil burn image.iso

    ## Create a UEFI bootable USB from an ISO file

    The `/efi/boot/bootx64.efi` _bootloader_ is required.

    ```bash
    diskutil list
    diskutil partitionDisk /dev/disk2 1 MBR FAT32 W10_1909SPA R
  11. @cetinajero cetinajero revised this gist May 1, 2020. 1 changed file with 1 addition and 14 deletions.
    15 changes: 1 addition & 14 deletions macos_boot_keys.md
    Original file line number Diff line number Diff line change
    @@ -50,20 +50,7 @@ diskutil partitionDisk /dev/disk2 1 MBR FAT32 W10_1909SPA R
    Set the partition as active ([boot flag](https://en.wikipedia.org/wiki/Boot_flag))

    ```bash
    sudo fdisk -e /dev/disk2
    ```

    Enter the following:

    ```
    Enter 'help' for information
    fdisk: 1> flag 1
    Partition 1 marked active.
    fdisk:*1> write
    Device could not be accessed exclusively.
    A reboot will be needed for changes to take effect. OK? [n] y
    Writing MBR at offset 0.
    fdisk: 1> exit
    (echo flag 1 ; echo write ; echo y ; echo exit) | sudo fdisk -e /dev/disk2 ; echo
    ```

    Write the [syslinux](https://www.syslinux.org)'s MBR (Master Boot Record)
  12. @cetinajero cetinajero revised this gist May 1, 2020. 1 changed file with 6 additions and 4 deletions.
    10 changes: 6 additions & 4 deletions macos_boot_keys.md
    Original file line number Diff line number Diff line change
    @@ -32,10 +32,10 @@ hdiutil burn image.iso

    ```bash
    diskutil list
    diskutil eraseDisk MS-DOS "WIN10HSL" MBR disk2
    hdiutil mount ~/Downloads/Win10_1703_SingleLang_SpanishMexico_x64.iso
    cp -rp /Volumes/CSLA_X64FREO_ES-MX_DV5/* /Volumes/WIN10HSL/
    hdiutil unmount /Volumes/WIN10HSL/
    diskutil partitionDisk /dev/disk2 1 MBR FAT32 W10_1909SPA R
    hdiutil mount ~/Downloads/Win10_1909_Spanish\(Mexico\)_x64.iso -mountpoint /Volumes/ISO
    rsync -avh --info=progress2 /Volumes/ISO/ /Volumes/W10_1909SPA/
    diskutil unmountDisk /dev/disk2
    ```

    ## Create a MBR bootable USB from an ISO file
    @@ -116,6 +116,8 @@ Unmount the USB

    ```bash
    diskutil unmountDisk /dev/disk2
    # or
    hdiutil unmount /Volumes/W10_1909SPA/
    ```

    ## Configure Windows Installer to always ask for the version to install
  13. @cetinajero cetinajero revised this gist May 1, 2020. 1 changed file with 4 additions and 9 deletions.
    13 changes: 4 additions & 9 deletions macos_boot_keys.md
    Original file line number Diff line number Diff line change
    @@ -105,15 +105,10 @@ hdiutil mount ~/Downloads/Win10_1909_Spanish\(Mexico\)_x64.iso -mountpoint /Volu
    Copy the ISO files to the USB

    ```bash
    # Next time try rzync to enable progress info
    # rsync -ah --progress
    # rsync -avh --progress
    # rsync -ah --info=progress2

    # Refs:
    # https://alexlubbock.com/bootable-windows-usb-on-mac
    # https://til.hashrocket.com/posts/cmqpct95xk-copy-files-with-progress-in-terminal-wrsync

    rsync -avh --info=progress2 /Volumes/ISO/ /Volumes/W10_1909SPA/
    # or
    rsync -avh --progress /Volumes/ISO/ /Volumes/W10_1909SPA/
    # or
    cp -Rpv /Volumes/ISO/ /Volumes/W10_1909SPA/
    ```

  14. @cetinajero cetinajero revised this gist Apr 30, 2020. 1 changed file with 15 additions and 1 deletion.
    16 changes: 15 additions & 1 deletion macos_boot_keys.md
    Original file line number Diff line number Diff line change
    @@ -96,10 +96,24 @@ Write the syslinux's config (syslinux.cfg)
    echo -e "DEFAULT boot\n\nLABEL boot\n\tMENU LABEL boot\n\tCOM32 chain.c32\n\tAPPEND fs ntldr=/bootmgr" > /Volumes/W10_1909SPA/syslinux/syslinux.cfg
    ```

    Copy the ISO files to the USB
    Mount the ISO

    ```bash
    hdiutil mount ~/Downloads/Win10_1909_Spanish\(Mexico\)_x64.iso -mountpoint /Volumes/ISO
    ```

    Copy the ISO files to the USB

    ```bash
    # Next time try rzync to enable progress info
    # rsync -ah --progress
    # rsync -avh --progress
    # rsync -ah --info=progress2

    # Refs:
    # https://alexlubbock.com/bootable-windows-usb-on-mac
    # https://til.hashrocket.com/posts/cmqpct95xk-copy-files-with-progress-in-terminal-wrsync

    cp -Rpv /Volumes/ISO/ /Volumes/W10_1909SPA/
    ```

  15. @cetinajero cetinajero revised this gist Apr 26, 2020. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions macos_boot_keys.md
    Original file line number Diff line number Diff line change
    @@ -87,13 +87,13 @@ Write the syslinux's modules (COM32 modules)

    ```bash
    mkdir /Volumes/W10_1909SPA/syslinux
    cp syslinux-4.07/com32/modules/*.c32 /Volumes/W10_1909SPA/syslinux
    cp syslinux-4.07/com32/chain/chain.c32 /Volumes/W10_1909SPA/syslinux
    ```

    Write the syslinux's config (syslinux.cfg)

    ```bash
    echo -e "default boot\nLABEL boot\nMENU LABEL boot\nCOM32 chain.c32\nAPPEND fs ntldr=/bootmgr\n" > /Volumes/W10_1909SPA/syslinux/syslinux.cfg
    echo -e "DEFAULT boot\n\nLABEL boot\n\tMENU LABEL boot\n\tCOM32 chain.c32\n\tAPPEND fs ntldr=/bootmgr" > /Volumes/W10_1909SPA/syslinux/syslinux.cfg
    ```

    Copy the ISO files to the USB
  16. @cetinajero cetinajero revised this gist Apr 26, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion macos_boot_keys.md
    Original file line number Diff line number Diff line change
    @@ -66,7 +66,7 @@ Writing MBR at offset 0.
    fdisk: 1> exit
    ```

    Write the syslinux's MBR (Master Boot Record)
    Write the [syslinux](https://www.syslinux.org)'s MBR (Master Boot Record)

    ```bash
    curl https://mirrors.edge.kernel.org/pub/linux/utils/boot/syslinux/syslinux-4.07.tar.gz -o syslinux-4.07.tar.gz
  17. @cetinajero cetinajero revised this gist Apr 26, 2020. 1 changed file with 4 additions and 4 deletions.
    8 changes: 4 additions & 4 deletions macos_boot_keys.md
    Original file line number Diff line number Diff line change
    @@ -69,10 +69,10 @@ fdisk: 1> exit
    Write the syslinux's MBR (Master Boot Record)

    ```bash
    curl https://www.oueta.com/wp-content/uploads/2018/10/syslinux-4.03.tar.gz -o syslinux-4.03.tar.gz
    tar -zxvf syslinux-4.03.tar.gz
    curl https://mirrors.edge.kernel.org/pub/linux/utils/boot/syslinux/syslinux-4.07.tar.gz -o syslinux-4.07.tar.gz
    tar -zxvf syslinux-4.07.tar.gz
    diskutil unmountDisk /dev/disk2
    sudo dd if=syslinux-4.03/mbr/mbr.bin of=/dev/disk2 bs=440 count=1
    sudo dd if=syslinux-4.07/mbr/mbr.bin of=/dev/disk2 bs=440 count=1
    ```

    Write the syslinux's VBR (Volume Boot Record)
    @@ -87,7 +87,7 @@ Write the syslinux's modules (COM32 modules)

    ```bash
    mkdir /Volumes/W10_1909SPA/syslinux
    cp syslinux-4.03/com32/modules/*.c32 /Volumes/W10_1909SPA/syslinux
    cp syslinux-4.07/com32/modules/*.c32 /Volumes/W10_1909SPA/syslinux
    ```

    Write the syslinux's config (syslinux.cfg)
  18. @cetinajero cetinajero revised this gist Apr 26, 2020. 1 changed file with 25 additions and 2 deletions.
    27 changes: 25 additions & 2 deletions macos_boot_keys.md
    Original file line number Diff line number Diff line change
    @@ -66,23 +66,46 @@ Writing MBR at offset 0.
    fdisk: 1> exit
    ```

    ```
    diskutil unmountDisk /dev/disk2
    Write the syslinux's MBR (Master Boot Record)

    ```bash
    curl https://www.oueta.com/wp-content/uploads/2018/10/syslinux-4.03.tar.gz -o syslinux-4.03.tar.gz
    tar -zxvf syslinux-4.03.tar.gz
    diskutil unmountDisk /dev/disk2
    sudo dd if=syslinux-4.03/mbr/mbr.bin of=/dev/disk2 bs=440 count=1
    ```

    Write the syslinux's VBR (Volume Boot Record)

    ```bash
    curl https://raw.githubusercontent.com/unetbootin/unetbootin/master/src/unetbootin/unetbootin.app/Contents/Resources/syslinux-mac -o syslinux-mac
    chmod +x syslinux-mac
    sudo ./syslinux-mac -i /dev/disk2s1
    ```

    Write the syslinux's modules (COM32 modules)

    ```bash
    mkdir /Volumes/W10_1909SPA/syslinux
    cp syslinux-4.03/com32/modules/*.c32 /Volumes/W10_1909SPA/syslinux
    ```

    Write the syslinux's config (syslinux.cfg)

    ```bash
    echo -e "default boot\nLABEL boot\nMENU LABEL boot\nCOM32 chain.c32\nAPPEND fs ntldr=/bootmgr\n" > /Volumes/W10_1909SPA/syslinux/syslinux.cfg
    ```

    Copy the ISO files to the USB

    ```bash
    hdiutil mount ~/Downloads/Win10_1909_Spanish\(Mexico\)_x64.iso -mountpoint /Volumes/ISO
    cp -Rpv /Volumes/ISO/ /Volumes/W10_1909SPA/
    ```

    Unmount the USB

    ```bash
    diskutil unmountDisk /dev/disk2
    ```

  19. @cetinajero cetinajero revised this gist Apr 26, 2020. 1 changed file with 12 additions and 1 deletion.
    13 changes: 12 additions & 1 deletion macos_boot_keys.md
    Original file line number Diff line number Diff line change
    @@ -40,13 +40,22 @@ hdiutil unmount /Volumes/WIN10HSL/

    ## Create a MBR bootable USB from an ISO file

    Format the USB

    ```bash
    diskutil list
    diskutil partitionDisk /dev/disk2 1 MBR FAT32 W10_1909SPA R
    ```

    Set the partition as active ([boot flag](https://en.wikipedia.org/wiki/Boot_flag))

    # Set bootable flag on
    ```bash
    sudo fdisk -e /dev/disk2
    ```

    Enter the following:

    ```
    Enter 'help' for information
    fdisk: 1> flag 1
    Partition 1 marked active.
    @@ -55,7 +64,9 @@ Device could not be accessed exclusively.
    A reboot will be needed for changes to take effect. OK? [n] y
    Writing MBR at offset 0.
    fdisk: 1> exit
    ```

    ```
    diskutil unmountDisk /dev/disk2
    curl https://www.oueta.com/wp-content/uploads/2018/10/syslinux-4.03.tar.gz -o syslinux-4.03.tar.gz
  20. @cetinajero cetinajero revised this gist Apr 26, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion macos_boot_keys.md
    Original file line number Diff line number Diff line change
    @@ -71,7 +71,7 @@ cp syslinux-4.03/com32/modules/*.c32 /Volumes/W10_1909SPA/syslinux
    echo -e "default boot\nLABEL boot\nMENU LABEL boot\nCOM32 chain.c32\nAPPEND fs ntldr=/bootmgr\n" > /Volumes/W10_1909SPA/syslinux/syslinux.cfg

    hdiutil mount ~/Downloads/Win10_1909_Spanish\(Mexico\)_x64.iso -mountpoint /Volumes/ISO
    cp -Rv /Volumes/ISO /Volumes/W10_1909SPA/
    cp -Rpv /Volumes/ISO/ /Volumes/W10_1909SPA/
    diskutil unmountDisk /dev/disk2
    ```

  21. @cetinajero cetinajero revised this gist Apr 26, 2020. 1 changed file with 37 additions and 0 deletions.
    37 changes: 37 additions & 0 deletions macos_boot_keys.md
    Original file line number Diff line number Diff line change
    @@ -38,6 +38,43 @@ cp -rp /Volumes/CSLA_X64FREO_ES-MX_DV5/* /Volumes/WIN10HSL/
    hdiutil unmount /Volumes/WIN10HSL/
    ```

    ## Create a MBR bootable USB from an ISO file

    ```bash
    diskutil list
    diskutil partitionDisk /dev/disk2 1 MBR FAT32 W10_1909SPA R

    # Set bootable flag on
    sudo fdisk -e /dev/disk2

    Enter 'help' for information
    fdisk: 1> flag 1
    Partition 1 marked active.
    fdisk:*1> write
    Device could not be accessed exclusively.
    A reboot will be needed for changes to take effect. OK? [n] y
    Writing MBR at offset 0.
    fdisk: 1> exit

    diskutil unmountDisk /dev/disk2

    curl https://www.oueta.com/wp-content/uploads/2018/10/syslinux-4.03.tar.gz -o syslinux-4.03.tar.gz
    tar -zxvf syslinux-4.03.tar.gz
    sudo dd if=syslinux-4.03/mbr/mbr.bin of=/dev/disk2 bs=440 count=1

    curl https://raw.githubusercontent.com/unetbootin/unetbootin/master/src/unetbootin/unetbootin.app/Contents/Resources/syslinux-mac -o syslinux-mac
    chmod +x syslinux-mac
    sudo ./syslinux-mac -i /dev/disk2s1

    mkdir /Volumes/W10_1909SPA/syslinux
    cp syslinux-4.03/com32/modules/*.c32 /Volumes/W10_1909SPA/syslinux
    echo -e "default boot\nLABEL boot\nMENU LABEL boot\nCOM32 chain.c32\nAPPEND fs ntldr=/bootmgr\n" > /Volumes/W10_1909SPA/syslinux/syslinux.cfg

    hdiutil mount ~/Downloads/Win10_1909_Spanish\(Mexico\)_x64.iso -mountpoint /Volumes/ISO
    cp -Rv /Volumes/ISO /Volumes/W10_1909SPA/
    diskutil unmountDisk /dev/disk2
    ```

    ## Configure Windows Installer to always ask for the version to install

    ```bash
  22. @cetinajero cetinajero revised this gist Apr 16, 2020. 1 changed file with 8 additions and 0 deletions.
    8 changes: 8 additions & 0 deletions macos_boot_keys.md
    Original file line number Diff line number Diff line change
    @@ -14,6 +14,14 @@
    | `` + `` + `P` + `R` | [Reset NVRAM or PRAM](https://support.apple.com/en-us/HT204063) |
    | `T` | [Target Disk](https://support.apple.com/en-us/HT201462) |

    ## Reset a macOS user password

    Open the _Terminal.app_ from within macOS Recovery (`` + `R`) and type:

    ```bash
    resetpassword
    ```

    ## Burn a CD/DVD from an ISO file

    ```bash
  23. @cetinajero cetinajero revised this gist Mar 11, 2020. 1 changed file with 6 additions and 0 deletions.
    6 changes: 6 additions & 0 deletions macos_boot_keys.md
    Original file line number Diff line number Diff line change
    @@ -14,6 +14,12 @@
    | `` + `` + `P` + `R` | [Reset NVRAM or PRAM](https://support.apple.com/en-us/HT204063) |
    | `T` | [Target Disk](https://support.apple.com/en-us/HT201462) |

    ## Burn a CD/DVD from an ISO file

    ```bash
    hdiutil burn image.iso
    ```

    ## Create a UEFI bootable USB from an ISO file

    ```bash
  24. @cetinajero cetinajero revised this gist Oct 11, 2019. 1 changed file with 6 additions and 0 deletions.
    6 changes: 6 additions & 0 deletions macos_boot_keys.md
    Original file line number Diff line number Diff line change
    @@ -24,6 +24,12 @@ cp -rp /Volumes/CSLA_X64FREO_ES-MX_DV5/* /Volumes/WIN10HSL/
    hdiutil unmount /Volumes/WIN10HSL/
    ```

    ## Configure Windows Installer to always ask for the version to install

    ```bash
    echo -e "[Channel]\nRetail" > /Volumes/WIN10HSL/sources/ei.cfg
    ```

    ## Get the Windows activation key from the BIOS

    Windows: `wmic path softwarelicensingservice get OA3xOriginalProductKey`
  25. @cetinajero cetinajero revised this gist Oct 3, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion macos_boot_keys.md
    Original file line number Diff line number Diff line change
    @@ -14,7 +14,7 @@
    | `` + `` + `P` + `R` | [Reset NVRAM or PRAM](https://support.apple.com/en-us/HT204063) |
    | `T` | [Target Disk](https://support.apple.com/en-us/HT201462) |

    ## Create a EUFI bootable USB from an ISO file
    ## Create a UEFI bootable USB from an ISO file

    ```bash
    diskutil list
  26. @cetinajero cetinajero revised this gist Oct 3, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion macos_boot_keys.md
    Original file line number Diff line number Diff line change
    @@ -14,7 +14,7 @@
    | `` + `` + `P` + `R` | [Reset NVRAM or PRAM](https://support.apple.com/en-us/HT204063) |
    | `T` | [Target Disk](https://support.apple.com/en-us/HT201462) |

    ## Create a bootable USB from an ISO file
    ## Create a EUFI bootable USB from an ISO file

    ```bash
    diskutil list
  27. @cetinajero cetinajero revised this gist Sep 30, 2019. 1 changed file with 7 additions and 1 deletion.
    8 changes: 7 additions & 1 deletion macos_boot_keys.md
    Original file line number Diff line number Diff line change
    @@ -22,4 +22,10 @@ diskutil eraseDisk MS-DOS "WIN10HSL" MBR disk2
    hdiutil mount ~/Downloads/Win10_1703_SingleLang_SpanishMexico_x64.iso
    cp -rp /Volumes/CSLA_X64FREO_ES-MX_DV5/* /Volumes/WIN10HSL/
    hdiutil unmount /Volumes/WIN10HSL/
    ```
    ```

    ## Get the Windows activation key from the BIOS

    Windows: `wmic path softwarelicensingservice get OA3xOriginalProductKey`

    GNU Linux: `sudo hd /sys/firmware/acpi/tables/MSDM`
  28. @cetinajero cetinajero revised this gist Sep 30, 2019. No changes.
  29. @cetinajero cetinajero revised this gist Sep 30, 2019. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions macos_boot_keys.md
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,5 @@
    ## macOS Boot combination keys

    | Keys | Description |
    |:---------------------:|:--------------------------------------------------------------------------------------------------:|
    | `` | [Startup Manager](https://support.apple.com/en-us/HT202796) |
  30. @cetinajero cetinajero revised this gist Sep 30, 2019. 1 changed file with 11 additions and 1 deletion.
    12 changes: 11 additions & 1 deletion macos_boot_keys.md
    Original file line number Diff line number Diff line change
    @@ -10,4 +10,14 @@
    | `` + `` + `R` | [Upgrade to the latest macOS compatible with your Mac](https://support.apple.com/en-us/HT204904) |
    | `` + `` + `` + `R` | [Install the original macOS, or closest still available](https://support.apple.com/en-us/HT204904) |
    | `` + `` + `P` + `R` | [Reset NVRAM or PRAM](https://support.apple.com/en-us/HT204063) |
    | `T` | [Target Disk](https://support.apple.com/en-us/HT201462) |
    | `T` | [Target Disk](https://support.apple.com/en-us/HT201462) |

    ## Create a bootable USB from an ISO file

    ```bash
    diskutil list
    diskutil eraseDisk MS-DOS "WIN10HSL" MBR disk2
    hdiutil mount ~/Downloads/Win10_1703_SingleLang_SpanishMexico_x64.iso
    cp -rp /Volumes/CSLA_X64FREO_ES-MX_DV5/* /Volumes/WIN10HSL/
    hdiutil unmount /Volumes/WIN10HSL/
    ```