Forum
  • Search
  • Member List
  • Calendar
Hello There, Guest! Login Register — Login with Facebook

Live backup with dd
Thank you for your donation

Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Threaded Mode | Linear Mode
Live backup with dd
9th Mar, 2013, 10:16 PM
Post: #1
effemmeffe Offline
Registered
Posts: 127
Joined: Jan 2013
Reputation: 1
Live backup with dd
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.
Find all posts by this user
Quote this message in a reply
9th Mar, 2013, 10:37 PM
Post: #2
CurlyMo Offline
Registered
Posts: 3,501
Joined: Dec 2012
Reputation: 202
RE: Live backup with dd
Yes, that's possible just the way you describe

pilight - modular domotica solution
Visit this user's website Find all posts by this user
Quote this message in a reply
9th Mar, 2013, 10:43 PM
Post: #3
effemmeffe Offline
Registered
Posts: 127
Joined: Jan 2013
Reputation: 1
RE: Live backup with dd
(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?
Find all posts by this user
Quote this message in a reply
9th Mar, 2013, 10:47 PM
Post: #4
CurlyMo Offline
Registered
Posts: 3,501
Joined: Dec 2012
Reputation: 202
RE: Live backup with dd
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.

pilight - modular domotica solution
Visit this user's website Find all posts by this user
Quote this message in a reply
9th Mar, 2013, 11:02 PM
Post: #5
effemmeffe Offline
Registered
Posts: 127
Joined: Jan 2013
Reputation: 1
RE: Live backup with dd
Thanks.
I tried and I got a img file 3.91G big.
My SD is 4G nominal, where are those missing bytes?
Find all posts by this user
Quote this message in a reply
9th Mar, 2013, 11:07 PM
Post: #6
namtih Offline
Tester
Posts: 269
Joined: Dec 2012
Reputation: 28
RE: Live backup with dd
It's correct as you don't have really 4GB.
You have to divide with 1024 and not 1000:
4000 / 1024 = 3,91.
Find all posts by this user
Quote this message in a reply
10th Mar, 2013, 02:31 AM
Post: #7
effemmeffe Offline
Registered
Posts: 127
Joined: Jan 2013
Reputation: 1
RE: Live backup with dd
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.
Find all posts by this user
Quote this message in a reply
10th Mar, 2013, 02:51 AM
Post: #8
CurlyMo Offline
Registered
Posts: 3,501
Joined: Dec 2012
Reputation: 202
RE: Live backup with dd
Hmm. (firmware) developers, we could use those Smile Let us know if you're interested...

pilight - modular domotica solution
Visit this user's website Find all posts by this user
Quote this message in a reply
10th Mar, 2013, 02:54 AM
Post: #9
Koenkk Offline
Registered
Posts: 1,238
Joined: Dec 2012
Reputation: 112
Live backup with dd
(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

Please read rules and do a search before you post! . FAQs . How to post log file? . Looking for answers? Please start here
Find all posts by this user
Quote this message in a reply
7th May, 2013, 08:07 PM
Post: #10
RoRoo Offline
Registered
Posts: 5
Joined: May 2013
Reputation: 0
RE: Live backup with dd
(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
Find all posts by this user
Quote this message in a reply
7th May, 2013, 08:11 PM
Post: #11
effemmeffe Offline
Registered
Posts: 127
Joined: Jan 2013
Reputation: 1
RE: Live backup with dd
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?
Find all posts by this user
Quote this message in a reply
7th May, 2013, 08:27 PM
Post: #12
RoRoo Offline
Registered
Posts: 5
Joined: May 2013
Reputation: 0
RE: Live backup with dd
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
Find all posts by this user
Quote this message in a reply
29th May, 2013, 05:55 PM
Post: #13
effemmeffe Offline
Registered
Posts: 127
Joined: Jan 2013
Reputation: 1
RE: Live backup with dd
(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?
Find all posts by this user
Quote this message in a reply
29th May, 2013, 07:06 PM
Post: #14
rikardo1979 Offline
Management
******
Posts: 3,545
Joined: Dec 2012
Reputation: 190
Re: Live backup with dd
mk01 is our developer so you need to talk to him Wink

~~~~>>>Please always follow rules and read before you post<<<~~~~
Find all posts by this user
Quote this message in a reply
« Next Oldest | Next Newest »
Post Reply 


  • View a Printable Version
  • Send this Thread to a Friend
  • Subscribe to this thread
Forum Jump:

Current time: 10th May, 2025, 04:32 AM Powered By MyBB, © 2002-2025 MyBB Group.