Last sector of flash root partition will not be flashed

Nancy nancydreaming at gmail.com
Thu Jun 12 09:20:34 EDT 2008


On Thu, Jun 12, 2008 at 6:20 PM, Hyphen79 <hyphen79 at web.de> 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
>
> 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?


-- 
Best wishes,
Nancy



More information about the linux-mtd mailing list