我有一个基于 RiotBoard 的嵌入式系统,我将 MMC 上的主文件系统设置为只读,还有一个 8GB USB 闪存驱动器用于可写存储。 rootfs是debian,linux内核版本4.3.0-rc2-00019-gbcee19f
驱动器格式命令是
mkfs.ext4 -U 2d4d3021-ebaf-4e29-b0e4-e8068d3bd237 /dev/sda1 tune2fs /dev/sda1 -i 0 //Don't check against time clock tune2fs /dev/sda1 -c 1 //Check every time
和 FSTAB 线
UUID=2d4d3021-ebaf-4e29-b0e4-e8068d3bd237 /mnt/USB1 ext4 data=journal,nofail 0 2
我不断收到此错误
JBD2:发现脏元数据缓冲区(dev = sda1,blocknr = 1087488)。如果系统崩溃,则存在文件系统损坏的风险。
blocknr 每次都会增加。无论是意外断电还是从命令行重新启动,都会发生这种情况。我有点怀疑这个驱动器确实有问题,它是新的 sandisk 品牌驱动器。
编辑1: 重新格式化驱动器可以解决此问题,因此我不清楚为什么 /etc/default/rcS 中的 FSCKFIX=yes 无法解决此问题。 e2fsck 的输出是
Checking file systems...fsck from util-linux 2.20.1
e2fsck 1.42.5 (29-Jul-2012)
/dev/sda1: recovering journal
/dev/sda1 has been mounted 1 times without being checked, check forced.
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
Free blocks count wrong (1886088, counted=1886055).
Fix? yes
/dev/sda1: ***** FILE SYSTEM WAS MODIFIED *****
/dev/sda1: 57/488640 files (17.5% non-contiguous), 68117/1954172 blocks
fsck died with exit status 1
***skipped lines here***
JBD2: Spotted dirty metadata buffer (dev = sda1, blocknr = 1084928). There's a risk of filesystem corruption in case of system crash.