Wei Zhou
Wei Zhou

Reputation: 21

Can't mount Android system.img in Mac

I downloaded the AOSP source code, and successfully make the build. Now with the new built system.img file, I want to mount it and take a look inside. However I am not be able to mount it. I am working on the MacOS, and the command I used was:

$ file system.img
system.img: Linux rev 1.0 ext4 filesystem data, UUID=b250775f-0c87-4e48-b8ed-c0443f127ee9 (extents) (large files) (huge files)

$ mount -o loop -t ext4 system.img /mnt
mount: exec /Library/Filesystems/ext4.fs/Contents/Resources/mount_ext4 for /mnt: No such file or directory

How can I solve this issue?

Upvotes: 2

Views: 4618

Answers (2)

S Raghav
S Raghav

Reputation: 1526

Here are the steps that worked for me

Install the required dependencies

brew install simg2img
brew install osxfuse
brew install ext4fuse

I did a reboot at this stage as it was recommended here

Convert the system.img into a raw img

simg2img system.img system_raw.img

mount the image

mkdir mountpoint
ext4fuse system_raw.img mountpoint

At this point you can also browse the img as a folder in Mac Finder

References

  1. https://solumachines.wordpress.com/2015/08/15/mounting-an-android-system-img-on-mac-os-x/
  2. https://github.com/anestisb/android-simg2img
  3. https://medium.com/@chmodxx/extracting-android-factory-images-on-macos-cc61e45139d1

Upvotes: 2

Frederik Carlier
Frederik Carlier

Reputation: 4796

You can use extfstools to extract the Android system.img on macOS and Linux. You don't need root privileges or mount anything.

The original version is at https://github.com/petib/extfstools and it was written for macOS. It doesn't support symlinks.

I have a fork of extfstools at https://github.com/qmfrederik/extfstools which does support symlinks, but was tested on Linux only.

Upvotes: 0

Related Questions