Skip to contentSkip to conversation

Permission problem on mtd block device

DISCUSSION Nikunj A. Dadhania 2 participants 5 messages Jul 2, 2001 1 message not in the archive Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

Hi,

I have compiled kernel 2.4.2 and patched it for arm. I am using an Assabet board.

I have statically compiled the mtd and loaded jffs as modules.

The kernel booted and I got the entry in /proc too.

The outputs of various commands are as follows:

*************************************************************************
/ # ls /dev/mt* -l

crw-r--r--   1 0        0         90,   0 Jan  1 00:00 /dev/mtd0
brw-r--r--   1 0        0         31,   0 Jan  1 00:01 /dev/mtdblock0
crw-r--r--   1 0        0         90,   1 Jan  1 00:00 /dev/mtdr0

/ # ls -al

drwxr-xr-x  12 0        0            1024 Jul  2  2001 .
drwxr-xr-x  12 0        0            1024 Jul  2  2001 ..
drwxr-sr-x   2 0        1000         1024 Jul  2  2001 bin
drwxr-xr-x   3 0        0            1024 Jan  1 00:01 dev
drwxr-xr-x   4 0        0            1024 Jun 30  2001 etc
drwxr-xr-x   3 0        0            1024 Jul  1  2001 lib

/***************The mount point I used**************/
dr-xr-xr-x 1 0 0 0 Jan 1 00:03 mnt
/***************************************************/

dr-xr-xr-x  20 0        0               0 Jan  1 00:00 proc
drwxr-sr-x   2 0        1000         1024 Jul  2  2001 sbin
drwxr-xr-x   2 0        0            1024 Jun 30  2001 tmp
drwxr-sr-x   5 0        0            1024 Jul  2  2001 usr
drwxr-xr-x   5 0        0            1024 Jun 30  2001 var

/ # cat /proc/mtd
dev: size erasesize name
mtd0: 00040000 00040000 "bootloader"
mtd1: 00040000 00040000 "bootloader params"
mtd2: 01f80000 00040000 "jffs"
***************************************************************************

Then it I mounted the device using
(i tried mount -t jffs option but it didnt work)
I am using Busybox.

mount /dev/mtdblock0 /mnt

this command works. it gives some directory listing such as..

/ # ls -al /mnt

dr-xr-xr-x   1 0        0               0 Jan  1 00:03 .
drwxr-xr-x  12 0        0            1024 Jul  2  2001 ..
dr-xr-xr-x   1 0        0               0 Jan  1 00:03 001
-r--r--r--   1 0        0               0 Jan  1 00:03 devices
-r--r--r--   1 0        0               0 Jan  1 00:03 drivers

but I cannot write to it nor can i delete any file from it .. what could the problem possibly be??

I would be extremely grateful if i could get an early reply.

thanks in advance

nikunj

PS: I am not subscribed to this list. So please mail me at my personal address

#1 lore raw

Review

Quoted 10 lines · [email protected] said:

mount /dev/mtdblock0 /mnt

this command works. it gives some directory listing such as..

/ # ls -al /mnt

dr-xr-xr-x   1 0        0               0 Jan  1 00:03 .
drwxr-xr-x  12 0        0            1024 Jul  2  2001 ..
dr-xr-xr-x   1 0        0               0 Jan  1 00:03 001
(quoted diff) +0 -2
-r--r--r--   1 0        0               0 Jan  1 00:03 devices
-r--r--r--   1 0        0               0 Jan  1 00:03 drivers

That looks like usbdevfs.

cat /proc/mounts /proc/filesystems

--
dwmw2

#2 lore raw
Quoted 5 lines · David Woodhouse
Quoted 4 lines · [email protected] said:

mount /dev/mtdblock0 /mnt

this command works. it gives some directory listing such as..

Quoted 8 lines

Review

Quoted 6 lines

/ # ls -al /mnt

dr-xr-xr-x   1 0        0               0 Jan  1 00:03 .
drwxr-xr-x  12 0        0            1024 Jul  2  2001 ..
dr-xr-xr-x   1 0        0               0 Jan  1 00:03 001
(quoted diff) +0 -2
-r--r--r--   1 0        0               0 Jan  1 00:03 devices
-r--r--r--   1 0        0               0 Jan  1 00:03 drivers

That looks like usbdevfs.

Ooppps ... you are right...

Quoted 1 line

cat /proc/mounts /proc/filesystems

/mnt # cat /proc/mounts
/dev/root / ext2 rw 0 0
/proc /proc proc rw 0 0
/dev/mtdblock0 /mnt usbdevfs rw 0 0

/mnt # cat /proc/filesystems

nodev   sockfs
nodev   shm
nodev   pipefs
nodev   proc

ext2
nodev usbdevfs
nodev devpts
jffs

but where is the flash ?
Is the major and minor number are correct which I have specified in previous mail? (for the reference mtd0 90 0, mtdr 90 1, mtdblock0 31 0) In the /proc/mtd it shows the mtd0, mtd1 and mtd2 entries. And when i give the command

mount -t jffs /dev/mtdblock0 /mnt/
mount: Mounting /dev/mtdblock0 on /mnt failed: Permission denied

how do I mount the jffs??

Quoted 3 lines

--
dwmw2

regards
nikunj

#3 lore raw
Quoted 3 lines · [email protected] said:

Is the major and minor number are correct which I have specified in previous mail? (for the reference mtd0 90 0, mtdr 90 1, mtdblock0 31
0)

Yep, they're fine.

Quoted 2 lines

mount -t jffs /dev/mtdblock0 /mnt/
mount: Mounting /dev/mtdblock0 on /mnt failed: Permission denied

I don't think that error is coming from JFFS. Can you build it with debugging enabled and show the output of 'dmesg'? It'll show us whether it's even getting as far as jffs_read_super().

--
dwmw2

A message that is not in the archive (sent off-list or not yet received): [email protected]'s

#5 lore raw
Quoted 40 lines · [email protected] (Nikunj A. Dadhania) writes:
Quoted 5 lines · David Woodhouse
Quoted 4 lines · [email protected] said:

mount /dev/mtdblock0 /mnt

this command works. it gives some directory listing such as..

Quoted 8 lines

Review

Quoted 6 lines

/ # ls -al /mnt

dr-xr-xr-x   1 0        0               0 Jan  1 00:03 .
drwxr-xr-x  12 0        0            1024 Jul  2  2001 ..
dr-xr-xr-x   1 0        0               0 Jan  1 00:03 001
(quoted diff) +0 -2
-r--r--r--   1 0        0               0 Jan  1 00:03 devices
-r--r--r--   1 0        0               0 Jan  1 00:03 drivers

That looks like usbdevfs.

Ooppps ... you are right...

Quoted 1 line

cat /proc/mounts /proc/filesystems

/mnt # cat /proc/mounts
/dev/root / ext2 rw 0 0
/proc /proc proc rw 0 0
/dev/mtdblock0 /mnt usbdevfs rw 0 0

/mnt # cat /proc/filesystems

nodev   sockfs
nodev   shm
nodev   pipefs
nodev   proc

ext2
nodev usbdevfs
nodev devpts
jffs

but where is the flash ?
Is the major and minor number are correct which I have specified in previous mail? (for the reference mtd0 90 0, mtdr 90 1, mtdblock0 31 0) In the /proc/mtd it shows the mtd0, mtd1 and mtd2 entries. And when i give the command

Quoted 4 lines

mount -t jffs /dev/mtdblock0 /mnt/
mount: Mounting /dev/mtdblock0 on /mnt failed: Permission denied

how do I mount the jffs??

sorry to bother u all. Actually i was assigning wrong minor numbers. I got the mtdblock2 mounted using jffs2. But still jffs is not working :(

/dev # mount -t jffs /dev/mtdblock2 /mnt
jffs_scan_falsh():Free size accounting screwed
jfffs_scan_flash():free_chunk_size1 == 0x758c0, free_chunk_size2 == 0x0, fmc->free_size == 0x113540
JFFS: Failed to mount device 1f:02.
mount: Mounting /dev/mtdblock2 on /mnt failed: Invalid argument

Is jffs2 stable enough to use in production use or should i stick with jffs? If i have to use jffs please guide me in this regard.

regards,

nikunj