Create boot flash on MacOS X

TIP: Drag and Drop a file from Finder to Terminal to ‘paste’ the full path without typing and risking type errors.

  • Download the desired file
  • Open the Terminal (in /Applications/Utilities/ or query Terminal in Spotlight
  • Convert the .iso file to .img using the convert option of hdiutil (e.g.,)

  • Note: OS X tends to put the .dmg ending on the output file automatically.
  • Run

    to get the current list of devices

  • Insert your flash media
  • Run

    again and determine the device node assigned to your flash media (e.g. /dev/disk2)

  • Run

    (replace N with the disk number from the last command; in the previous example, N would be 2)

  • Execute

    (replace /path/to/downloaded.img with the path where the image file is located; for example, ./ubuntu.img or ./ubuntu.dmg).

  • Using /dev/rdisk instead of /dev/disk may be faster.
    • If you see the error dd: Invalid number ‘1m’, you are using GNU dd. Use the same command but replace bs=1m with bs=1M.
    • If you see the error dd: /dev/diskN: Resource busy, make sure the disk is not in use. Start the Disk Utility.app and unmount (don’t eject) the drive.
  • Run

    and remove your flash media when the command completes

  • Restart your Mac and press alt while the Mac is restarting to choose the USB-Stick

Writing directly to a USB disk in OS X

Disclaimer : This procedure erases all data on the target volume so use the volume relevant to your setup, eg. that of your USB disk. I and my associates at meinit do not take responsibility if you overwrite the wrong volume and lose your music, movies, thesis, world peace plan etc. And there might be an easier way to do this, I await comments.

Today I would like to share a short note on how to write a raw disk image to a USB memory stick in OS X. The raw disk image can, for example, be a bootable filesystem image for a OS installer. In my case Fedora 8’s “diskboot.img”.

The main problem is that I was used to Linux’s way of device naming but under OS X if you wish to write directly to a disk you need to use the “raw” version of the device. For example /dev/disk1 has raw device /dev/rdisk1.

 

open a terminal and do the following:

Find your usb stick in the output (i’ve included mine as an example)

This will take a while. But it’ll be much faster (and healthier for the life of your USB flash stick) to use rdisk instead of disk and a large buffer size to minimize the number of flash erase and rewrites that the stick must do.

Finally, before you pull it out:

% diskutil eject /dev/disk2

(Visited 342 times, 1 visits today)
No Comments - Leave a comment

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *

*

Этот сайт использует Akismet для борьбы со спамом. Узнайте, как обрабатываются ваши данные комментариев.


Перейти к верхней панели