Forum

Full Version: Live backup with dd
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Is it possible to backup the entire sd card _while_ xbian is running?
I know I can put the sd in a card reader and backup it with dd bs=1m if=/devsdx of=/home/effemmeffe/xbian.img but I was wondering if I can do the same with a command line from xbian login or a cron job and place the backup image on a usb disk connected to the raspberry.
Yes, that's possible just the way you describe
(9th Mar, 2013 10:37 PM)CurlyMo Wrote: [ -> ]Yes, that's possible just the way you describe

I just don't know what is the x in my command line: which device do I have to use as input file?
To make an image just like the xbian image you download do:
Code:
dd if=/dev/mmbclk0 of=/media/usb/backup.img
Now you backup to your mounted usb drive.
Thanks.
I tried and I got a img file 3.91G big.
My SD is 4G nominal, where are those missing bytes?
It's correct as you don't have really 4GB.
You have to divide with 1024 and not 1000:
4000 / 1024 = 3,91.
Darn, I'm a firmware developer, I should've known better!
(I thought that 4G was for normal people and the sd was actually 4194304 bytes...)
Thanks.
Hmm. (firmware) developers, we could use those Smile Let us know if you're interested...
(10th Mar, 2013 02:51 AM)CurlyMo Wrote: [ -> ]Hmm. (firmware) developers, we could use those Smile Let us know if you're interested...

Sound very intresting indeedWink
(9th Mar, 2013 10:47 PM)CurlyMo Wrote: [ -> ]To make an image just like the xbian image you download do:
Code:
dd if=/dev/mmbclk0 of=/media/usb/backup.img
Now you backup to your mounted usb drive.

Nice one! Running one as we speak.. Is it as easy as running this to automate it using cron as root??
Code:
service xmbc stop
dd if=/dev/mmcblk0 of=/home/xbian/NASBackup/Xbian.img
service xbmc start
I'm not that great of a scripter Tongue
I run the dd line in a script in my cron daily folder. It's run as root, I also copy the image on a remote share along with a tar of /etc/ and /home/
Never thought about stopping and restarting xbmc, is that needed?
Don't know.. But when I just ran it, the system load went through the roof (as expected). so I just want to give the system some more resources Smile
(9th Mar, 2013 10:47 PM)CurlyMo Wrote: [ -> ]To make an image just like the xbian image you download do:
Code:
dd if=/dev/mmbclk0 of=/media/usb/backup.img
Now you backup to your mounted usb drive.

@CurlyMo, I found this thread: http://forum.xbian.org/thread-884.html in which the user mk01 says that there could be problems doing that. Or am I missing something?
Is still my command line valid to backup or should I change something?
mk01 is our developer so you need to talk to him Wink
Reference URL's