rootfs损坏,挂载时使用Buildroot构建的映像。

huangapple go评论69阅读模式
英文:

rootfs corrupted upon mount with Buildroot-built image

问题

在测试使用Buildroot构建的SD镜像时,一切正常,直到内核挂载根文件系统。挂载根文件系统失败,似乎还损坏了根文件系统本身(在刚刚刷新的SD卡上挂载之前会在启动前停止,然后使用e2fsck检查时不会显示错误。如果继续启动进程直到挂载错误出现,将出现多个错误)。

具体的挂载错误如下:

[    2.499914] EXT4-fs (mmcblk0p4): mounted filesystem with ordered data mode. Opts: (null). Quota mode: disabled.
[    2.508903] VFS: Mounted root (ext4 filesystem) readonly on device 179:4.
[    2.517423] devtmpfs: mounted
[    2.520778] Freeing unused kernel image (initmem) memory: 1024K
[    2.541720] Run /sbin/init as init process
[    2.679595] EXT4-fs error (device mmcblk0p4): ext4_lookup:1831: inode #138: comm init: iget: checksum invalid
[    2.690303] EXT4-fs error (device mmcblk0p4): ext4_lookup:1831: inode #127: comm init: iget: checksum invalid

启动后,尽管出现错误,根文件系统似乎部分挂载,但缺少许多文件。例如,init程序存在并且可以正确运行。

已尝试以下操作:

  • 更换SD卡。
  • 完全(dist)清理和重建。
  • 使用已知可工作的内核配置(因此问题不在于内核)。值得一提的是,从NFS引导可行。

什么可能会导致这种错误?我可以在内核中启用哪些选项来帮助我调试这个问题?

英文:

When testing a SD image built with Buildroot, everything works until the rootfs is mounted by the kernel. Mounting the rootfs fails, and also appears to corrupt the rootfs itself (halting boot with a freshly flashed SD card just before the mount then checking with e2fsck reveals no errors. Multiple errors appear if the boot process is continued until the mount error appears).

The specific mount errors are:

[    2.499914] EXT4-fs (mmcblk0p4): mounted filesystem with ordered data mode. Opts: (null). Quota mode: disabled.
[    2.508903] VFS: Mounted root (ext4 filesystem) readonly on device 179:4.
[    2.517423] devtmpfs: mounted
[    2.520778] Freeing unused kernel image (initmem) memory: 1024K
[    2.541720] Run /sbin/init as init process
[    2.679595] EXT4-fs error (device mmcblk0p4): ext4_lookup:1831: inode #138: comm init: iget: checksum invalid
[    2.690303] EXT4-fs error (device mmcblk0p4): ext4_lookup:1831: inode #127: comm init: iget: checksum invalid

After booting, the root filesystem appears partially mounted despite the errors, but missing a lot of files. For example the init program is present and runs correctly.

The following was attempted:

  • Changing the SD card.
  • Full (dist)clean and rebuild.
  • Using a kernel configuration that is known to work (so the problem isn't in the kernel). For the record, booting from NFS works.

What could produce such an error? What options can I enable in the kernel to help me with debugging this?

答案1

得分: 0

原来我在U-Boot中使用了错误的设备树。设备树之间的差异很小,但肯定存在一些关于SDMMC外设的差异。

英文:

Turns out I was using the wrong device tree in U-Boot. The difference between the device tree is minimal but certainly there must be some difference regarding the SDMMC peripherals.

huangapple
  • 本文由 发表于 2023年5月25日 01:54:19
  • 转载请务必保留本文链接:https://go.coder-hub.com/76326241.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定