Skip to content

Instantly share code, notes, and snippets.

@noperator
Last active March 6, 2022 21:25
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save noperator/6f2633dc952d5ae851eda3c12a608aeb to your computer and use it in GitHub Desktop.
Save noperator/6f2633dc952d5ae851eda3c12a608aeb to your computer and use it in GitHub Desktop.
Decrypt and mount an encrypted sparse bundle disk image using https://github.com/jief666/sparsebundlefs.
# Create mount points for decrypted sparse bundle disk image and full Apple disk image.
sudo mkdir /mnt/bundle /mnt/dmg
# Ensure loopback kernel module is loaded.
lsmod | grep ^loop || sudo modprobe loop
# Decrypt and FUSE-mount sparse bundle disk image. Trailing options help with debugging.
sudo sparsebundlefs <ENCRYPTED_SPARSE_BUNDLE_DISK_IMAGE> /mnt/bundle -s -f -D
# Note partition 2's "Start" and "Size" values.
sudo parted /mnt/bundle/sparsebundle.dmg unit B print
Number Start End Size File system Name Flags
1 20480B 209735679B 209715200B fat32 EFI System Partition boot, esp
2 210763776B 4095737855B 3884974080B fat32 disk image msftdata
# Using values noted above, associate loop device with decrypted sparse bundle disk image.
sudo losetup -f /mnt/bundle/sparsebundle.dmg --offset 210763776 --sizelimit 3884974080 --show
# Mount loop device as full Apple disk image.
sudo mount /dev/loop0 /mnt/dmg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment