Skip to content

Instantly share code, notes, and snippets.

@jdupl
Created September 9, 2015 22:10
Show Gist options
  • Save jdupl/ce8d713b96d8abc5fc55 to your computer and use it in GitHub Desktop.
Save jdupl/ce8d713b96d8abc5fc55 to your computer and use it in GitHub Desktop.
find ext4 partition offset
bs=512
for i in {1..10000000}; do
echo ">>>>$i"
mount -o offset=$(($bs*$i)) -t ext4 /dev/sda1 /mnt
if [ $? == 0 ]; then
echo "Found ext4 at $(($bs*$i)) bytes !"
umount /mnt
break
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment