天嵌 ARM开发社区

 找回密码
 注册
查看: 5607|回复: 10

请问YAFFS2文件系统只读是怎么造成的?

[复制链接]
xiang8000 发表于 2010-11-14 23:18:32 | 显示全部楼层 |阅读模式
文件系统中的文件夹已经设置为777权限了?
这是我内核中分配情况:
Bad eraseblock 3357 at 0x000003474000
Creating 3 MTD partitions on "NAND 64MiB 3,3V 8-bit":
0x000000000000-0x000000030000 : "XIANG BOOT"
0x000000050000-0x000000250000 : "XIANG KERNEL"
0x000000250000-0x000003ffc000 : "XIANG FILESYSTEM"
usbmon: debugfs is not available

然后这里内核启动过程中对YAFFS文件系统的显示提示:
TCP cubic registered
NET: Registered protocol family 17
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
drivers/rtc/hctosys.c: unable to open rtc device (rtc0)
yaffs: dev is 32505858 name is "mtdblock2"
yaffs: passed flags ""
yaffs: Attempting MTD mount on 31.2, "mtdblock2"
yaffs: block 1525 is marked bad
block 1526 is bad
yaffs: block 3209 is marked bad
block 3210 is bad
yaffs_read_super: isCheckpointed 0
VFS: Mounted root (yaffs filesystem) readonly on device 31:2.
这里是不是有点什么问题?
Freeing init memory: 192K

Please press Enter to activate this console. /sbin/net_config: line 2: can't create /dev/s3c2410_serial0: Read-only file system
/sbin/net_config: line 5: can't create /dev/s3c2410_serial0: Read-only file system
eth0: link down
/sbin/net_config: line 5: can't create /dev/s3c2410_serial0: Read-only file system
/sbin/net_config: line 5: can't create /dev/s3c2410_serial0: Read-only file system
/sbin/net_config: line 20: can't create /dev/s3c2410_serial0: Read-only file system
eth0: link up, 100Mbps, full-duplex, lpa 0x45E1
上面这些红色的就是问题了……渴望求解
[root@XIANG2440 /]#     //能够正常进入命令提示符
 楼主| xiang8000 发表于 2010-11-15 00:30:50 | 显示全部楼层
刚才又试了一下,如果删掉/dev/null设备文件,那么引导进文件系统的时候就不会出现这个提示字样:
/sbin/net_config: line 5: can't create /dev/s3c2410_serial0: Read-only file system
并且可以在文件夹下面创建文件,但是重启后所创建的文件就没有了,又恢复了未创建时的原样,怎么回事呢?到底是哪里出了问题了呢?
天嵌_support1 发表于 2010-11-15 10:48:32 | 显示全部楼层
2# xiang8000


/sbin/net_config

这里的配置是什么呢?
 楼主| xiang8000 发表于 2010-11-15 17:43:31 | 显示全部楼层
/sbin/net_config内容如下:

#!/bin/sh
echo Try to bring eth0 interface up ...>/dev/s3c2410_serial0
if [ -f /etc/net.conf ] ; then
    source /etc/net.conf
    ifconfig eth0 down
    ifconfig eth0 hw ether $MAC
    echo ifconfig eth0 hw ether $MAC >/dev/s3c2410_serial0
    ifconfig eth0 $IPADDR netmask $NETMASK up
    echo ifconfig eth0 $IPADDR netmask $NETMASK up >/dev/s3c2410_serial0
    route add default gw $GATEWAY
    echo add default gw $GATEWAY >/dev/s3c2410_serial0
else
    ifconfig eth0 hw ether 10:23:45:67:89:ab
    ifconfig eth0 192.168.1.105 netmask 255.255.255.0 up
    route add default gw 192.168.1.1
    echo ifconfig eth0 hw ether 10:23:45:67:89:ab >/dev/s3c2410_serial0
    echo ifconfig eth0 192.168.1.105 netmask 255.255.255.0 up >/dev/s3c2410_serial0
    echo route add default gw 192.168.1.1 >/dev/s3c2410_serial0
fi
echo Done > /dev/s3c2410_serial0
 楼主| xiang8000 发表于 2010-11-15 23:56:07 | 显示全部楼层
不应该是/sbin/net_config中的命令引起的,应该是文件只读这个问题引起的,因为我像挂载命令这些都会出现Read-only file system字样,因为是只读,所以这里就提示了/sbin/net_config中命令不能创建的提示……麻烦大家帮忙找下问题的所在!不胜感激
 楼主| xiang8000 发表于 2010-11-16 00:27:49 | 显示全部楼层
完整的启动代码:求高手帮助
U-Boot 2009.08 (11月 09 2010 - 17:32:08)

DRAM:  64 MB
Flash:  2 MB
NAND:  NAND_ECC_NONE selected by board driver. This is not recommended !!
64 MiB
In:    serial
Out:   serial
Err:   serial
Net:   dm9000
Hit any key to stop autoboot:  0

NAND read: device 0 offset 0x50000, size 0x200000
2097152 bytes read: OK
## Booting kernel from Legacy Image at 30000000 ...
   Image Name:   linux-2.6.30.4
   Created:      2010-11-14  11:13:56 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    1914708 Bytes =  1.8 MB
   Load Address: 30008000
   Entry Point:  30008000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK
OK

Starting kernel ...

Uncompressing Linux........................................................................................................................ done, booting the kernel.
Linux version 2.6.30.4 (root@linux) (gcc version 4.3.2 (Sourcery G++ Lite 2008q3-72) ) #8 Sun Nov 14 19:11:56 CST 2010
CPU: ARM920T [41129200] revision 0 (ARMv4T), cr=00007177
CPU: VIVT data cache, VIVT instruction cache
Machine: SMDK2440
Warning: bad configuration page, trying to continue
Memory policy: ECC disabled, Data cache writeback
CPU S3C2440A (id 0x32440001)
S3C24XX Clocks, (c) 2004 Simtec Electronics
S3C244X: core 405.000 MHz, memory 101.250 MHz, peripheral 50.625 MHz
CLOCK: Slow mode (1.500 MHz), fast, MPLL on, UPLL on
Built 1 zonelists in Zone order, mobility grouping off.  Total pages: 4064
Kernel command line: root=/dev/mtdblock2 ro init=/linuxrc console=ttySAC0
NR_IRQS:85
irq: clearing pending ext status 00080000
irq: clearing subpending status 00000002
PID hash table entries: 64 (order: 6, 256 bytes)
Console: colour dummy device 80x30
console [ttySAC0] enabled
Dentry cache hash table entries: 2048 (order: 1, 8192 bytes)
Inode-cache hash table entries: 1024 (order: 0, 4096 bytes)
Memory: 16MB = 16MB total
Memory: 12260KB available (3304K code, 311K data, 192K init, 0K highmem)
Calibrating delay loop... 50.38 BogoMIPS (lpj=125952)
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
net_namespace: 936 bytes
NET: Registered protocol family 16
S3C Power Management, Copyright 2004 Simtec Electronics
S3C2440: Initialising architecture
S3C2440: IRQ Support
S3C24XX DMA Driver, (c) 2003-2004,2006 Simtec Electronics
DMA channel 0 at c1808000, irq 33
DMA channel 1 at c1808040, irq 34
DMA channel 2 at c1808080, irq 35
DMA channel 3 at c18080c0, irq 36
S3C244X: Clock Support, DVS off
bio: create slab <bio-0> at 0
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
s3c2440-i2c s3c2440-i2c: slave address 0x10
s3c2440-i2c s3c2440-i2c: bus frequency set to 98 KHz
s3c2440-i2c s3c2440-i2c: i2c-0: S3C I2C adapter
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 512 (order: 0, 4096 bytes)
TCP bind hash table entries: 512 (order: -1, 2048 bytes)
TCP: Hash tables configured (established 512 bind 512)
TCP reno registered
NET: Registered protocol family 1
NetWinder Floating Point Emulator V0.97 (extended precision)
JFFS2 version 2.2. (NAND) (SUMMARY)  漏 2001-2006 Red Hat, Inc.
ROMFS MTD (C) 2007 Red Hat, Inc.
yaffs Nov 14 2010 19:06:21 Installing.
msgmni has been set to 23
io scheduler noop registered
io scheduler anticipatory registered (default)
io scheduler deadline registered
io scheduler cfq registered
Console: switching to colour frame buffer device 40x30
fb0: s3c2410fb frame buffer device
lp: driver loaded but no devices found
ppdev: user-space parallel port driver
Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
s3c2440-uart.0: s3c2410_serial0 at MMIO 0x50000000 (irq = 70) is a S3C2440
s3c2440-uart.1: s3c2410_serial1 at MMIO 0x50004000 (irq = 73) is a S3C2440
s3c2440-uart.2: s3c2410_serial2 at MMIO 0x50008000 (irq = 76) is a S3C2440
brd: module loaded
loop: module loaded
Uniform Multi-Platform E-IDE driver
ide-gd driver 1.18
ide-cd driver 5.00
Driver 'sd' needs updating - please use bus_type methods
dm9000 Ethernet Driver, V1.31
Now use the default MAC address:10:23:45:67:89:ab
dm9000 dm9000.0: eth%d: Invalid ethernet MAC address. Please set using ifconfig
eth0 (dm9000): not using net_device_ops yet
eth0: dm9000e at c186e300,c1872304 IRQ 51 MAC: 00:00:00:00:00:00 (chip)
S3C24XX NAND Driver, (c) 2004 Simtec Electronics
s3c2440-nand s3c2440-nand: Tacls=3, 29ns Twrph0=7 69ns, Twrph1=3 29ns
NAND device: Manufacturer ID: 0xec, Chip ID: 0x76 (Samsung NAND 64MiB 3,3V 8-bit)
Scanning device for bad blocks
Bad eraseblock 1673 at 0x000001a24000
Bad eraseblock 3357 at 0x000003474000
Creating 3 MTD partitions on "NAND 64MiB 3,3V 8-bit":
0x000000000000-0x000000030000 : "XIANG BOOT"
0x000000050000-0x000000250000 : "XIANG KERNEL"
0x000000250000-0x000003ffc000 : "XIANG FILESYSTEM"
usbmon: debugfs is not available
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
s3c2410-ohci s3c2410-ohci: S3C24XX OHCI
s3c2410-ohci s3c2410-ohci: new USB bus registered, assigned bus number 1
s3c2410-ohci s3c2410-ohci: irq 42, io mem 0x49000000
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 2 ports detected
usbcore: registered new interface driver libusual
usbcore: registered new interface driver usbserial
USB Serial support registered for generic
usbcore: registered new interface driver usbserial_generic
usbserial: USB Serial Driver core
USB Serial support registered for FTDI USB Serial Device
usbcore: registered new interface driver ftdi_sio
ftdi_sio: v1.4.3:USB FTDI Serial Converters Driver
USB Serial support registered for pl2303
usbcore: registered new interface driver pl2303
pl2303: Prolific PL2303 USB to serial adaptor driver
mice: PS/2 mouse device common for all mice
S3C24XX RTC, (c) 2004,2006 Simtec Electronics
S3C2410 Watchdog Timer, (c) 2004 Simtec Electronics
s3c2410-wdt s3c2410-wdt: watchdog inactive, reset disabled, irq enabled
Advanced Linux Sound Architecture Driver Version 1.0.20.
ALSA device list:
  No soundcards found.
TCP cubic registered
NET: Registered protocol family 17
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
drivers/rtc/hctosys.c: unable to open rtc device (rtc0)
yaffs: dev is 32505858 name is "mtdblock2"
yaffs: passed flags ""
yaffs: Attempting MTD mount on 31.2, "mtdblock2"
yaffs: block 1525 is marked bad
block 1526 is bad
yaffs: block 3209 is marked bad
block 3210 is bad
yaffs_read_super: isCheckpointed 0
VFS: Mounted root (yaffs filesystem) readonly on device 31:2.
Freeing init memory: 192K

Please press Enter to activate this console. /sbin/net_config: line 2: can't create /dev/s3c2410_serial0: Read-only file system
/sbin/net_config: line 5: can't create /dev/s3c2410_serial0: Read-only file system
eth0: link down
/sbin/net_config: line 5: can't create /dev/s3c2410_serial0: Read-only file system
/sbin/net_config: line 5: can't create /dev/s3c2410_serial0: Read-only file system
/sbin/net_config: line 20: can't create /dev/s3c2410_serial0: Read-only file system
eth0: link up, 100Mbps, full-duplex, lpa 0x45E1

[root@XIANG2440 /]#
天嵌_support1 发表于 2010-11-16 15:44:24 | 显示全部楼层
6# xiang8000


不知道你的串口名是什么了。
天嵌的驱动是生成 qt2440_serial0 之类的名称的。
 楼主| xiang8000 发表于 2010-11-16 22:01:17 | 显示全部楼层
本帖最后由 xiang8000 于 2010-11-16 22:06 编辑

我是自己重新移植的一遍文件系统,串口这块我没改它,源代码是怎么就怎么的,我主要就是测试U-BOOT+KERNEL+YAFFS2文件系统启动,结果就出现了只读现象,其它的设备方面我还没做什么移植

需要我这边的源代码附件包供版主测试么?U-BOOT和KERNEL和文件系统都是我重新做的,用于TQ2440上运行

网上看到说KERNEL默认挂载是只读的,我在想是不是这里的问题,请问怎么才能更改挂载文件系统时的读写权限呢?

另外也不像某篇网友所诉,他出现只读现象是因为内核分区未按其页大小的倍数来分,从而造成只读,我检查过我这个,也不是这个问题,我是成倍数的。
 楼主| xiang8000 发表于 2010-11-17 09:27:41 | 显示全部楼层
本帖最后由 xiang8000 于 2010-11-17 09:33 编辑

昨晚将朋友的YAFFS2文件系统写入我的nand,并用我的u-boot和kernel来引导他的yaffs2文件系统,成功引导进去,但是同样也是只读,看来要么问题是出在u-boot要么是出在kernel,请问这会是哪里出了问题呢?有这方面经验的朋友么?

上面终端所出现的
/sbin/net_config: line 5: can't create /dev/s3c2410_serial0: Read-only file system
是因为文件系统只读,不能创建设备文件所致,当在制作文件系统的时候在/dev文件夹下键入:
#mknod s3c2410_serial0 c 204 64     命令创建了这个设备文件后,错误提示就没有了。

所以上面的根本问题是“只读”是怎么回事,而 形成
/sbin/net_config: line 5: can't create /dev/s3c2410_serial0: Read-only file system
这个错误可以忽略不看。

麻烦各位帮忙看看~~~
天嵌_support1 发表于 2010-11-17 12:25:30 | 显示全部楼层
9# xiang8000


你的文件系统属性是只读的。
而且你没有s3c2410_serial0这个设备节点. 你先检查一下你的串口设备驱动
lixinhai06 发表于 2011-9-16 09:27:01 | 显示全部楼层
我也遇到了这个问题,请问这个问题解决了吗?
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

i.MX8系列ARM cortex A53 M4 工控板上一条 /1 下一条

Archiver|手机版|小黑屋|天嵌 嵌入式开发社区 ( 粤ICP备11094220号-2 )

GMT+8, 2024-7-5 04:44 , Processed in 1.156250 second(s), 19 queries .

Powered by Discuz! X3.4 Licensed

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表