Forum
Live backup with dd - Printable Version

+- Forum (http://forum.xbian.org)
+-- Forum: Software (/forum-6.html)
+--- Forum: Configuration (/forum-17.html)
+--- Thread: Live backup with dd (/thread-598.html)



Live backup with dd - effemmeffe - 9th Mar, 2013 10:16 PM

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.


RE: Live backup with dd - CurlyMo - 9th Mar, 2013 10:37 PM

Yes, that's possible just the way you describe


RE: Live backup with dd - effemmeffe - 9th Mar, 2013 10:43 PM

(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?


RE: Live backup with dd - CurlyMo - 9th Mar, 2013 10:47 PM

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.


RE: Live backup with dd - effemmeffe - 9th Mar, 2013 11:02 PM

Thanks.
I tried and I got a img file 3.91G big.
My SD is 4G nominal, where are those missing bytes?


RE: Live backup with dd - namtih - 9th Mar, 2013 11:07 PM

It's correct as you don't have really 4GB.
You have to divide with 1024 and not 1000:
4000 / 1024 = 3,91.


RE: Live backup with dd - effemmeffe - 10th Mar, 2013 02:31 AM

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.


RE: Live backup with dd - CurlyMo - 10th Mar, 2013 02:51 AM

Hmm. (firmware) developers, we could use those Smile Let us know if you're interested...


Live backup with dd - Koenkk - 10th Mar, 2013 02:54 AM

(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


RE: Live backup with dd - RoRoo - 7th May, 2013 08:07 PM

(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


RE: Live backup with dd - effemmeffe - 7th May, 2013 08:11 PM

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?


RE: Live backup with dd - RoRoo - 7th May, 2013 08:27 PM

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


RE: Live backup with dd - effemmeffe - 29th May, 2013 05:55 PM

(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?


Re: Live backup with dd - rikardo1979 - 29th May, 2013 07:06 PM

mk01 is our developer so you need to talk to him Wink