转:在ubuntu下将dmg文件转化为iso格式

dmg格式是Mac系统下使用的文件,在Ubuntu下不能直接使用.

iso格式则是大多数Linux和Windows下常用的镜像文件格式.

为了方便在Ubuntu或者Windows下安装Mac虚拟机,需要转换个iso格式出来.

1. 打开终端,安装dmg2img。sudo apt-get install dmg2img

2. 将dmg格式转化为img格式.  dmg2img /path/to/example.dmg /path/to/example.img

3. 挂载img文件.

sudo mkdir /media/example

sudo modprobe hfsplus

sudo mount -t hfsplus -o loop example.img /media/example

这时候会遇到一个错误:

mount: wrong fs type, bad option, bad superblock on /dev/loop0,       missing codepage or helper program, or other error       In some cases useful info is found in syslog – try       dmesg | tail  or so

这时候用

/usr/sbin/sfdisk img_Mac_X_Lion.img  来调整分区

各种回车,最后输入y即可.如图

然后把这玩意再挂载到/media/mac上

 

4. 用Brasero把img转换成iso格式. Brasero在 Applications ->Sound & Video

5. 翻刻一个iso就出来了

参考资料:

1. http://hi.baidu.com/heutsnc/blog/item/777ac861f68ab25eeaf8f850.html

2. http://webcache.googleusercontent.com/search?q=cache:-uQE6LHwnFcJ:wiki.aranym.org/afs/hd_partition_linux+unrecognized+partition+table+typeOld+situation&cd=2&hl=en&ct=clnk&gl=hk&client=ubuntu

3. http://webcache.googleusercontent.com/search?q=cache:83pRiZ6MMKEJ:www.psibo.unibo.it/areait/partitions.html+bad+superblock+on+/dev/loop0&cd=1&hl=en&ct=clnk&gl=hk&client=ubuntu

posted @ 2012-11-22 14:26  李伯波  阅读(7371)  评论(1编辑  收藏  举报