Title: Mounted Android System.img unable to edit
Tags: mount;android;mountpoint;hacking
Question: 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?



Here is another answer: [Answer]
This was apparently a bug in Ubuntu. The way that I got around it was by using the ```resize2fs``` command to make the partition file bigger. The exact command I ran was ```sudo resize2fs system.img 520M``` 
NOTE: You may have to run ```sudo resize2fs system.img 1000M``` first and then reduce the size back to ```520M``` by using the command above. 


Here is another 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.


{'source': 'StackExchangeDataset', 'subset': 'askubuntu.com', 'metadata': {'AnswerCount': 2, 'CommentCount': 0, 'ContentLicense': 'CC BY-SA 3.0', 'CreationDate': '2016:00:03/13/16', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<mount><android><mountpoint><hacking>', 'Title': 'Mounted Android System.img unable to edit', 'ViewCount': 7364, 'id': 745348, 'user_AboutMe': '<p>Hi.</p>\n', 'user_AccountId': 7790873.0, 'user_DisplayName': 'user154248', 'user_Reputation': 101.0, 'user_Views': 5.0, 'user_id': 518053.0}}