Skip to content

Instantly share code, notes, and snippets.

@dotCipher
Created July 7, 2016 05:25
Show Gist options
  • Save dotCipher/e6c24f5e53636bf6e9923c83fe6e36b7 to your computer and use it in GitHub Desktop.
Save dotCipher/e6c24f5e53636bf6e9923c83fe6e36b7 to your computer and use it in GitHub Desktop.
Notes for Raspberry Pi hacking

Raspberry Pi Notes

Reformatting SD Card

Get the list of devices:

sudo diskutil list

Find which is the SD card, then run:

diskutil eraseDisk FAT32 PIXEL MBRFormat /dev/disk2 where /dev/disk2 is the device we found as the SD card

Then we unmount the drive:

sudo umount disk2

And all subparitions:

diskutil umount disk2s1

Finally make it bootable with:

sudo dd bs=4M if=./ubuntu-minimal-16.04-server-armhf-raspberry-pi.img.xz of=/dev/disk2

Expanding the filesystem

After you are booted into the Pi, if you have a command prompt you should be able to check and see if the full partition of the SD card was used for your file system by running:

df -h

Determine the storage devices:

ll /dev/mm*

Check the partition table of the device:

sudo fdisk /dev/mmcblk0 -l

Inspect the cylinder, head and sector addresses:

sudo parted /dev/mmcblk0 unit chs print

References:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment