Skip to contentSkip to conversation

Mounting mtd block device raises "Block device required"

DISCUSSION Andre Puschmann 3 participants 7 messages Jun 11, 2008 – Jun 12, 2008 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

Hi list,

I am successfully running kernel 2.6.21 on a custom AT91RM9200-based board. I now updated to kernel 2.6.25 for various reasons.

Now, we use the _new_ atmel_spi driver and mtd_dataflash driver (but the problem also exist if I use the legacy one). If I try to mount a jffs2 or cramfs image on dataflash I get the following error:

# mount /dev/mtdblock5 /mnt/flash
mount: mounting /dev/mtdblock5 on /mnt/flash failed: Block device required

Exactly the same line works with the 2.6.21 kernel. Also doing a cat on the normal /dev/mtd* nodes also works.

"cat /proc/devices" shows:

Block devices:
7 loop
31 mtdblock

So I have no idea here. Any hints?

Thanks in advance.

Best regards,
Andre

#1 lore raw
Quoted 5 lines · Andre Puschmann

Hi list,

I am successfully running kernel 2.6.21 on a custom AT91RM9200-based board. I now updated to kernel 2.6.25 for various reasons.

Quoted 8 lines

Now, we use the _new_ atmel_spi driver and mtd_dataflash driver (but the problem also exist if I use the legacy one). If I try to mount a jffs2 or cramfs image on dataflash I get the following error:

# mount /dev/mtdblock5 /mnt/flash
mount: mounting /dev/mtdblock5 on /mnt/flash failed: Block device required

Exactly the same line works with the 2.6.21 kernel. Also doing a cat on the normal /dev/mtd* nodes also works.

Char device seems to work..

Quoted 8 lines

"cat /proc/devices" shows:

Block devices:
7 loop
31 mtdblock

So I have no idea here. Any hints?

What is the ls -l /dev/mtdblock5 output?
Also could you try:
mount -t jffs2 /dev/mtdblock5 /mnt/flash

HTH,
Hinko

Signature · 7 lines
ČETRTA POT, d.o.o., Kranj
Planina 3
4000 Kranj
Slovenia, Europe
Tel. +386 (0) 4 280 66 03
E-mail: [email protected]
Http: www.cetrtapot.si
#2 lore raw

Hi,

Quoted 1 line · Hinko Kocevar

Char device seems to work..

Yes, sorry for being not precise.
Coping a jffs2 image (in 2.6.25) at /dev/mtd5 and mouting the same one in 2.6.21 (/dev/mtdblock5) works. So accessing the flash as a character device works.

Quoted 1 line

What is the ls -l /dev/mtdblock5 output?

As expected:

$ ls -l /dev/mtdblock5
brw-rw----    1 root     root      31,   5 Jan  1  1970 /dev/mtdblock5
Quoted 2 lines

Also could you try:
mount -t jffs2 /dev/mtdblock5 /mnt/flash

I also tried that:

# mount -t jffs2 /dev/mtdblock5 /mnt/flash
mount: mounting /dev/mtdblock5 on /mnt/flash failed: Invalid argument

But it seems like it has to do something with the block device driver mapping:

$ head -n 2 /dev/mtdblock5 | hexdump -C
head: /dev/mtdblock5: No such device or address

Thanks,
Andre

#3 lore raw
Quoted 10 lines · Andre Puschmann

Hi,

Quoted 1 line · Hinko Kocevar

Char device seems to work..

Yes, sorry for being not precise.
Coping a jffs2 image (in 2.6.25) at /dev/mtd5 and mouting the same one in 2.6.21 (/dev/mtdblock5) works. So accessing the flash as a character device works.

Quoted 6 lines
Quoted 1 line

What is the ls -l /dev/mtdblock5 output?

As expected:

$ ls -l /dev/mtdblock5
brw-rw----    1 root     root      31,   5 Jan  1  1970 /dev/mtdblock5

Good.

Quoted 9 lines
Quoted 3 lines

Also could you try:
mount -t jffs2 /dev/mtdblock5 /mnt/flash

I also tried that:

# mount -t jffs2 /dev/mtdblock5 /mnt/flash
mount: mounting /dev/mtdblock5 on /mnt/flash failed: Invalid argument

Is this true (kernel config)?:
CONFIG_JFFS2_FS=y

Quoted 7 lines

But it seems like it has to do something with the block device driver mapping:

$ head -n 2 /dev/mtdblock5 | hexdump -C
head: /dev/mtdblock5: No such device or address

What about kernel configuration around the MTD block devices? I think these should be enabled:
CONFIG_MTD_BLKDEVS=y
CONFIG_MTD_BLOCK=y

Signature · 7 lines
ČETRTA POT, d.o.o., Kranj
Planina 3
4000 Kranj
Slovenia, Europe
Tel. +386 (0) 4 280 66 03
E-mail: [email protected]
Http: www.cetrtapot.si
#4 lore raw

Hi,

Quoted 4 lines · Hinko Kocevar

Is this true (kernel config)?:
CONFIG_JFFS2_FS=y
CONFIG_MTD_BLKDEVS=y
CONFIG_MTD_BLOCK=y

Sure, all these parameters are defined. Also, mdev dynamically creates the device nodes.

Regards,
Andre

#5 lore raw
In reply to Andre Puschmann
Quoted 9 lines · Andre Puschmann
# mount -t jffs2 /dev/mtdblock5 /mnt/flash
mount: mounting /dev/mtdblock5 on /mnt/flash failed: Invalid argument

But it seems like it has to do something with the block device driver mapping:

$ head -n 2 /dev/mtdblock5 | hexdump -C
head: /dev/mtdblock5: No such device or address

$ls linux-2.6.21/drivers/mtd/*.o
is there displaying mtd_blkdev.o and mtdblock.o? if no, you must add it in your .config file.

Signature · 2 lines
Best wishes,
Nancy
#6 lore raw
In reply to Andre Puschmann

Hi folks,

I found out that the problem came from a bug in busybox' mdev. Patch is available that fixes the problem for kernel 2.6.25 and later. So it's no mtd problem. Sorry for waisting the list ;-)

Thanks and best regards,
Andre