Ubuntu – Mounted Android System.img unable to edit

androidhackingmountmountpoint

I have mounted an android system image using the command:

sudo mount -t ext4 -o loop system.img sys/ 

When I go into the mount point, all of the files are easy to open. I can go through just about everything. The problem comes when I try to edit the files. I cannot save anything. It says that there is not space left on the device. I have plenty of space left on the device itself, so that means that the mount point is out of space.

No big deal, right? Wrong. I tried deleting some files that were much bigger than the one I was trying to overwrite, but the same problem happened. In fact, the total disk size actually shrunk by the amount I had removed, once again leaving me at 0 free space.

How can I fix this?

Best Answer

If the img file in your /etc/fstab? If it is it may be listed as being mounted in a read-only state (ro). You can either edit fstab to change ro to rw or you can explicitly state to mount the img file as read-write from the commandline by adding rw option after -o in your mount command.

sudo mount -t ext4 -o loop,rw system.img sys/

If you are still short on free space you may need to resize the image file. This can be done with GUI GParted via sudo gparted /dev/loop0 then use menus to make the file larger so you have some free space to work with.