New IT forum Follow us on Twitter
23 May 2012, 04:52:24 pm *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: EFIKA MX now in stock!
 
   Home   SHOP Help Search Login Register  
Pages: [1]
  Print  
Author Topic: How to do regular backup of SD  (Read 1096 times)
MatteoBP
Newbie
*
Posts: 24


« on: 12 January 2011, 05:10:49 pm »

I have the eSata Sheevaplug multi-boot, configured for boot from SD and I have an attached SATA HD.
I'm used to do regular backup of the SD card on a partition of the SATA HD in this way. I have created a folder on that partition called sheeva.

1. shutdown the plug
2. remove the SD card
3. power on the plug (that will boot from NAND)
4. after boot, insert the SD card
5. mount the partition of the SATA HD with this command (replace mountname properly):
# mount -t ext4 -o rw,relatime,errors=remount-ro /dev/sda1 /mnt/mountname
6. do the backup with this command:
# dd if=/dev/mmcblk0 | gzip -9 > /mnt/mountname/sheeva/$(echo "`date '+%Y%m%0d'`").img.gz

In this way, it will create a file named with the date, for example 20110112.img.gz, so I can keep also an history.
I created an executable script file with these commands, saved on the NAND file system, so I have just to run that script for the backup of the SD.

If someone knows a better way to do it, let me know, otherwise, I hope this can help other users.

Matteo

Logged
NewIT_Marcus
Administrator
Hero Member
*****
Posts: 960


« Reply #1 on: 12 January 2011, 06:05:26 pm »

We think that this is a good solution, even if it isn't automated.

Pros:
  • It backs up everything on the SD card, including the partitioning info
  • Easy and quick. Well, quick is relative, I suppose - depending upon the size of your SD card, but the entire procedure should take less than an hour. Doesn't require any special configuration / setup of backup software.
  • Fairly straightfoward method for identifying backup set (by date)

Cons:
  • Can't be automated
  • Can be a little awkward to retrieve individual files from backup (decompress / mount / extract)

In many cases the cons will be acceptable, and preferable to a solution that involves manually deciding which directories are to be backed up.
Logged
MatteoBP
Newbie
*
Posts: 24


« Reply #2 on: 13 January 2011, 10:46:16 am »

Quote
We think that this is a good solution, even if it isn't automated.

Pros:

    * It backs up everything on the SD card, including the partitioning info
    * Easy and quick. Well, quick is relative, I suppose - depending upon the size of your SD card, but the entire procedure should take less than an hour. Doesn't require any special configuration / setup of backup software.
    * Fairly straightfoward method for identifying backup set (by date)


Cons:

    * Can't be automated

It would be nice if you could restart the system by setting the next reboot from NAND rather than SD, on the NAND you have the script that start automatically the backup and at the end it restart the system setting the next reboot from SD.
But I think it is impossibile to do so far.

Quote
    * Can be a little awkward to retrieve individual files from backup (decompress / mount / extract)

About this cons, if you want you can create the image uncompressed, or create a better script that for example first compress the old backup image in that folder, then create a new image, so you have the old one zipped and a new one uncompressed.
You can create a script that mount the image with a command like this:

# cd mnt/mountname/sheeva
# mount -o loop,offset=12615680 -t auto /mnt/mountname/sheeva/$(ls *.img) /mnt/rootfsbck
(this is the offset of the second partition on my SD)
Or you can create two separate images for the two partition on the SD card, so the mount is simpler.

Quote
In many cases the cons will be acceptable, and preferable to a solution that involves manually deciding which directories are to be backed up.

This is a backup of the whole system, like the backup that you can do on other system using software like Acronis True Image or Norton Ghost. It is not for data backup. If the SD card dies, you can restore the system very quickly on another SD. Moreover, I moved /var folder and /home folder on the attached SATA HD.
Logged
cbalmforth
Newbie
*
Posts: 8


« Reply #3 on: 11 May 2011, 02:45:04 pm »

Thanks for this.

I have found it much quicker to remove the SD card from my DreamPlug and backup on my (faster) Linux desktop machine.

Chris
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!