2009-09-04 03:45:29     Why can't i erase the partition

Document created by Aaronwu Employee on Aug 19, 2013
Version 1Show Document
  • View in full screen mode

2009-09-04 03:45:29     Why can't i erase the partition

michael zhu (UNITED STATES)

Message: 79600   

 

Hi all:

 

    I want to build a yaffs filesystem with uClinux version is:

 

   kernel:    Linux release 2.6.22.18-ADI-2008R1astfin-svn, build #36 Fri Sep 4 10:22:31 CST 2009

toolchain: bfin-linux-uclibc-gcc release gcc version 4.1.2 (ADI svn)

user-dist: release 2008R1, build #36 Fri Sep 4 10:23:02 CST 2009

 

  when bootm it seem had found nand flash:

 

  Creating 1 MTD partitions on "RAM":

0x00000000-0x01400000 : "ROMfs"

NAND device: Manufacturer ID: 0xec, Chip ID: 0xda (Samsung NAND 256MiB 3,3V 8-bit)

Scanning device for bad blocks

Bad eraseblock 51 at 0x00660000

Bad eraseblock 89 at 0x00b20000

Bad eraseblock 157 at 0x013a0000

Bad eraseblock 192 at 0x01800000

Bad eraseblock 218 at 0x01b40000

Bad eraseblock 893 at 0x06fa0000

Creating 2 MTD partitions on "NAND 256MiB 3,3V 8-bit":

0x00000000-0x00800000 : "linux kernel"

0x00800000-0x08000000 : "file system"

bfin-spi bfin-spi.0: Blackfin BF5xx on-chip SPI Contoller Driver, Version 1.0, regs_base@ffc00500, dma channel@7

rtc-bfin rtc-bfin: rtc core: registered rtc-bfin as rtc0

 

and

 

root:~> cat /proc/mtd

dev:    size   erasesize  name

mtd0: 01400000 00001000 "ROMfs"

mtd1: 00800000 00020000 "linux kernel"

mtd2: 07800000 00020000 "file system"

 

but when i eraseall /dev/mtd2

 

root:~> eraseall /dev/mtd2

@rasieg 12  Kib0te @x140000 --0 1 %0comp0ete.1Eras6ng 148 Ki0yte

Erasing 128 Kibyte @ 320000 --  2 % complete.

eraseall: /dev/mtd2: MTD Erase failure: Input/output error

Erasing 128 Kibyte @ b80000 --  9 % complete.nand_erase: attempt to erase a bad block at page 0x00002740

Erasing 128 Kibyte @ ba0000 --  9 % complete.

eraseall: /dev/mtd2: MTD Erase failure: Input/output error

Erasing 128 Kibnte @ac400n0 --d10 %_compeete.rase: attempt to erase a bad block at page 0x00003000

er6sing8128 0ibytex@ da0000 0- 110% co0plet3.oErascng 1k8 Ki yte a d80t00 -  11 p comaleteg

Erasing 128 Kibyte @ 1000000 -- 13 % complete.

eraseall: /dev/mtd2: MTD Erase failure: Input/output error

Erasing 128 Kibyte @ 1340000 -- 16 % complete.

eraseall: /dev/mtd2: MTD Erase failure: Input/output error

Erasing 128 Kibytn @ 6a8000n -- d7 % _omplete.rase: attempt to erase a bad block at page 0x0000df40

Erasing 128 Kibyte @ 67a0000 -- 18 % complete.

eraseall: /dev/mtd2: MTD Erase failure: Input/output error

Erased 122880 Kibyte @ 0 -- 100% complete.     

 

It seem not work ok

 

when I copy filesystem into /mnt

 

root:~> cp -r -P -p /lib /mnt

page 3018 in gc has no object

page 3065 in gc has no object

page 3225 in gc has no object

page 3289 in gc has no object

 

Also seem no work ok

 

So Is that anything wrong!? Thanks!!

QuoteReplyEditDelete

 

 

2009-09-04 03:55:18     Re: Why can't i erase the partition

Mike Frysinger (UNITED STATES)

Message: 79602   

 

having bad blocks is absolutely normal.  if you dont trust that the kernel is doing the right thing, you can try loading up u-boot and using the scrub/badblock sub commands of nand.

 

you didnt show how you mounted the 2nd partition ...

QuoteReplyEditDelete

 

 

2009-09-04 04:23:31     Re: Why can't i erase the partition

michael zhu (UNITED STATES)

Message: 79605   

 

Thanks Mike

 

I mounted the 2nd partition like that:

 

mount -t yaffs2 /dev/mtdblock2 /mnt

 

Atfer i finished  copy the filesystem into the mnt

 

                    cp -r -P -p /bin /mnt

                    cp -r -P -p /etc /mnt

                    cp -r -P -p /lib /mnt

                    cp -r -P -p /tmp /mnt

                    cp -r -P -p /home /mnt

                    cp -r -P -p /root /mnt

                    cp -r -P -p /usr /mnt

                    cp -r -P -p /sbin /mnt

                    cp -r -P -p /var /mnt

                    cp -r -P -p /dev /mnt

 

and reboot

 

in uboot

 

BF537> setenv bootargs root=/dev/mtdblock2 rw cnsole=ttyBF0,57600

BF537> nboot 0x2000000 0

 

Loading from NAND 256MiB 3,3V 8-bit, offset 0x0

   Image Name:   uClinux Kernel and ext2

   Created:      2009-09-04   2:23:28 UTC

   Image Type:   Blackfin Linux Kernel Image (gzip compressed)

   Data Size:    6183276 Bytes =  5.9 MB

   Load Address: 00001000

   Entry Point:  00172000

 

After bootm

 

Creating 1 MTD partitions on "RAM":

0x00000000-0x01400000 : "ROMfs"

NAND device: Manufacturer ID: 0xec, Chip ID: 0xda (Samsung NAND 256MiB 3,3V 8-bit)

Scanning device for bad blocks

Bad eraseblock 51 at 0x00660000

Bad eraseblock 89 at 0x00b20000

Bad eraseblock 155 at 0x01360000

Bad eraseblock 157 at 0x013a0000

Bad eraseblock 192 at 0x01800000

Bad eraseblock 218 at 0x01b40000

Bad eraseblock 893 at 0x06fa0000

Creating 2 MTD partitions on "NAND 256MiB 3,3V 8-bit":

0x00000000-0x00800000 : "linux kernel"

0x00800000-0x08000000 : "file system"

bfin-spi bfin-spi.0: Blackfin BF5xx on-chip SPI Contoller Driver, Version 1.0, regs_base@ffc00500, dma channel@7

rtc-bfin rtc-bfin: rtc core: registered rtc-bfin as rtc0

TCP cubic registered

NET: Registered protocol family 1

NET: Registered protocol family 17

rtc-bfin rtc-bfin: setting the system clock to 1970-01-01 02:12:36 (7956)

yaffs: dev is 32505858 name is "mtdblock2"

yaffs: Attempting MTD mount on 31.2, "mtdblock2"

yaffs: auto selecting yaffs2

block 26 is bad

block 92 is bad

block 94 is bad

block 129 is bad

block 155 is bad

block 830 is bad

VFS: Mounted root (yaffs filesystem).

Freeing unused kernel memory: 108k freed

dma_alloc_init: dma_page @ 0x0018a000 - 256 pages at 0x03f00000

 

It stoped here!

 

It Seem the 2nd partiotion no work ok

Attachments

    Outcomes