backing up NAND?


antisol

Member
Joined
Feb 9, 2014
Messages
74
Hi,

I'd like to be able to back up my NAND so that I can keep customisations I've made if I need to re-flash.

This will obviously involve creating a new rootfs.img file to replace the SZ one.

I guess that I can probably use dd to read the nand directly, but which device should I be reading - maybe one of the /dev/mtdX devices?

Also I expect I'll probably need to back up my /boot, creating a new bootf.tgz file. Is this necessary? will "tar zcf /media/sd/bootf.tgz" be sufficient?

Any tips would be appreciated. sorry if this is an obvious question - I searched the wiki and boards but didn't find anything. I was hoping maybe there was a script for this?

Thanks!
 
Linux backups are dead simple, just use tar to grab everything except /media, /mnt, /dev, /sys, and /proc.

sudo su
<enter password>
cd /
tar cvpzf /media/SDCARD/backup.tgz --exclude=/proc --exclude=/mnt --exclude=/sys --exclude=/media --exclude=/dev
/boot is not a special partition on the NAND (it is on SD cards only because uboot can't boot from EXT3 partitions) so there's no need to back it up separately.Restoring is the opposite: boot from an SD card (you can even extract your backup.tgz to the SD card, taking care to then copy /boot to a FAT32 partition) and then mount the NAND (which I forget offhand how to do but it's in the wiki somewhere) and format/extract the backup to it.
 
  • Install Pandian
  • Mount the internal NAND to some place (/mnt?)
  • Copy everything to the new place (use "--archive" option) or archive/tar it (use "--numeric-owner" option)
This method has the advantage of not screw things up and you won't need to exclude any folders from the operation. If you're using the system while its being backed up, then you're trying to backup a always-moving system (not good).
You could also try to remount the filesystem as read-only, but this solution won't give the chance to services terminate and leave the system (files) in a proper state.
 
Last edited by a moderator:
Thanks for the replies.

I was hoping to make a new flashable image to make the restore process that much easier (i.e: stick in the recovery card, boot from it via the menu, and wati while it flashes) but tar will work in a pinch.

Running SZ from an SD card sounds like an interesting idea - no problems with space limitations and opkg! :)
 
Back
Top