Skip to contentSkip to conversation

JFFS2: cannot execute /bin/bash: Permission denied

DISCUSSION Michael Rothwell 2 participants 4 messages Dec 1, 2001 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

I'm building a JFFS2 filesystem on a 16MB CF card. If I try to run bin/bash (really ash) from the mounted filesystem, it runs. But it will not run when booting from the flash card, or chrooting into it:

[root@gromit flash]# chroot /mnt/flash
chroot: cannot execute /bin/bash: Permission denied

I have also tried real bash, just to see.

[root@gromit flash]# ls -al bin/*ash

-rwxr-xr-x    1 root     root        94364 Nov 30 23:47 bin/ash
-rwxr-xr-x    1 root     root       519964 Dec  1 11:17 bin/bash

Permissions seem to be correct. Busybox init complains that it cannot execute /etc/rc.sysinit (specified in inittab, and exists with correct permissions, #!/bin/sh at the top, etc.) This happens with sh as a symlink to busybox, to ash, and to bash.

I get no error messages from JFFS2. On my desktop, I'm using a USB CF reader, and the flash shows up as /dev/sda. On the device that boots this card, it's /dev/hda. Same symptoms, "Permission denied"

/dev/mtdblock0 on /mnt/flash type jffs2 (rw)
/dev/sda1 on /mnt/flash/boot type ext2 (rw)

Any ideas?

#1 lore raw

[root@gromit flash]# chroot /mnt/flash
chroot: cannot execute /bin/bash: Permission denied

LD_DEBUG=all /mnt/flash/lib/ld-linux.so.2 --library-path /mnt/flash/lib:/mnt/flash/usr/lib /mnt/flash/bin/bash

chmod +x /mnt/flash/lib/*.so*

--
dwmw2

#2 lore raw
Quoted 1 line · David Woodhouse

chmod +x /mnt/flash/lib/*.so*

Not the problem. I did look in lib/ though, and all the symlinks were wrong. In the "source" tree, the one that I used mkfs.jffs2 on, the symlinks were correct (produced by chrooted ldconfig).

I'm using 2.4.13.

I tried copying data to the fs, and now I'm getting a disk-pounding amount of this:

Dec  1 12:43:51 gromit kernel: Argh. Special inode #1589 had more than
one node
Dec  1 12:46:32 gromit kernel: Argh. Special inode #1431 had more than
one node
Dec  1 12:46:33 gromit kernel: Argh. Special inode #1435 had more than
one node
Dec  1 12:46:33 gromit kernel: Argh. Special inode #1437 had more than
one node
Dec  1 12:46:33 gromit kernel: Argh. Special inode #1438 had more than
one node
Dec  1 12:46:33 gromit kernel: Argh. Special inode #1439 had more than
one node
Dec  1 12:46:34 gromit kernel: Argh. Special inode #1443 had more than
one node
Dec  1 12:46:35 gromit kernel: Argh. Special inode #1452 had more than
one node
Dec  1 12:47:01 gromit kernel: Eep. read_inode() failed for ino #1589
[...]
Dec  1 12:48:43 gromit last message repeated 96 times
Dec  1 12:48:43 gromit kernel: Eep. read_inod589
Dec  1 12:48:43 gromit kernel: Eep. read_inode() failed for ino #1589
Dec  1 12:48:43 gromit last message repeated 96 times
Dec  1 12:48:43 gromit kernel: Eep. read_inod589
Dec  1 12:48:43 gromit kernel: Eep. read_inode() failed for ino #1589
Dec  1 12:48:43 gromit last message repeated 96 times
Dec  1 12:48:43 gromit kernel: Eep. read_inod589
Dec  1 12:48:43 gromit kernel: Eep. read_inode() failed for ino #1589
Dec  1 12:48:43 gromit last message repeated 96 times
Dec  1 12:48:43 gromit kernel: Eep. read_inod589
Dec  1 12:48:43 gromit kernel: Eep. read_inode() failed for ino #1589
Dec  1 12:48:43 gromit last message repeated 96 times
Dec  1 12:48:43 gromit kernel: Eep. read_inod589
Dec  1 12:48:43 gromit kernel: Eep. read_inode() failed for ino #1589
Dec  1 12:48:43 gromit last message repeated 96 times
Dec  1 12:48:43 gromit kernel: Eep. read_inod589
#3 lore raw
Dec  1 12:43:51 gromit kernel: Argh. Special inode #1589 had more than
one node
Dec  1 12:48:43 gromit kernel: Eep. read_inode() failed for ino #1589
Dec  1 12:48:43 gromit last message repeated 96 times

Hmmm. Device nodes, symlinks etc should have only one valid physical node at any time. It's strange that your filesystem has violated that. Can I have a complete copy of the JFFS2 filesystem?

I should make jffs2_read_inode() recover better from this situation. Currently, it's just failing to read that inode, and the GC then gets stuck because it requires jffs2_read_inode() to succeed. I need to make the GC deal with that situation too.

--
dwmw2