Backing up the SD card - what's difference .bin vs. .img? - Raspberry Pi Forums


it seems raspberry pi operating system , projects distributed .img files. , have read if want backup sd card .img file using program called win32diskimager described elsewhere in forum. however, not have windows box. have ubuntu desktop box card reader , have read in several places (including here) can use linux dd program, creates .bin files. questions are:

1. there practical difference between making .bin file or .img file use backup? new @ if sd card fail or become corrupted, or make dumb mistake , erase valuable, need able restore , quickly. either format preferable purpose?

2. if .img preferred format, there way create .img file using dd or other tool under ubuntu linux? or, alternately, can .bin file converted .img file , there advantage in doing so?

3. sites tell add block size parameter (bs=1m) when making backup using dd. or bad advice?

4. there way backup produce .img (or .bin, if equivalent) file not require removing card raspberry pi? ideally i'd run once week automatically (i'm guessing done cron job?) in middle of night , @ more convenient time copy backup file machine on network.

if can answer or of these helpful me, , maybe other new users.

hi anik,

1. both win32diskimager , dd create exact bit bit copies of sd card. neither image (e.g. no compression) , nothing added or taken away - if ran both tools take copy of sdcard , compared 2 files, (should) identical. .bin , .img extensions conventions , call like. i.e. can use dd create .img file - name.

2. files identical there no need convert them. rename job!

3. 'bs' option tells dd how read , write @ 1 go - default reads 512 bytes @ time - copy sdcard reads 512 bytes sdcard buffer in memory - writes 512 bytes disk, reads 512 bytes sdcard , writes that. if specify bs=1m read 1mbyte internal memory , write out file, read 1mbyte , on. typically 1 read of 1mbyte quicker 2048 reads of 512 bytes using bs=1m speeds things @ cost of making dd use more memory buffer.

4. can copy sdcard while pi running, copying live filesystem , filesystem changing while copying it. can (will) end copy isn't consistent. copy 'backup' sdcard later you'd find want filesystem check repair filesystem(s) when started machine , there possibility couldn't repair them - not ideal way backup. there ways backup files live filesystem - doing dd copy raw sdcard isn't way!

hope helps
graham


raspberrypi



Comments

Popular posts from this blog

Thread: PKI Client 5.00 install (for eToken Pro)

ATmega2560-Arduino Pin Mapping

Crossfader Arduino Tutorial