20

I already know how to do it on Mac OS X (plenty of instructions online).

But is it possible to do it on Ubuntu? If yes, how?

3
  • I think that your solution (Question and answer) already exist in this post.
    – Lucio
    Dec 5, 2012 at 18:06
  • 2
    @Lucio Unfortunately, no. This post tells about .iso image files, but I have .dmg image file, which is different. Dec 5, 2012 at 18:08
  • Oh, now I understand you. Your right, the Mac images are .dmg. I hope that my answer can be useful for you. If it does, just let me know.
    – Lucio
    Dec 6, 2012 at 15:51

2 Answers 2

26

As you want to create a LiveUSB you need a .iso image to make it. The Mac image is a .dmg file, so you must to convert this file into .iso, and then install it.

Install DMG2IMG

DMG2IMG (1, 2) will convert the .dmg image into a .iso image. To install open a terminal and enter this command: sudo apt-get install dmg2img

Convert the Image

With dmg2img you will create an .img file and this file will have the same format as an .iso file, you just need to replace the extension.

In the terminal enter the following commands or paste the script with the necessary modifications:

# Replace "OriginalFile.dmg" with the filename including the extension
# of your file. The extension will be replaced where necessary unless
# you want to specify the filenames yourself.

filename="OriginalFile.dmg"

# Replace with your file name and it will create the IMG file
dmg2img -i "${filename}" -o "${filename%.dmg}.img"

# Note that the extension of the first file is ".img"!
mv "${filename%.dmg}.img" "${filename%.dmg}.iso"

Make the LiveUSB with an ISO image

Now you already have the .iso image, with which you will make the LiveUSB. Several tools and answers exist to help you create bootable USB drives, some are specific to PC/MBR booting (Bootcamp) where Macs and newer PCs since Windows 8 require/support UEFI booting.

A related question: AskDifferent – Official way to obtain an OS X ISO file

0
3

why not just dd the .img file after conversion?

sudo dd if=/path/to/orig.img of=/dev/s**
4
  • 2
    Since you asked, dd is a good program if a bit hard to understand for some, however dd has one major drawback compared to GUI USB creator applications . Sometimes when you dd an .img file onto a USB drive you can't reformat it if you want to reuse the USB drive. The GUI live USB programs don't have this problem.
    – karel
    May 1, 2015 at 15:37
  • @karel actually you could use a software like SDFormatter with FORMAT SIZE ADJUSTMENT = ON to restore the true capacity of USB drive (after dd'ing USB drive could appear as e.g. 50 MB instead of 4GB and standard built-in OS software sometimes can't restore it) Oct 13, 2015 at 9:57
  • @JakeBadlands I downloaded SDFormatter to try it, but ClamAV reported a malware threat on the file that I downloaded, so I'm sticking to my tried and true method which uses programs from the Ubuntu Software Center: askubuntu.com/questions/496309/how-to-unboot-my-bootable-usb/…
    – karel
    Oct 13, 2015 at 10:16
  • It should be possible to use parted to recreate the partition table on a dd'd USB stick. It makes sense to me that some GUI tools don't support recreating the partition table and thus are stuck with whatever size was put there when dding, but it would seem strange if it couldn't be done with parted, is this known not to work on any USB stick?
    – Jan Segre
    Oct 2, 2017 at 4:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .