Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Raw commands for copying an Ubilinux image to an SD card.
# connect an SD card and mount it. Assuming Arduino expansion board. Also, mount the / partition into the rootcopy folder.
mkdir /home/sdcard
mkdir /home/rootcopy
mkdir /home/sdcard/image
mount /dev/mmcblk0p8 /home/rootcopy
mount /dev/mmcblk1p1 /home/sdcard
# copy the operating system to an empty ext4 image
dd if=/dev/zero of=/home/sdcard/edison-image-edison.ext4 count=1500 bs=1M iflag=fullblock
mkfs.ext4 /home/sdcard/edison-image-edison.ext4
mount /home/sdcard/edison-image-edison.ext4 /home/sdcard/image
cp -r /home/rootcopy/* /home/sdcard/image/
#unmount and cleanup
umount /home/sdcard/image
rm -r /home/sdcard/image
umount /home/sdcard
umount /home/rootcopy
rm -r /home/sdcard
rm -r /home/rootcopy
# thanks to Nick Chase for an updated dd command and checking through everything.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment