Skip to content

Instantly share code, notes, and snippets.

@ymollard
Last active October 20, 2021 20:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ymollard/b306fb734111f0d6f837e4d97ca7d16b to your computer and use it in GitHub Desktop.
Save ymollard/b306fb734111f0d6f837e4d97ca7d16b to your computer and use it in GitHub Desktop.
losetup: 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.

Save few MB on Raspi

~/mnt/usr/share/rpd-wallpaper$ sudo rm -f aurora.jpg balloon.jpg bridge.jpg canyon.jpg cliff.jpg clouds.jpg fisherman.jpg fjord.jpg islands.jpg lasers.jpg mountain.jpg road.jpg sand.jpg trees.jpg waterfall.jpg 

rm chromium-browser-v7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment