Reply
Thread Tools
Posts: 50 | Thanked: 2 times | Joined on Jan 2007
#1
So last night I decided to take the plunge and both update my N800 internal flash to the current rev, and set it up for booting from mmc at the same time. I believe I've got it working fine, but I have two questions in regards to maintaining a solid system...

1. I have read (notably here) that one caveat of booting off mmc is the propensity for the card to be get corrupted, and that a "fsck -fy /dev/mmcblk0p2" needs to be run every now and again. If that is the case, is it a bad idea to simply run this command on every boot, especially since I hardly ever turn off/reboot the device? Will it be painfully slow? If it's not a bad idea, is there a boot script that would be an ideal place to run the command?

2. One of my intentions for booting off mmc is to maintain a baseline system on my powerbook so I can simply replace the necessary file structure if things go bad. Is there an ideal system to for doing this? Can I simply make a .dmg of the FAT partition, drag and drop the entire directory tree, and keep it safe? Or should I use a tar command to preserve it? Am I even correct in assuming that saving the contents of the FAT partition will enable me to get back to a default state quickly? I believe I read that as one of the benefits somewhere.

I'm not a Linux n00b, but I'm also not an everyday user, so please be gentle.
 
Posts: 2,152 | Thanked: 1,490 times | Joined on Jan 2006 @ Czech Republic
#2
Originally Posted by crackhead View Post
1. I have read (notably here) that one caveat of booting off mmc is the propensity for the card to be get corrupted, and that a "fsck -fy /dev/mmcblk0p2" needs to be run every now and again. If that is the case, is it a bad idea to simply run this command on every boot, especially since I hardly ever turn off/reboot the device? Will it be painfully slow? If it's not a bad idea, is there a boot script that would be an ideal place to run the command?
It is easier to use ext3. it is not needed then and result is same or better. Try to search this forum I think I explained few times how to do it.

As for fsck, well there is no fsck in initfs (which mounts the ext2 rootfs) and when the system already boots into rootfs where fsck.ext2 may be available, it is too late. You could remount rootfs read only and then run it and them probably reboot if it did some modifications (not sure how to check for this, probably some fsck exit code). fsck.ext2 could be added to initfs but using ext3 is better idea.
Originally Posted by crackhead View Post
Am I even correct in assuming that saving the contents of the FAT partition will enable me to get back to a default state quickly? I believe I read that as one of the benefits somewhere.
Booting from mmc does not use FAT partition at all (except optional swapfile), did you mean EXT2 instead of FAT? Best for rootfs backup is to use GNU tar in case your rootfs is ext2/3 (i.e. mmc) and mkfs.jffs2 for rootfs in flash -then you can just reflash with the backup jffs2 image. Again search this forum for 'mkfs.jff2' or 'sumtool' for guide how to make backup image of flash directly on device. As for transferring backup to computer, both tar and mkfs.jffs2 could be run over ssh to backup directly to file on the PC or you could just copy it later over USB if you backup to file on FAT partition.
 
Posts: 50 | Thanked: 2 times | Joined on Jan 2007
#3
Yeah after I posted that I noticed that the FAT partition was empty. Incidentally, I created a disk image in OSX Disk Utility of the entire mmc. It recognized all the partitions and their formats...even though it couldn't mount the ext2 ones. My original intention was just to be able to burn the image back on the mmc in case of a catastrophic error, but I have a feeling that this simply won't work. Right? (I told you I was new at this!)

User schmots wrote in his blog (http://schmots.blogspot.com/) that running "fsck -fy" on mmcblk0p2 after booting from internal flash would clear up corruption issues. The post itself was informative to me. Is his advice atually incorrect? If so, someone should tell him.

I'll look for mkfs.jffs2 and sumtool asap! I just needed a push in the right direction. Thanks...
 
Posts: 2,152 | Thanked: 1,490 times | Joined on Jan 2006 @ Czech Republic
#4
Originally Posted by crackhead View Post
User schmots wrote in his blog (http://schmots.blogspot.com/) that running "fsck -fy" on mmcblk0p2 after booting from internal flash would clear up corruption issues. The post itself was informative to me. Is his advice atually incorrect? If so, someone should tell him.
You can run it but you need to boot from different rootfs (i.e. flash or other partition then mmcblk0p2 ) so the partition is not used at the time you do it


Originally Posted by crackhead View Post
I'll look for mkfs.jffs2 and sumtool asap! I just needed a push in the right direction. Thanks...
These are needed only if you want to backup internal flash, not system on mmc (unless you want it to restore it to internal flash later). For backing up ext2, creating gzipped tar archive to FAT partition (when booted from internal flash) may be the best option. Later you can boot from internal flash again and restore it. The procedure is similar to cloning i.e. you mount mmc partition somewhere (like /opt) and then run something like
Code:
cd /opt
/path/to/GNU/tar -zcvf /media/mmcX/mybackup.tgz .
to back it up or
Code:
cd /opt
/path/to/GNU/tar -zxvf /media/mmcX/mybackup.tgz
to restore it (on reformatted partition)
 
Reply


 
Forum Jump


All times are GMT. The time now is 22:43.