Skip to content

Instantly share code, notes, and snippets.

@mabako
Created March 9, 2014 05:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mabako/9443420 to your computer and use it in GitHub Desktop.
Save mabako/9443420 to your computer and use it in GitHub Desktop.
raspberry pi image stuff

Flash image to sdcard (/dev/sdc)

$ dd bs=4M if=raspbian.img of=/dev/sdc

Export from sdcard

$ dd if=/dev/sdc of=raspberry.img bs=1M conv=notrunc,noerror

Status of dd

$ pkill -USR1 -n -x dd

Mounting paritions

$ fdisk -l raspberry.img

Disk raspberry.img: 3003 MB, 3003125760 bytes
255 heads, 63 sectors/track, 365 cylinders, total 5865480 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000981cb

        Device Boot      Start         End      Blocks   Id  System
raspberry.img1            8192      122879       57344    c  W95 FAT32 (LBA)
raspberry.img2          122880     5785599     2831360   83  Linux

$ losetup -o4194304 /dev/loop0 raspberry.img
$ losetup -o62914560 /dev/loop1 raspberry.img

$ losetup -d /dev/loop0
$ losetup -d /dev/loop1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment