Skip to content

Instantly share code, notes, and snippets.

@hansstimer
hansstimer / mkcard.sh
Created February 14, 2013 02:55 — forked from mattes/mkcard.sh
#!/bin/bash
# Quelle: http://omappedia.org/wiki/Minimal-FS_SD_Configuration, 06.06.2012
if [ ! "$1" = "/dev/sda" ] ; then
unset LANG
DRIVE=$1
if [ -b "$DRIVE" ] ; then
dd if=/dev/zero of=$DRIVE bs=1024 count=1024
SIZE=`fdisk -l $DRIVE | grep Disk | awk '{print $5}'`
echo DISK SIZE - $SIZE bytes
CYLINDERS=`echo $SIZE/255/63/512 | bc`