This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Difficulty mounting filesystem in NAND

I'm trying to follow the instructions at http://processors.wiki.ti.com/index.php/Filesystem_in_NOR_or_NAND#File_system_preparation

I have a DM6467T EVM.  When I run "cat /proc/mtd" I get the following output:

 dev:                       size                        erasesize             name
mtd0:                    00020000             0020000                “params”
mtd1:                    00140000             0020000                “bootloader”
mtd2:                    00400000             0020000                “kernel”
mtd3:                    07aa0000             0020000                “filesystem”

When I look in the /dev folder, I find an mtdx and mtdblockx for x=0,1,2,3.   I also find in davinci_dm646x_1ghz_defconfig all the settings advised for JFFS2.

This is all how the EVM came without me doing anything.

Based on what I see on my EVM and what I read in the instructions, I run the command "flash_eraseall -j /dev/mtd3", which seems to do something, logging about clearing 128 Kibyte sections and writing Cleanmarkers.

I deduce that the flash_eraseall command is akin to a disk "format" on a Windows machine.  Therefore, I assume I should now have a blank, empty file system in nand.

However, I then run "mount -t jffs2 /dev/mtdblock3 /mnt/nand" and get the error "mount: mounting /dev/mtdblock3 on /dev/nand failed: No such file or directory".

Why?  It does occur to me that /mnt/nand does not already exist.  But when I try "mknod /dev/nand" I get usage advice and realize I don't know how to run it correctly for this application.

Please help me get past this point.  I assume I need to get the "mount" command working, then go through other procedures I understand already to write my filesystem to NAND, such filesystem being built by procedures I do NOT yet understand but I believe is summarized at http://processors.wiki.ti.com/index.php/Filesystem_in_NOR_or_NAND#Content_of_file_system.

One additional note.  While /proc/mtd gives me the output above, when I boot my EVM the log displays different info:

Creating 4 MTD partitions on "davinci_nand.0":
0x000000000000-0x000000020000 : "params"
0x000000020000-0x000000160000 : "bootloader"
0x000000160000-0x000000560000 : "kernel"
0x000000560000-0x000008000000 : "filesystem"

This information seems inconsistent with the /proc/mtd output and this concerns me.

Thanks very much,

Helmut

  • Hi,

    Helmut Forren said:

    However, I then run "mount -t jffs2 /dev/mtdblock3 /mnt/nand" and get the error "mount: mounting /dev/mtdblock3 on /dev/nand failed: No such file or directory".

    Something seems to be wrong here. If you are mounting it on /mnt/nand, why are you seeing the error "/dev/nand" not  present. Make sure that you are mounting mtdblockx on some existing directory.

    Helmut Forren said:

    One additional note.  While /proc/mtd gives me the output above, when I boot my EVM the log displays different info:

     

    Creating 4 MTD partitions on "davinci_nand.0":
    0x000000000000-0x000000020000 : "params"
    0x000000020000-0x000000160000 : "bootloader"
    0x000000160000-0x000000560000 : "kernel"
    0x000000560000-0x000008000000 : "filesystem"

    This information seems inconsistent with the /proc/mtd output and this concerns me.

    This is consistent with "cat /proc/mtd" because "cat /proc/mtd shows the SIZE and ERASESIZE, whereas the log above shows the starting and ending offsets of NAND partition.

    Regards, Sudhakar

  • I retyped incorrectly.  The error reads "mount: mounting /dev/mtdblock3 on /mnt/nand failed: No such file or directory".

    Therefore, my original question remains, with that correction.  Why do I get this error?  Do I need to "mknod /mnt/nand"?  If so, how do I do that?  Otherwise, what should I do?  (You say "make sure that you are mounting mtdblockx on some existing directory".  Thus suggests /mnt/nand should exist.  It does not.  How do I create it?)

    Thanks very much,

    Helmut

  • "flash_eraseall" does not actually "format" your partition to a specific file system, but rather erases everything located in this flash range. You need to use "mkfs" (i.e. mkfs.jffs2, mkfs.ext3) to format your partition before you can actually mount and use it. These tools are provided by the "mtd-utils" package in case you don't have it installed on your platform.

  • Adeneo Embedded support team said:

    "flash_eraseall" does not actually "format" your partition to a specific file system, but rather erases everything located in this flash range. You need to use "mkfs" (i.e. mkfs.jffs2, mkfs.ext3) to format your partition before you can actually mount and use it. These tools are provided by the "mtd-utils" package in case you don't have it installed on your platform.

    Acknowledged.

    Note I found the following at http://e2e.ti.com/support/embedded/f/354/p/73668/269073.aspx

    John Anderson from other post said:

     

    From the TMS320DM365 Software Developers Guide in the dvsdk_4_00_00_22/docs directory.

    Page 24 - How to flash a filesystem

     target # flash_eraseall /dev/mtd4
     target # mkdir -p /mnt/nand
     target # mount /dev/mtdblock4 /mnt/nand -t jffs2
     target # cd /mnt/nand
     target # tar zxf /home/root/filesystem.tar.gz
     target # sync
     target # cd /home/root
     target # umount /mnt/nand

    John A

     

    I'm using DVSDK 3.10.  Nevertheless, I took heed of this advice and decided to try "mkdir -p /mnt/nand" followed by "mount -t jffs2 /dev/mtdblock3 /mnt/nand".  This appears to have worked.  I changed to this directory and did "echo hello >hello.txt" and found it created such a file with that content.  I then rebooted, repeated both the mkdir and mount.  I found the "hello.txt" still there.  Good.

    Regarding FORMATTING, no need.  Don't know why, but "echo hello >hello.txt" worked fine.

    I continued with instructions to use tar as a vehicle for copying filesystem, modified my bootargs appropriately, and SUCCESSFULLY BOOTED TO NAND FILE SYSTEM.  This makes me very happy.  It means I know how to get running my in-prototyping-production hardware that has no hard disk.

    I'm done with this thread.

    Thanks,

    Helmut

  • Hi,

    You can use "mkdir" command to create directory.

    Regards, Sudhakar