Need help on using jffs2 with blkmtd

wilho wallaton wilho_76 at
Tue Mar 29 08:37:33 EST 2005


Although this is may or may not be the mtd problem, I
dear to to ask your assistance, since you guys are my
last hope it seems.

AFAIK jffs2 is only compressing rw filesystem on linux
there is. Therefore I've tried a whole day to create
jffs2 partition on my HD, I'm going to rdiff-backup
onto it when it's ready (rdiff compresses only its

My intention is to make /dev/hdc4 to function with
jffs2 filesystem. This is what I've done so far:
I have these modules installed:
Symbol: MTD [=m]
Prompt: Memory Technology Device (MTD) support
Defined at drivers/mtd/Kconfig:5
-> Device Drivers
-> Memory Technology Devices (MTD)

Prompt: MTD emulation using block device
Defined at drivers/mtd/devices/Kconfig:116
Depends on: MTD
-> Device Drivers
-> Memory Technology Devices (MTD)
-> Self-contained MTD device drivers

Symbol: JFFS2_FS [=m]
Prompt: Journalling Flash File System v2 (JFFS2)
Defined at fs/Kconfig:1052
Depends on: MTD
-> File systems
-> Miscellaneous filesystems
Selects: CRC32

Next thing was:

  #modprobe blkmtd device=/dev/hdc4
  #mknod /dev/mtdblock0 b 22 4

I'm not sure about usage of mknod command. It seems
that blkmtd needs it with udev, without it there's no
/dev/mtdblcok* devices at all. I've checked major and
minor number from
/usr/src/linux/Documentation/devices.txt, I'm not sure
but I think they're all right. BTW, how do I make
those changes permanent?

Well anyway, story goes on,

  #mkfs.jffs2 -o /dev/mtdblock0

everything seems to be OK this far, no error messages,
but when I do:

  #mount -t jffs2 /dev/mtdblock0 /mnt/hdc4
-> mount: wrong fs type, bad option, bad superblock on

Here's something I've done for troubleshooting:

  #lsmod |grep mtd     
-->blkmtd                  8884  0
   mtdcore                 5316  3 jffs2,blkmtd

  #lsmod |grep jffs
-->jffs2                  83248  0
   zlib_deflate           21272  1 jffs2
   zlib_inflate           17280  1 jffs2
   mtdcore                 5316  3 jffs2,blkmtd

  #cat /proc/mtd
-->dev:    size   erasesize  name
   mtd0: 205b0000 00020000 "blkmtd: /dev/hdc4"

if I do
  #wc -c /dev/mtdblock0

I get out size 542836224 bytes ~ 500MB which seems
right - thats about the size as how big the partition
should be.

if I do
  #head -n1 /dev/mtdblock0

There's some filenames visible in output in middle of

So it seems that /dev/mtdblock0 is OK, but is it after
all? If it it, then what the * is wrong with this, why
can't I mount it? I'm gettign desperate.

Thanks for all your help,

Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 

More information about the linux-mtd mailing list