Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Mount an img file with multiple partitions to edit files in them
sudo losetup 2020-10-23-poppy-torso.img -Pf
ll /dev/loop*

Then find the partition there eg /dev/loop15p2

mdkir -p mnt
sudo mount /dev/loop15p2 mnt/

Edit whatever file you want in mnt/ and unmount it:

sudo umount mnt/

The img file is now up-to-date with your changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment