通过fstab在busybox中挂载的UBIFS无法识别relatime选项

时间:2014-01-13 10:53:38

标签: linux busybox ubifs fstab

当我尝试挂载我的UBIFS文件系统时出现此错误:

mount -o remount,rw /config
UBIFS error (pid 1265): ubifs_parse_options: unrecognized mount option "relatime" or
 missing value  

我的fstab的内容是:

root@drgos:~# cat /etc/fstab                                                        
# WARNING: this is an auto generated file, please use uci to set static filesystems 
/dev/ubi0_0     /config ubifs   ro    0       0 

当我输入mount时,结果是:

root@drgos:~# mount                                                                 
rootfs on / type rootfs (rw)                                                        
none on /proc type proc (rw,relatime)                                               
none on /sys type sysfs (rw,relatime)                                               
tmpfs on /dev type tmpfs (rw,relatime,size=512k)                                    
none on /dev/pts type devpts (rw,relatime,mode=600)                                 
/dev/ubi0_0 on /config type ubifs (ro,relatime)                                     
none on /proc/bus/usb type usbfs (rw,relatime)  

我不明白为什么我有选项relatime,因为我的fstab中没有这个选项!

我正在使用BusyBox v1.11.2(2014-01-13 09:35:41 CET)多呼叫二进制文件。

1 个答案:

答案 0 :(得分:0)

这些选项取决于Linux内核版本。 relatime 是一般安装选项。 relatime 是较新Linux内核的默认设置。其他文件系统可能会悄悄忽略未知选项,而 ubifs 则失败。您可以尝试mount -o remount,rw,noatime,norelatime /config。您的mount命令显示 / config 目录随 relatime 挂载;这是收集 busybox 挂载小程序的信息。

使用getmntent_r()功能收集此信息。如果 busybox 是动态链接的,那么'C'库可能会将此信息作为* mnt_opts *字符串的一部分提供。

mount -o remount,rw,noatime,norelatime /config的想法是尝试覆盖这些信息,以便UbiFs对其挂载选项感到满意。另一种方法是再次手动umount然后mount

 umount /config
 mount -t ubifs /dev/ubi0_0 /config

这样就不会检索以前的挂载信息。