Last active
June 18, 2020 19:12
-
-
Save WillNilges/ec34a1c6eaff2040dc6464e65bf4628f to your computer and use it in GitHub Desktop.
This simple script will mount a raspberry pi image on your computer so you can mess with it.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
headstart=$(sudo fdisk -l $1 | grep img2 | awk -F" " '{ print $2 }') | |
echo $headstart | |
if [ -z ${2+x} ]; then | |
mountpoint='/mnt/raspberry' | |
else | |
mountpoint=$2 | |
fi | |
sudo mkdir $mountpoint | |
sudo mount -v -o offset=$(expr 512 \* $headstart) -t ext4 $1 $mountpoint |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment