7

I have downloaded a .img file to use on my Android device.

I have to edit a file in the image in order to use it.

How can I mount the file so I can edit the text file and then re-pack the .img?

LiveWireBT
  • 28,405
  • 26
  • 107
  • 221
Rasmus
  • 8,115
  • 11
  • 45
  • 72

1 Answers1

6

Did you try the standard o loop mount?

mount -o loop file.img /mnt/img

then edit and unmount normally

umount /mnt/img/

Matt Mootz
  • 569
  • 3
  • 10
  • I have now, and I get 'mount: you must specify the filesystem type ' in return. – Rasmus Dec 07 '11 at 15:38
  • 4
    @Rasmus: it is a partition or disk image? In the second case you need to use an appropriate offset in `-o loop,offset=NUMBER`. – enzotib Dec 13 '11 at 08:14
  • 1
    @Rasmus Since your question seems to be about Android images, it may be a bit more difficult, you you would probably need to unpack and repack the whole image again. http://askubuntu.com/a/129388/40581 – LiveWireBT Nov 15 '14 at 00:40
  • 1
    If your image contains multiple partitions, you have to set an offset-value as explained [here](https://askubuntu.com/a/538942). – Suuuehgi Oct 01 '17 at 10:03