前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >解决问题Linux启动错误“ERROR: There's no '/dev' on rootfs.”不能mount sda2的根文件系统。

解决问题Linux启动错误“ERROR: There's no '/dev' on rootfs.”不能mount sda2的根文件系统。

作者头像
hankfu
发布2022-10-04 08:45:03
1.9K1
发布2022-10-04 08:45:03
举报
文章被收录于专栏:hankhank

问题Linux启动错误“ERROR: There's no '/dev' on rootfs.”

使用KR260 PetaLinux 2022.1 BSP创建工程后,使用产生的wic文件烧录tf卡,Linux启动报告错误“ERROR: There's no '/dev' on rootfs.”。使用的工具是PetaLinux 2022.1.

尝试

根文件系统在/dev/sda2,Linux启动后再mount,能成功。

即使在bootargs里添加"root=/dev/sda2",也有同样错误。

再在工程里使能"CONFIG_SUBSYSTEM_ROOTFS_EXT4",也有同样错误。

解决办法

搜索相关文章,发现Xilinx已经有解决办法PetaLinux does not mount full rootfs when boot INITRD images are built using the template method

使用rootfs.cpio.gz.u-boot启动

先测试其中的 Method 2 SD boot mode。

代码语言:javascript
复制
cd <plnx-proj-root>/pre-built/linux/images/
$ cp BOOT.BIN boot.scr Image rootfs.cpio.gz.u-boot system.dtb <PATH_TO_SD_FAT32_PARTITION_MOUNT_POINT>

原来的启动分区里,有BOOT.BIN、boot.scr、Image、ramdisk.cpio.gz.u-boot, 没有rootfs.cpio.gz.u-boot、system.dtb。

代码语言:javascript
复制
hankf@XSZGS4:images$ wic ls petalinux-sdimage-rootfs.wic 
Num     Start        End          Size      Fstype
 1          4096   2147487743   2147483648  fat32
 2    2147487744   6442455039   4294967296  ext4
hankf@XSZGS4:images$ wic ls petalinux-sdimage-rootfs.wic:1
Volume in drive : is boot       
 Volume Serial Number is 9664-BAF7
Directory for ::/

BOOT     BIN   4675784 2022-09-29   7:56 
IMAGE         22401536 2022-09-29   7:56  Image
boot     scr      2777 2022-09-29   7:56 
RAMDIS~1 U-B  23216506 2022-09-29   7:56  ramdisk.cpio.gz.u-boot
        4 files          50 296 603 bytes
                      2 092 961 792 bytes free

新的办法,是复制文件BOOT.BIN、 boot.scr、 Image、 rootfs.cpio.gz.u-boot、 system.dtb到SD卡启动。也就是增加了rootfs.cpio.gz.u-boot、system.dtb,减少了ramdisk.cpio.gz.u-boot。能够正常mount sda2的根文件系统。测试成功。

工程设置

直接修改工程设置为INITRD 和 petalinux-image-minimal。按如下设置。

代码语言:javascript
复制
$ petalinux-config ---> Image Packaging Configuration ---> Root filesystem type --->(INITRD)
$ petalinux-config ---> Image Packaging Configuration ---> INITRAMFS/INITRD Image Name (petalinux-image-minimal)

修改工程设置,清除工程,再编译。

代码语言:javascript
复制
$ petalinux-build -x cleanall
$ petalinux-build

还有待测试。

先测试其中的 Method 2 SD boot mode

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2022-09-30,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 问题Linux启动错误“ERROR: There's no '/dev' on rootfs.”
  • 尝试
  • 解决办法
    • 使用rootfs.cpio.gz.u-boot启动
      • 工程设置
      领券
      问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档