引用:
为什么在这是root=hd,到第二行就成了root=sd
第一行和第二行指定root分区有什么区别
第一行是 GRUB2 的根文件系统,第二行是 Linux 的根文件系统
对于 GRUB2 的根文件系统,GRUB2 有自己的命名规则
参见
https://www.gnu.org/software/grub/manual/html_node/Naming-convention.html这里的 (hd0,msdos1) 与 /dev/hdX 意义不同
值得注意的是,根文件系统未被挂载时 /dev 目录下大多数设备是不存在的。因此这里的 root=/dev/sda4 与系统启动后的 /dev/sda4 设备文件意义不同,仅仅是帮助内核寻找根文件系统的符号。
因此 Linux 的根文件系统也可不用 /dev/sdX 指定:
代码:
linux /boot/vmlinuz-4.2.0-1-amd64 root=UUID=4a5g55b9-6dy7-4t73-acr8-y9b9a06fgf4h ro splash acpi_backlight=vendor resume=/dev/sda4
psusi 写道:
While the argument looks like a normal device node in the /dev directory, there obviously is no /dev directory before the root fs is mounted, so the kernel can not look up a dev node there. Instead, certain well known device names are hard coded into the kernel so the string can be translated to the device number. Because of this, the kernel can recognize things like /dev/sda1, but not more exotic things like /dev/mapper/vg0-root or a volume UUID.
GRUB2 的根文件系统 和 Linux 的根文件系统 意义不同:
引用:
The use of the term root file system has a different meaning in regard to GRUB. It is important to remember that GRUB's root file system has nothing to do with the Linux root file system.
1.
The GRUB root file system is the top level of the specified device. For example, the image file (hd0,0)/grub/splash.xpm.gz is located within the /grub/ directory at the top-level (or root) of the (hd0,0) partition (which is actually the /boot/ partition for the system).
2.
Next, the kernel command is executed with the location of the kernel file as an option. Once the Linux kernel boots, it sets up the root file system that Linux users are familiar with. The original GRUB root file system and its mounts are forgotten; they only existed to boot the kernel file.
引用:
Note that GRUB's root device doesn't necessarily mean your OS's root partition; if you need to specify a root partition for your OS, add the argument into the command kernel.
参考
https://www.centos.org/docs/5/html/Installation_Guide-en-US/s1-grub-terminology.htmlhttps://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/3/html/Reference_Guide/s1-grub-commands.htmlhttp://www.dedoimedo.com/computers/grub-2.htmlhttp://www.gnu.org/software/grub/manual/grub.htmlhttps://www.gnu.org/software/grub/manual/html_node/GNU_002fLinux.htmlhttp://unix.stackexchange.com/a/18055http://unix.stackexchange.com/a/111242https://www.gnu.org/software/grub/manual/legacy/Installing-GRUB-natively.html#fn-1