maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Troubleshooting (https://talk.maemo.org/forumdisplay.php?f=6)
-   -   Error with DD for /dev/mtdblock4?? (https://talk.maemo.org/showthread.php?t=17003)

psykosis 2008-02-22 06:28

Error with DD for /dev/mtdblock4??
 
While testing the speed of my various SD cards, I also tested the internal flash with the command:

Code:

time dd if=/dev/mtdblock4 of=/dev/null bs=8192 count=10240
Which resulted in:

Code:

dd: /dev/mtdblock4: Input/output error
Command exited with non-zero status 1
real    0m 4.02s
user    0m 0.03s
sys    0m 1.60s

Unfortunately, I am not aware of the usage of the dd command, but it hits me odd that it would produce an input/output error.

Should I be concerned?

fanoush 2008-02-22 06:53

Re: Error with DD for /dev/mtdblock4??
 
Well, yes, that's odd but maybe it is not a problem. After running dd run also dmesg and see end of kernel log. What sort of i/o error you see? Flash memory can have few bad blocks but those should be automatically marked as bad and skipped. See also kernel log right after boot when mtd devices are detected and scanned.

psykosis 2008-02-22 07:05

Re: Error with DD for /dev/mtdblock4??
 
Here are the relevant lines from dmesg:

Code:

[  449.539062] onenand_wait: controller error = 0x2440
[  449.539062] end_request: I/O error, dev mtdblock4, sector 134400
[  449.539062] Buffer I/O error on device mtdblock4, logical block 16800
[  449.539062] onenand_wait: controller error = 0x2440
[  449.539062] end_request: I/O error, dev mtdblock4, sector 134408
[  449.539062] Buffer I/O error on device mtdblock4, logical block 16801
[  449.546875] onenand_wait: controller error = 0x2440
[  449.546875] end_request: I/O error, dev mtdblock4, sector 134400
[  449.546875] Buffer I/O error on device mtdblock4, logical block 16800


fanoush 2008-02-22 09:58

Re: Error with DD for /dev/mtdblock4??
 
Such errors look exactly like having bad blocks in the flash and are somewhat 'normal'. Flash memory can have few bad blocks from factory (similar to bad pixels on LCD monitors), when device boots it scans for them and should not use them, here is my output with N810

Code:

[    0.570312] OMAP2 OneNAND driver initializing
[    0.570312] omap2-onenand omap2-onenand: initializing on CS0, phys base 0x04000000, virtual base c8880000
[    0.570312] OneNAND Manufacturer: Samsung (0xec)
[    0.570312] Muxed OneNAND 256MB 1.8V 16-bit (0x40)
[    0.570312] OneNAND version 0x0022
[    0.593750] Scanning device for bad blocks
[    0.679687] onenand_bbt_wait: controller error = 0x2440
[    0.679687] Bad eraseblock 1399 at 0x0aee0000
[    0.718750] Creating 5 MTD partitions on "omap2-onenand":
[    0.718750] 0x00000000-0x00020000 : "bootloader"
[    0.718750] 0x00020000-0x00080000 : "config"
[    0.718750] 0x00080000-0x00280000 : "kernel"
[    0.726562] 0x00280000-0x00480000 : "initfs"
[    0.726562] 0x00480000-0x10000000 : "rootfs"

I have one bad block in rootfs too and reading whole /dev/mtdblock4 via dd fails for me too (with same error). Jffs2 filesystem should detect it and skip. At least I hope so :-)

psykosis 2008-02-22 13:39

Re: Error with DD for /dev/mtdblock4??
 
Thank you fanoush for relieving my anxieties than my new toy was already doing death throws. :)

fanoush 2008-02-22 14:27

Re: Error with DD for /dev/mtdblock4??
 
Well you may call it bad luck but it is not a big issue. One erase block (= group of flash blocks used as whole unit) is 128KB on Nokia tablets which is quite small part of full 256MB. I've seen like 6 770s, one N800 and two N810s and most of them have bad blocks. The failed dd test surprised me too, though. But it makes sense, for reading and writing one should use specific tools - nanddump and nandwrite from mtd-utils package which skip bad blocks. You can get nanddump from my initfs flasher If you still want to measure the speed or just use skip= parameter of dd to read different part of flash.

Code:

time dd if=/dev/mtdblock4 of=/dev/null bs=8192 count=10240 skip=10240


All times are GMT. The time now is 05:00.

vBulletin® Version 3.8.8