Skip to contentSkip to conversation

mtd mount problem

DISCUSSION Marco Schramel 6 participants 12 messages Apr 21, 2005 – Apr 22, 2005

lore
Share & tools
lore
#0 lore raw

Hi all,

in our system (MPC8270, 2.4.25) i can't mount the mtd devices (two AM29LV256MH)

I created a map based on tqm8260.c. I can use the "eraseall" command and i can write the mtdx devices. But if i try to mount the mtd devices (jffs or jffs2) then it fails.
Output:
The eraseall command
/dev # eraseall /dev/mtd1
MTD_open
MTD_ioctl
MTD_write
Erased 8192 Kibyte @ 0 -- 100% complete.
MTD_close

try to write
/dev # date > /dev/mtd1
MTD_open
MTD_ioctl
MTD_write
MTD_close

ok, now try onesmore
/dev # date > /dev/mtd1
MTD_open
MTD_ioctl
MTD_write
MTD do_write_buffer(): software timeout
MTD_close
/dev #

It all seems to be fine, but...

dev # mount -t jffs2 /dev/mtdblock1 /mnt/Flash1
mount: Mounting /dev/mtdblock1 on /mnt/Flash1 failed: No such device

I checked out the Majors of my ramdisk, they are ok.

Any ideas.

Best regards and thank you in advance.

Marco

Signature · 2 lines
---------
Marco Schramel
#1 lore raw
Quoted 31 lines · Marco Schramel

Hi all,

in our system (MPC8270, 2.4.25) i can't mount the mtd devices (two AM29LV256MH)

I created a map based on tqm8260.c. I can use the "eraseall" command and i can write the mtdx devices. But if i try to mount the mtd devices (jffs or jffs2) then it fails.
Output:
The eraseall command
/dev # eraseall /dev/mtd1
MTD_open
MTD_ioctl
MTD_write
Erased 8192 Kibyte @ 0 -- 100% complete.
MTD_close

try to write
/dev # date > /dev/mtd1
MTD_open
MTD_ioctl
MTD_write
MTD_close

ok, now try onesmore
/dev # date > /dev/mtd1
MTD_open
MTD_ioctl
MTD_write
MTD do_write_buffer(): software timeout
MTD_close
/dev #

Quoted 6 lines

It all seems to be fine, but...

dev # mount -t jffs2 /dev/mtdblock1 /mnt/Flash1
mount: Mounting /dev/mtdblock1 on /mnt/Flash1 failed: No such device

I checked out the Majors of my ramdisk, they are ok.

ramdisk? why?

Check that you have CONFIG_MTD_BLOCK enabled in your .config.

Also, check that you have /dev/mtdblock1 node in /dev directory on the target.

Signature · 1 line
Eugene
#2 lore raw

Hi Eugene,

thanks for your answer

Quoted 1 line

Check that you have CONFIG_MTD_BLOCK enabled in your .config.

#
# Memory Technology Devices (MTD)
#
CONFIG_MTD=y
CONFIG_MTD_DEBUG=y
CONFIG_MTD_DEBUG_VERBOSE=0
CONFIG_MTD_PARTITIONS=y
# CONFIG_MTD_CONCAT is not set
# CONFIG_MTD_REDBOOT_PARTS is not set
# CONFIG_MTD_CMDLINE_PARTS is not set
CONFIG_MTD_CHAR=y
CONFIG_MTD_BLOCK=y
# CONFIG_FTL is not set
# CONFIG_NFTL is not set
# CONFIG_INFTL is not set

Quoted 4 lines

Also, check that you have /dev/mtdblock1 node in /dev directory on the target.

This is what i meant before with ramdisk.

/dev # ls -al mtdblock1
brw-rw-r-- 1 root root 31, 1 Mar 17 2005 mtdblock1

It should be ok. Isn't it ??

Thanks
Marco

Signature · 2 lines
---------
Marco Schramel
#3 lore raw
Quoted 26 lines · Marco Schramel

Hi Eugene,

thanks for your answer

Quoted 1 line

Check that you have CONFIG_MTD_BLOCK enabled in your .config.

#
# Memory Technology Devices (MTD)
#
CONFIG_MTD=y
CONFIG_MTD_DEBUG=y
CONFIG_MTD_DEBUG_VERBOSE=0
CONFIG_MTD_PARTITIONS=y
# CONFIG_MTD_CONCAT is not set
# CONFIG_MTD_REDBOOT_PARTS is not set
# CONFIG_MTD_CMDLINE_PARTS is not set
CONFIG_MTD_CHAR=y
CONFIG_MTD_BLOCK=y
# CONFIG_FTL is not set
# CONFIG_NFTL is not set
# CONFIG_INFTL is not set

Quoted 4 lines

Also, check that you have /dev/mtdblock1 node in /dev directory on the target.

Quoted 6 lines

This is what i meant before with ramdisk.

/dev # ls -al mtdblock1
brw-rw-r-- 1 root root 31, 1 Mar 17 2005 mtdblock1

It should be ok. Isn't it ??

Hmm, yes, provided you have also jffs2 enabled, but I'd expect different error message if not.

Could you show us dmesg output, and also cat /proc/devices?

Signature · 1 line
Eugene
#4 lore raw
In reply to Marco Schramel
Quoted 4 lines · Marco Schramel

It all seems to be fine, but...
=20
dev # mount -t jffs2 /dev/mtdblock1 /mnt/Flash1
mount: Mounting /dev/mtdblock1 on /mnt/Flash1 failed: No such device

Shouldnt you be doing eraseall first ? It seems to me, you were writing output of date to the flash earlier.

If you get No such device, it maybe that your configuration of bus width, and base address could be wrong. (I take it that you did configure the physmap)

--=20
Daniel

#5 lore raw
In reply to Marco Schramel
Quoted 6 lines · In message <[email protected]> you wrote:

/dev # date > /dev/mtd1
MTD_open
MTD_ioctl
MTD_write
MTD do_write_buffer(): software timeout

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ERROR ERROR ERROR ERROR ERROR ERROR ERROR

Quoted 4 lines

MTD_close
/dev #

It all seems to be fine, but...

I disagree. There was a pretty clear error message above. Don't ignore this, it will bite you later.

Quoted 2 lines

dev # mount -t jffs2 /dev/mtdblock1 /mnt/Flash1
mount: Mounting /dev/mtdblock1 on /mnt/Flash1 failed: No such device

Assuming that this is a mount builtin to the busybox, this message means that there is no such file as "/dev/mtdblock1" in your root file system - exactly as the error message says.

Quoted 1 line

I checked out the Majors of my ramdisk, they are ok.

What has a ramdisk to do with this?

What does "cat /proc/mtd" show? What are the kernel boot messages look like?

Best regards,

Wolfgang Denk

Signature · 5 lines
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: [email protected]
"It was the Law of the Sea, they said. Civilization ends at  the  wa-
terline.  Beyond  that,  we  all enter the food chain, and not always
right at the top."                               - Hunter S. Thompson
#6 lore raw

Hi,

Quoted 8 lines
Quoted 6 lines

/dev # date > /dev/mtd1
MTD_open
MTD_ioctl
MTD_write
MTD do_write_buffer(): software timeout

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ERROR ERROR ERROR ERROR ERROR ERROR ERROR

This only occurs if i write the second time to the flash memory without erasing it before.

Quoted 1 line

What has a ramdisk to do with this?

I wrote in a message later, that i meant the /dev nodes in this case.

Quoted 3 lines

What does "cat /proc/mtd" show? What are the kernel boot messages look like?

mtd0: 01000000 00020000 "JFFS2 partition 1"
mtd1: 00800000 00020000 "JFFS2 partition 2"
mtd2: 00400000 00020000 "RAMDISK "
mtd3: 00300000 00020000 "kernel image 2_4"
mtd4: 00100000 00020000 "Das U-Boot "

Best regards
Marco

#7 lore raw
Quoted 10 lines · Marco Schramel
Quoted 8 lines
Quoted 6 lines

/dev # date > /dev/mtd1
MTD_open
MTD_ioctl
MTD_write
MTD do_write_buffer(): software timeout

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ERROR ERROR ERROR ERROR ERROR ERROR ERROR

This only occurs if i write the second time to the flash memory without erasing it before.

That's harmless. Flash is a write-once medium between erases.

Your setup appears sane in principle, so there must me a subtle mistake you made (bugs are out of the question of course ;). Missing a real howto, let me run through the sequence:

1. Erase the flash partition. Either
o eraseall /dev/mtdX or
o cat file_filled_with_0xff > /dev/mtdblockX

2. Do *not* write anything to it afterwards. Jffs2 would just error out.

3. Mount jffs2. Either
o mount mtdX -t jffs2 <mount_point> or
o mount /dev/mtdblockX -t jffs2 <mount_point>

Jörn

Signature · 3 lines
The grand essentials of happiness are: something to do, something to
love, and something to hope for.
-- Allan K. Chalmers
#8 lore raw

On Fri, Apr 22, 2005 at 03:31:34AM +0200, J?rn Engel wrote:

[snip]

Quoted 3 lines

1. Erase the flash partition. Either
o eraseall /dev/mtdX or
o cat file_filled_with_0xff > /dev/mtdblockX

Huh? I fail to see how options you listed are equivalent. By "cat"ing file filled with 0xff you cannot erase flash, period.

Only eraseall (or erase, if partition occupies 1 erase block) flash can be erased.

Signature · 1 line
Eugene
#9 lore raw
Quoted 8 lines · Eugene Surovegin

On Fri, Apr 22, 2005 at 03:31:34AM +0200, J?rn Engel wrote:

[snip]

Quoted 3 lines

1. Erase the flash partition. Either
o eraseall /dev/mtdX or
o cat file_filled_with_0xff > /dev/mtdblockX

Quoted 5 lines

Huh? I fail to see how options you listed are equivalent. By "cat"ing file filled with 0xff you cannot erase flash, period.

Only eraseall (or erase, if partition occupies 1 erase block) flash can be erased.

Oops, sorry, I failed to notice /dev/mtdblockX. Stupid me. Ignore this noise.

Signature · 1 line
Eugene
#10 lore raw
Quoted 9 lines · Eugene Surovegin
Quoted 8 lines · Eugene Surovegin

On Fri, Apr 22, 2005 at 03:31:34AM +0200, J?rn Engel wrote:

[snip]

Quoted 3 lines

1. Erase the flash partition. Either
o eraseall /dev/mtdX or
o cat file_filled_with_0xff > /dev/mtdblockX

Quoted 8 lines
Quoted 5 lines

Huh? I fail to see how options you listed are equivalent. By "cat"ing file filled with 0xff you cannot erase flash, period.

Only eraseall (or erase, if partition occupies 1 erase block) flash can be erased.

Oops, sorry, I failed to notice /dev/mtdblockX. Stupid me. Ignore this noise.

Btw, I've also written a tool called 'ff' once. It will simply write tons of 0xff to stdout. Rewriting the thing from scratch should be slightly faster than me trying to look for the source (about 4 lines of code?).

Jörn

Signature · 4 lines
My second remark is that our intellectual powers are rather geared to
master static relations and that our powers to visualize processes
evolving in time are relatively poorly developed.
-- Edsger W. Dijkstra
#11 lore raw
In reply to Wolfgang Denk
Quoted 6 lines · Wolfgang Denk
Quoted 2 lines

dev # mount -t jffs2 /dev/mtdblock1 /mnt/Flash1
mount: Mounting /dev/mtdblock1 on /mnt/Flash1 failed: No such device

=20
Assuming that this is a mount builtin to the busybox, this message means that there is no such file as "/dev/mtdblock1" in your root file system - exactly as the error message says.

I believe you can also get "No such device" if you haven't configured linux for JFFS2 support; another thing to double check in your .config.

Cheers,
Kylo