Skip to contentSkip to conversation

Last sector of flash root partition will not be flashed

DISCUSSION Hyphen79 2 participants 2 messages Jun 12, 2008 Memory technology devices (MTD)

lore
Share & tools
lore

Hyphen79

author
#0 lore raw

Hello,

the problem is, that the last sector of the mtd root partition (cramdisk) will not be flashed:

mtdblock: write on "File System" at 0x1f5e00, size 0x200
mtdblock: write on "File System" at 0x1f6000, size 0x200
mtdblock: writing cached data for "File System" at 0x1f5000, size 0x1000
mtdblock: write on "File System" at 0x1f6200, size 0x200
mtdblock: write on "File System" at 0x1f6400, size 0x200
mtdblock: write on "File System" at 0x1f6600, size 0x200
mtdblock: write on "File System" at 0x1f6800, size 0x200
mtdblock: write on "File System" at 0x1f6a00, size 0x200
mtdblock: write on "File System" at 0x1f6c00, size 0x200
mtdblock: write on "File System" at 0x1f6e00, size 0x200

But the last call to "write_cached_data" will not be done - even not after an explicit "sync". For example: "mtdblock: writing cached data for "File System" at 0x1f6000, size 0x1000" Has anyone an idea?

#1 lore raw
Quoted 16 lines · On Thu, Jun 12, 2008 at 6:20 PM, Hyphen79 <[email protected]> wrote:

Hello,

the problem is, that the last sector of the mtd root partition (cramdisk) will not be flashed:

mtdblock: write on "File System" at 0x1f5e00, size 0x200
mtdblock: write on "File System" at 0x1f6000, size 0x200
mtdblock: writing cached data for "File System" at 0x1f5000, size 0x1000
mtdblock: write on "File System" at 0x1f6200, size 0x200
mtdblock: write on "File System" at 0x1f6400, size 0x200
mtdblock: write on "File System" at 0x1f6600, size 0x200
mtdblock: write on "File System" at 0x1f6800, size 0x200
mtdblock: write on "File System" at 0x1f6a00, size 0x200
mtdblock: write on "File System" at 0x1f6c00, size 0x200
mtdblock: write on "File System" at 0x1f6e00, size 0x200

Quoted 5 lines

But the last call to "write_cached_data" will not be done - even not after an explicit "sync".
For example: "mtdblock: writing cached data for "File System" at 0x1f6000, size 0x1000"
Has anyone an idea?

You shoud umount it or write a program to flush the cache in mtdblock.c For example:
/* flushcache.c */
#include <sys/ioctl.h>
#include <linux/fs.h>
#include <fcntl.h>
#include <stdio.h>

int main(int argc,char **argv)

{
       int fd;

       if( argc != 2 ){
               printf( "Usage:%s device name(full path)\n", argv[0] );
               return -1;
       }

       if( (fd = open( argv[1], O_RDONLY ) ) == -1) {
               printf( "Open %s failed\n", argv[1] );
               return -1;
       }

       if( ioctl( fd, BLKFLSBUF) == -1)
               printf("flush catche failed\n");

       close(fd);
       return 0;
}
# cp ....; sync; flushcache /dev/mtdblockN

But why you use cramdisk as your rootfs ? Why do not use Nand awared filesystem as its rootfs file system?

Signature · 2 lines
Best wishes,
Nancy