linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* Error creating FAT32 over Nand flash
@ 2009-08-25 13:35 Ivan Li
  2009-08-25 14:21 ` Ivan Li
  0 siblings, 1 reply; 6+ messages in thread
From: Ivan Li @ 2009-08-25 13:35 UTC (permalink / raw)
  To: linux-mtd

Hi guys,

I have some problems with creating FAT32 fs over nand flash.
I created FAT32 fs over nand flash with below command:
> flash_eraseall /dev/mtdblock6
> mkdosfs -v -F 32 /dev/mtdblock6
mkdosfs 3.0.2 (28 Feb 2009)
unable to get drive geometry, using default 255/63
/dev/mtdblock6 has 255 heads and 63 sectors per track,
logical sector size is 512,
using 0xf8 media descriptor, with 638976 sectors;
file system has 2 32-bit FATs and 8 sectors per cluster.
FAT size is 623 sectors, and provides 79712 clusters.

with USB mass storage gadget I exported this FAT partition to WinXP. When I tried to copy some files into it, I got errors both on WinXP and Linux console:
In WinXP I got an error dialog, say "Can't copy ****, data error (CRC error).
In serial console I got:
end_request: I/O error, dev mtdblock6, sector 77584
end_request: I/O error, dev mtdblock6, sector 77568
Buffer I/O error on device mtdblock6, logical block 9696
lost page write due to I/O error on mtdblock6
end_request: I/O error, dev mtdblock6, sector 77576
Buffer I/O error on device mtdblock6, logical block 9697
lost page write due to I/O error on mtdblock6

I don't know if FAT32 can't handle bad blocks correctly, or something else.
Any ideas?

The Nand Flash I am using is Samsung K9F4G08U0A, (512M = 4096 blocks, 1 block = 64 pages, 1 page = 2048 bytes, spare area = 64 bytes.)

Kernel configuration: 
CONFIG_BLOCK, CONFIG_MTD, CONFIG_MTD_PARTITIONS, CONFIG_MTD_CHAR, CONFIG_MTD_BLKDEVS, CONFIG_MTD_BLOCK, CONFIG_MTD_NAND...

Thanks in advance.

Ivan

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Error creating FAT32 over Nand flash
  2009-08-25 13:35 Error creating FAT32 over Nand flash Ivan Li
@ 2009-08-25 14:21 ` Ivan Li
  2009-08-25 14:34   ` Artem Bityutskiy
                     ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Ivan Li @ 2009-08-25 14:21 UTC (permalink / raw)
  To: Ivan Li, linux-mtd

Some progress for it: I found the sector number mentioned in error message resides in BAD block.
Is there any fix for that?

----- Original Message ----- 
From: "Ivan Li" <lijinlei1@163.com>
To: <linux-mtd@lists.infradead.org>
Sent: Tuesday, August 25, 2009 9:35 PM
Subject: Error creating FAT32 over Nand flash


> Hi guys,
> 
> I have some problems with creating FAT32 fs over nand flash.
> I created FAT32 fs over nand flash with below command:
>> flash_eraseall /dev/mtdblock6
>> mkdosfs -v -F 32 /dev/mtdblock6
> mkdosfs 3.0.2 (28 Feb 2009)
> unable to get drive geometry, using default 255/63
> /dev/mtdblock6 has 255 heads and 63 sectors per track,
> logical sector size is 512,
> using 0xf8 media descriptor, with 638976 sectors;
> file system has 2 32-bit FATs and 8 sectors per cluster.
> FAT size is 623 sectors, and provides 79712 clusters.
> 
> with USB mass storage gadget I exported this FAT partition to WinXP. When I tried to copy some files into it, I got errors both on WinXP and Linux console:
> In WinXP I got an error dialog, say "Can't copy ****, data error (CRC error).
> In serial console I got:
> end_request: I/O error, dev mtdblock6, sector 77584
> end_request: I/O error, dev mtdblock6, sector 77568
> Buffer I/O error on device mtdblock6, logical block 9696
> lost page write due to I/O error on mtdblock6
> end_request: I/O error, dev mtdblock6, sector 77576
> Buffer I/O error on device mtdblock6, logical block 9697
> lost page write due to I/O error on mtdblock6
> 
> I don't know if FAT32 can't handle bad blocks correctly, or something else.
> Any ideas?
> 
> The Nand Flash I am using is Samsung K9F4G08U0A, (512M = 4096 blocks, 1 block = 64 pages, 1 page = 2048 bytes, spare area = 64 bytes.)
> 
> Kernel configuration: 
> CONFIG_BLOCK, CONFIG_MTD, CONFIG_MTD_PARTITIONS, CONFIG_MTD_CHAR, CONFIG_MTD_BLKDEVS, CONFIG_MTD_BLOCK, CONFIG_MTD_NAND...
> 
> Thanks in advance.
> 
> Ivan
> ______________________________________________________
> Linux MTD discussion mailing list
> http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Error creating FAT32 over Nand flash
  2009-08-25 14:21 ` Ivan Li
@ 2009-08-25 14:34   ` Artem Bityutskiy
  2009-08-25 14:42   ` Eirik Aanonsen
  2009-08-25 14:56   ` Matthieu CASTET
  2 siblings, 0 replies; 6+ messages in thread
From: Artem Bityutskiy @ 2009-08-25 14:34 UTC (permalink / raw)
  To: Ivan Li; +Cc: linux-mtd

On 08/25/2009 05:21 PM, Ivan Li wrote:
> Some progress for it: I found the sector number mentioned in error message resides in BAD block.
> Is there any fix for that?

Yes, do not use mtdblock but write a real FTL layer.

-- 
Best Regards,
Artem Bityutskiy (Артём Битюцкий)

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: Error creating FAT32 over Nand flash
  2009-08-25 14:21 ` Ivan Li
  2009-08-25 14:34   ` Artem Bityutskiy
@ 2009-08-25 14:42   ` Eirik Aanonsen
  2009-08-25 14:56   ` Matthieu CASTET
  2 siblings, 0 replies; 6+ messages in thread
From: Eirik Aanonsen @ 2009-08-25 14:42 UTC (permalink / raw)
  To: Ivan Li, linux-mtd

> Some progress for it: I found the sector number mentioned in error
> message resides in BAD block.
> Is there any fix for that?
> 
> ----- Original Message -----....
> > I have some problems with creating FAT32 fs over nand flash.
....

Read up on what filesystems you can use directly on a nand flash:
http://www.linux-mtd.infradead.org/faq/general.html#L_ext2_mtd

Reguards
Eirik Aanonsen

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Error creating FAT32 over Nand flash
  2009-08-25 14:21 ` Ivan Li
  2009-08-25 14:34   ` Artem Bityutskiy
  2009-08-25 14:42   ` Eirik Aanonsen
@ 2009-08-25 14:56   ` Matthieu CASTET
  2009-08-30  8:14     ` Ivan Li
  2 siblings, 1 reply; 6+ messages in thread
From: Matthieu CASTET @ 2009-08-25 14:56 UTC (permalink / raw)
  To: Ivan Li; +Cc: linux-mtd@lists.infradead.org

Ivan Li a écrit :
> Some progress for it: I found the sector number mentioned in error message resides in BAD block.
> Is there any fix for that?
Use an FTL or mount FAT in loop mode over a file in a fs understanding
NAND (ubifs, jffs2, ...).


Matthieu

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Error creating FAT32 over Nand flash
  2009-08-25 14:56   ` Matthieu CASTET
@ 2009-08-30  8:14     ` Ivan Li
  0 siblings, 0 replies; 6+ messages in thread
From: Ivan Li @ 2009-08-30  8:14 UTC (permalink / raw)
  To: Matthieu CASTET; +Cc: linux-mtd

Thanks for your reply.
Use FAT over yaffs can fix this problem, but the performance is not very good.
Is there any existing open source FTL for FAT over nand flash which I can use in my product?
Thanks.

----- Original Message ----- 
From: "Matthieu CASTET" <matthieu.castet@parrot.com>
To: "Ivan Li" <lijinlei1@163.com>
Cc: <linux-mtd@lists.infradead.org>
Sent: Tuesday, August 25, 2009 10:56 PM
Subject: Re: Error creating FAT32 over Nand flash


Ivan Li a écrit :
> Some progress for it: I found the sector number mentioned in error message resides in BAD block.
> Is there any fix for that?
Use an FTL or mount FAT in loop mode over a file in a fs understanding
NAND (ubifs, jffs2, ...).


Matthieu

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-08-30  8:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-25 13:35 Error creating FAT32 over Nand flash Ivan Li
2009-08-25 14:21 ` Ivan Li
2009-08-25 14:34   ` Artem Bityutskiy
2009-08-25 14:42   ` Eirik Aanonsen
2009-08-25 14:56   ` Matthieu CASTET
2009-08-30  8:14     ` Ivan Li

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).