PDA

View Full Version : Cloning 2008 OS to SD problems


penguinbait
2007-11-14, 16:00
I used the following command to mount 2008 flash image under 2007.

mount -t jffs2 /dev/mtdblock4 /fls -o rw,rpsize=1024,rpuid=0,rpuid=30000


I relashed rootfs only so I could backup the 2008OS and clone prior to flashing Kernel and initfs. Save me some time trying to do this in 2008 when I need to find all kinds of tools to do it.

Anyway, the mount listed above works without incident. But when I try to tar up the OS, I am getting read errors.


Fanoush? any Ideas? am I missing something?

cd /fls
/usr/local/bin/tar -cvf /cpy/WORK/FLASH2008.tar .

I am root...

SAMPLE ERRORS.

/usr/local/bin/tar: ./etc/udev/links.conf: Read error at byte 0, reading 688 byt
es: Input/output error
./etc/udev/rules.d/
./etc/udev/rules.d/020_permissions.rules
./etc/udev/rules.d/z50_run.rules
./etc/udev/rules.d/n770.rules
./etc/udev/rules.d/z99_hal.rules
/usr/local/bin/tar: ./etc/udev/rules.d/z99_hal.rules: Read error at byte 0, read
ing 210 bytes: Input/output error
./etc/udev/rules.d/udev.rules
./etc/udev/permissions.rules
/usr/local/bin/tar: ./etc/udev/permissions.rules: Read error at byte 0, reading
1536 bytes: Input/output error
./etc/udev/run.rules
/usr/local/bin/tar: ./etc/udev/run.rules: Read error at byte 0, reading 441 byte
s: Input/output error
./etc/udev/n770.rules
/usr/local/bin/tar: ./etc/udev/n770.rules: Read error at byte 0, reading 801 byt
es: Input/output error




EDIT
This mount produces the same results...
mount -t jffs2 /dev/mtdblock4 /fls

penguinbait
2007-11-14, 16:15
Additional info from dmesg


[ 1017.105010] JFFS2 compression type 0x07 not available.
[ 1017.105041] Error: jffs2_decompress returned -5
[ 1017.105224] JFFS2 compression type 0x07 not available.
[ 1017.105255] Error: jffs2_decompress returned -5
[ 1017.128021] JFFS2 compression type 0x07 not available.
[ 1017.128082] Error: jffs2_decompress returned -5
[ 1017.128173] JFFS2 compression type 0x07 not available.
[ 1017.128204] Error: jffs2_decompress returned -5
[ 1017.151245] JFFS2 compression type 0x07 not available.
[ 1017.151275] Error: jffs2_decompress returned -5
[ 1017.151458] JFFS2 compression type 0x07 not available.
[ 1017.151489] Error: jffs2_decompress returned -5
[ 1017.174163] JFFS2 compression type 0x07 not available.
[ 1017.174224] Error: jffs2_decompress returned -5
[ 1017.174316] JFFS2 compression type 0x07 not available.
[ 1017.174346] Error: jffs2_decompress returned -5
[ 1017.197357] JFFS2 compression type 0x07 not available.
[ 1017.197418] Error: jffs2_decompress returned -5
[ 1017.197509] JFFS2 compression type 0x07 not available.
[ 1017.197540] Error: jffs2_decompress returned -5


So is a new jffs2 compression type used, does this mean only the new kernel can read this?

fanoush
2007-11-14, 16:16
Hmm sounds like it is worth trying to flash newer kernel with newer jffs2 code (and maybe also initfs). But this is indeed strange, on-disk jffs2 format shouldn't change between kernel version. What dmesg/kernel says while reading, any suspicious errors (like unknown comression method) in kernel log? Also maybe try to flash rootfs again?

penguinbait
2007-11-14, 16:21
I think we were replying at the same time, look above your post :D

That would be yes, kernel error present

penguinbait
2007-11-14, 16:32
Reflashed rootfs with same issue, I guess I need kernel and initfs??


Anything else to try?

fanoush
2007-11-14, 16:34
Or recompile older kernel with some more compression methods enabled if this one is in 2.6.18 at all. There are more compression types and any such method can be used for any block. At mkfs.jffs2 or write time more of them can be tried for each block and the best one is used depending on specific data in such block and compression result.

fanoush
2007-11-14, 16:38
easiest is to give up and flash new initfs and kernel, then reinstall bootmenu (and optionally boot older system if you have more partitions) and clone OS2008 from flash to mmc

penguinbait
2007-11-14, 16:40
easiest is to give up and flash new initfs and kernel, then reinstall bootmenu (and optionally boot older system if you have more partitions) and clone OS2008 from flash to mmc

So what your saying is, Man up and commit :D

OK OK, one last question, can you mount the rootfs image and extract directly from it?

fanoush
2007-11-14, 16:47
OK OK, one last question, can you mount the rootfs image and extract directly from it?
Not easily, not on the tablet. On PC you can setup fake mtd device (mtdram), copy image to it an then mount it. But you need RAM for whole rootfs image (really not a problem on PC but on the tablet ...). Google for details if you want to go this way.

penguinbait
2007-11-14, 16:53
Not easily, not on the tablet. On PC you can setup fake mtd device (mtdram), copy image to it an then mount it. But you need RAM for whole rootfs image (really not a problem on PC but on the tablet ...). Google for details if you want to go this way.

Thanks, I committed, its goin to take some getting used to.

Milhouse
2007-11-14, 17:00
No e2fsprogs (or even wget) on N800/OS2008 using the default repositories (+extras)... anyone got any suggestions where to find them or is it just a case of waiting (I'm guessing the latter)? :)

fanoush
2007-11-14, 17:05
Since I have more partitions I did the cloning in OS2007 where this is not a problem (unless you want to login via wi-fi :)

fanoush
2007-11-14, 19:11
No e2fsprogs (or even wget) on N800/OS2008 using the default repositories (+extras)... anyone got any suggestions where to find them
Oh, BTW, you can add base maemo chinook repository, e2fsprogs and wget are there. Just fill http://repository.maemo.org in first line and free non-free in last one leaving the middle empty.

I wonder if updated busybox has working tar ...

Milhouse
2007-11-14, 20:02
Oh, BTW, you can add base maemo chinook repository, e2fsprogs and wget are there. Just fill http://repository.maemo.org in first line and free non-free in last one leaving the middle empty.

I wonder if updated busybox has working tar ...

Thanks Fanoush - that worked a treat! :) My simplified cloning script also now supports OS2008 for anyone who wants a hassle free method of cloning the OS! :)

fanoush
2007-11-14, 20:17
so, umm, you have the bootmenu installed with new kernel and initfs? I got exactly zero useful feedback :-)

Milhouse
2007-11-14, 20:27
so, umm, you have the bootmenu installed with new kernel and initfs? I got exactly zero useful feedback :-)

Hi - yes, I just installed your latest bootmenu and it all went swimmingly, I didn't bother with telnet or dropbear though. I've now booted into a cloned OS 2008 on mmc2 and rebooted back into the internal flash. No hitches, no problems. Many thanks! :)

fanoush
2007-11-14, 20:34
Hi - yes, I just installed your latest bootmenu and it all went swimmingly, I didn't bother with telnet or dropbear though. I've now booted into a cloned OS 2008 on mmc2 and rebooted back into the internal flash. No hitches, no problems. Many thanks! :)
Thanks, one never knows until someone else tries it.