简体   繁体   English

使用initramfs时,为什么不能用PARTUUID指定rootfs?

[英]Why can't I specify my rootfs with PARTUUID when I use initramfs?

I have an embedded ARM board and am experimenting with initramfs. 我有一块嵌入式ARM板,正在尝试initramfs。

Since my root filesystem is EXT4 and the EXT4 driver is built into the kernel (not compiled as a module), I can directly boot the kernel and mount the root filesystem, no initramfs required. 由于我的根文件系统是EXT4,并且EXT4驱动程序内置在内核中 (未编译为模块),因此我可以直接启动内核并挂载根文件系统,而无需使用initramfs。 Without initramfs , the kernel won't recognize filesystem UUIDs, of course, hence I specified root with the partition identifier PARTUUID , as described in the kernel docs. 当然, 如果没有initramfs ,内核将无法识别文件系统UUID,因此如内核文档中所述, 我用分区标识符PARTUUID指定了root The boot argument in question looks like this: root=PARTUUID=7acc80f1-01 This works perfectly fine. 有问题的启动参数看起来像这样:root = PARTUUID = 7acc80f1-01 可以正常工作。

Now, when I try to boot the same kernel version with an initramfs, the system won't boot . 现在,当我尝试使用initramfs引导相同的内核版本时,系统将无法引导 It complains the root device cannot be found. 它抱怨找不到根设备。 When I change my boot arguments to use the filesystem UUID intstead of the PARTUUID, then it works again : root=UUID=c9fd552c-921c-4ddb-bb46-fe557943d311 But why is that? 当我更改引导参数以使用文件系统UUID代替PARTUUID时,它又可以工作 :root = UUID = c9fd552c-921c-4ddb-bb46-fe557943d311但是为什么呢? Why would using an initramfs lead to less boot options when the kernel supports PARTUUID natively in the first place? 当内核首先本地支持PARTUUID时,为什么使用initramfs会导致更少的引导选项?

I'd like to specify root in unique way that works in both setups, regardless of whether an initramfs is used or not. 我想以一种在两种设置中都可以使用的独特方式指定root,无论是否使用initramfs。 Device names such as /dev/sda1 are not an option as they can vary during boot (multiple disks attached). 设备名称(例如/ dev / sda1)不是可选项,因为它们在引导过程中可能会有所不同(已连接多个磁盘)。

Any clues? 有什么线索吗?

Thanks and regards, 谢谢并恭祝安康,

Timo 蒂莫

PS: The kernel version is mainline 4.4.16. PS:内核版本是主线4.4.16。 U-Boot is 2015.5. U-Boot是2015.5。 Distro is Debian 8. 发行版是Debian 8。

Ok, I figured it out now. 好吧,我现在想通了。 It's a known issue in Debian's initramfs-tools package: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=801154 这是Debian的initramfs-tools软件包中的一个已知问题: https ://bugs.debian.org/cgi-bin/bugreport.cgi?bug =801154

The script used to mount the root filesystem by the initramfs doesn't support PARTUUID but only UUID. initramfs用于挂载根文件系统的脚本不支持PARTUUID,而仅支持UUID。 This has been resolved in the testing distribution, but not in current stable (Jessie). 这在测试分布中已解决,但在当前稳定版中尚未解决(Jessie)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM