Tag Archives: install

Create Windows 10 install USB from macOS Mojave

If you want to install windows on your mac and you need s bootable usb stick with windows, here's how to do it. Please note, this is not for installing windows on other devices.

There is a solution using unetbootin , one with bootcamp assistant and one using mounting and manually copying files but none of them worked for me.

This solution worked for me in macOS High Sierra and Mojave and it will probably work on other versions.

First you have to convert the windows iso file to an img:

hdiutil convert -format UDRW -o windows.img windows.iso

The result of this would most likely be a file named widows.img.dmg. The next step is to unmount the usb disk ( diskutil list to see which one it is , in my case this was /dev/disk2 )

sudo diskutil unmountDisk /dev/disk2

Now just use dd to copy the image to the usb device:

sudo dd if=windows10.img.dmg of=/dev/disk2 bs=1m

MacOSX command line tricks

Here's a list of MacOSX commands I had to search for all over the internet because I needed to use them lately and I'm sure I'm going to forget since I'm not a big OSX user. So here they are for when I'll need them again ... 🙂

In linux when you want to know which ports are opened and what applications listen on those ports you use netstat -lnp
In MacOSX you get the listening ports with this:

  1. lsof -i |grep LISTEN

Want to see what system call am application is making use strace, for MacOSX thats:

  1. dtruss

Here's how to install an application that comes packaged in a .dmg:

  1. hdiutil attach App.dmg
  2. installer -package /Volumes/App/App.pkg -target /Volumes/MainDisk

uninstall a package

  2. lsbom -fls /private/var/db/receipts/package.name.bom|tr '\n' '\0' |xargs -0 rm
  3. rm /private/var/db/receipts/package.name.*

pidof required by some mysql scripts

  2. #!/bin/sh
  3. ps axc|awk "{if (\$5==\"$1\") print \$1}";

remount with noatime

  1. mount -u -o noatime /dev/disk0s2 /Volumes/HD2

More to come ...