How to mount raw disk images?
I'd like to mount a raw dump of a disk, e. g. like those created by dd
? Is there something like a loop device in OS X?
For those encountering the same problem:
hdiutil attach -imagekey diskimage-class=CRawDiskImage -nomount filename
then mount it as you like.
Source: https://serverfault.com/questions/174909/mount-block-file-on-osx
This is funny because it's actually really really simple. Rename it to a .dmg extension, as a DMG is a raw image too.
In contrast to the above solution, this will work on dd rips of entire drives in addition to partitions.
The hdiutil
command given above is correct, however, newer Mac SSDs have a 4096 byte block size and hdiutil
defaults to 512 for disk images so if you attempt to mount a 4096 byte block size image it will look like nonsense to the system.
Adding -blocksize 4096
to the command will let you work with an image created from a newer Mac:
hdiutil attach -blocksize 4096 -noverify -nomount diskimage.img