NAND to SD


pmprog

DNF (Did Not Finish)
Joined
Apr 25, 2011
Messages
4,150
I know we've got a tool to make a bootable SD card from the firmware, but do we have one that can clone our current NAND to one? I would like to make an SD card with all the dev tools on, but I want to keep all the settings I've set up on my NAND.


Also would it be possible to use the extra SD card space in the new "image"?


Cheers
 
I asked about this a few years ago.. I forget why I think ED had mentioned that it couldn't be done for some strange reason? ( Or it could have been a response of that no one had done it yet at the time ) Feel free to correct me anyone else.
 
Call me n00b, but do you think you could just format the SD card ext2, copy all the filestructure across and install GRUB (or some other boot loader) on it?


Hmmm, wonder if we could use something like Clonezilla? Might try building a Pandora version of that later, and seeing if it works
 
No need grub, the bootloader is uBoot, and is embedded in the NAND. Just need to create the autoboot.txt/boot.txt.


/etc/fstab must be edited.


Also maybe some stuff in init scripts.
 
Can you just filecopy the system onto the SD card? How would I go about doing that? I'm assuming it'd need to exclude the /media, /dev and a few other paths?
 
/media is supposed to be empty, and anyway, only contains folders.


I don't know exacltly about /dev. Should not be a big deal to include it and see what happens.


Some time ago, to clone a PC, i used cpio to create an archive, then decompressed it on target.
 
Last edited by a moderator:
mabe this only works for backup purposes, but i seem to remember "sudo cp / /media/sdcard1" being a thing. Not sure if that command is exactly right but cant you just clone the nand to an sd card and boot off it?
 
mabe this only works for backup purposes, but i seem to remember "sudo cp / /media/sdcard1" being a thing. Not sure if that command is exactly right but cant you just clone the nand to an sd card and boot off it?
No idea, that's why I asked...I'll try it later (hopefully)
 
First of all, double-mount the root-filesystem somewhere else, so that you can copy everything in it, including the contents of dirs that have something mounted over them (f.ex: /dev). Something like mount -o bind / /media/nand (the dir must exist, and should be empty).


Then sudo cp -a /media/nand /media/sdcard1 should do the trick. The flag -a causes cp to copy everything, and preserve all metadata, attributes etc.


You will then have to properly configure the bootloader, modify the /etc/fstab on the sdcard to point to your sdcard instead of the nand, and perhaps some other misc. bits and bytes here and there.


As for the filesystem: ext4 should be your first choice. It's (much) faster than ext2, and its journal can be disabled if you must. (but only do so if your Pandora is rocksolid stable (never has a kernel panic), and never runs out of juice. And even then: MAKE BACKUPS!)
 
Doing exactly this is all covered very well in the Wiki.


http://www.pandorawiki.org/Running_Linux_from_an_SD_card


What you are trying to do is 'Option 2' where you copy the OS from your NAND to the SD card.


You can make the OS partition any size up to the max of the card.


To boot it the first time, you don't need autoboot.txt written, but you do need boot.txt written AND to hold the right shoulder button on the reboot. Sorry if that sounds more complicated than it is.


Anyway - option 2 is pretty solid and preferred by control freaks everywhere. :)
 
Thanks for the link, I'd been to that page before, but only seen the firmware copy bit - obviously overlooked the NAND copy.


Cheers
 
Urm, I did everything on here. created the autoboot.txt, and it booted to the NAND. Holding down R didn't even give me the boot from SD option :(
 
Probably because it's now /boot/uImage-3 in the autoboot.txt
My SD card does not have a /boot/uImage-3 file; there's /boot/uImage-2.6.2.57-omap1, and there's a /boot/uImage shortcut/symlink (guessing by the overlay in thunar)


So, I woul have thought it should be okay
 
I'm not downloading rootfs's... I'm following the instructions to copy my NAND to the SD card.
 
Nope, I'm running the last SZ beta (5?), what difference would that make?


I copied the autoboot.txt as described, though I needed to SUDO to write the file, is that a problem?
 
Back
Top