Skip to content

Instantly share code, notes, and snippets.

@dmazzer
Last active December 14, 2020 17:29
Show Gist options
  • Save dmazzer/f6af807113b2f72a12a07432b862256f to your computer and use it in GitHub Desktop.
Save dmazzer/f6af807113b2f72a12a07432b862256f to your computer and use it in GitHub Desktop.
mount rpi-sdimg
# source: https://raspberrypi.stackexchange.com/questions/13137/how-can-i-mount-a-raspberry-pi-linux-distro-image
IMAGE_FILE="YOUR IMAGE FILE GOES HERE"
TMP=$(mktemp -d)
LOOP=$(sudo losetup --show -fP "${IMAGE_FILE}")
sudo mount ${LOOP}p2 $TMP
sudo mount ${LOOP}p1 $TMP/boot/
# do stuff to ${TMP}/ which is rpi filesystem
# cleanup
umount ${TMP}/boot/
umount ${TMP}
rmdir ${TMP}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment