Skip to content

Instantly share code, notes, and snippets.

@hyukishi
Last active August 8, 2024 17:31
Show Gist options
  • Select an option

  • Save hyukishi/adb3c70139b84162083b5f86b79894f5 to your computer and use it in GitHub Desktop.

Select an option

Save hyukishi/adb3c70139b84162083b5f86b79894f5 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Created by Jeffery Grantham 1/8/2019
# Usage: piholeimgmount.sh [image]
# This script assumes that you've already made a folder under /mnt called loop
# It will attempt to create the directory if it is not found.
# If it fails, the user account running the script does not have rights to do so.
# This script will not work with berryboot installed images.
# It is only designed to work with raspbian-based images as it has already calculated
# the offset at which your Linux partition begins
image=$1
if [ ! -d /mnt/loop ]; then
mkdir -p /mnt/loop
fi
mount -o loop,offset=50331648 $image /mnt/loop/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment