Ever wanted to convert a raw partition to .dmg, fast? This repo is what you need!
See also the original README for libdmg-hfsplus.
Sometimes you have really big files to convert to .dmg, and want it to go fast. Other builds of libdmg-hfsplus will be quite slow and use just one core.
An example use case is backing up Mac partitions on a multi-boot system. You can make a quick backup with dd or clonezilla, and it's easy to restore. But should you ever need to restore to a partition of a different size, you'll need to convert to .dmg and use Disk Utility.
With other tools, that conversion can be slow. On a 12-core system, my 200 GB partition (pre-compression) took over two hours to convert. But this build of libdmg took just 10 minutes!
- Install cmake, and headers for zlib and lzfse.
- Eg:
brew install cmake lzfse
- Eg:
apt install cmake zlib-dev liblzfse-dev
- Eg:
- Configure with cmake:
cmake . -DCMAKE_BUILD_TYPE=Release
- Build:
make -j6
- Copy
dmg/dmg
somewhere in your path
- Convert an image to dmg:
dmg dmg input.img output.dmg
- Or use
-
as a file argument to use standard input/output
Example, with a disk image compressed with pixz:
cat giant.img.pxz | pixz -d | dmg dmg - output.dmg
- Changed dmg compression to use a parallel algorithm
- Made CRC32 calculation parallel, too
- Allowed streaming input in most cases