This is mostly for reference, but may be of use to others.
In order to mount an image (in order to be able to edit it), you can execute the following code:
1 2 3 |
dev=`sudo kpartx -a -v $FILE |tail -1|awk '{print $3}'` sudo mount /dev/mapper/$dev /mnt |
This is useful for editing one or more files in an image without needing to copy it to a device or card.