Skip to content

Instantly share code, notes, and snippets.

@marcinantkiewicz
Last active December 10, 2017 04:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marcinantkiewicz/4dadde1e5de2833c4594d1c8e67230a2 to your computer and use it in GitHub Desktop.
Save marcinantkiewicz/4dadde1e5de2833c4594d1c8e67230a2 to your computer and use it in GitHub Desktop.
Movign a bootable ISO to USB drive on OSX:
- Insert the USB drive. For portability, format as FAT
- The drive will mount, unmount the volume (but do not "eject")
user $ sudo diskutil unmountDisk /dev/disk2
Unmount of all volumes on disk2 was successful
- I need a GPT partition, in place of some junk here, so OSX formating tools will work just fine:
user $ sudo diskutil partitionDisk /dev/disk2 1 MBR "Free Space" "%noformat%" 100%
- Finally, move the drive image over to the USB drive.
Home Brew can provide a pv (Pipe View) utility that will nicely show where the 8gb transfer is at:
user$ dd if=windows7pro64.iso | pv | sudo dd of=/dev/disk3
175MiB 0:05:28 [ 470KiB/s] [ <=> ]
else, venerable dd will work. Native OSX version does not have the progress indicator. If DD
received SIGINGO (kill -INFO $pid), it will display copied bytes.
user $ sudo dd bs=1m if=Downloads/2017-09-07-raspbian-stretch-lite.img of=/dev/r conv=sync
user$ sudo kill -INFO 24088
325+0 records in
324+0 records out
339738624 bytes transferred in 53.801800 secs (6314633 bytes/sec)
user$ sudo kill -INFO 24088
1768+1 records in
1769+0 records out
1854930944 bytes transferred in 290.152479 secs (6392952 bytes/sec)
Bytes are hard, a clonky helper is a function that will calculate how many megabytes are left:
function dd_remaining () { total=$1; shift; current=$1; shift; echo $(( ($total - $current)/1024/1024 ));}
total=3319478272 dd_remaining $total 3174481920
138
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment