24.12.2020 20:08, Istvan Gabor пишет:
Hello:
I would like to set up a Leap 15.1 system that boots from a md raid1 array.
I have a sample configuration from a working debian system that boots from raid1 array. However there are 2 things in the sample configuration I don't understand.
The working debian grub.cfg has this:
### BEGIN /etc/grub.d/10_linux ### menuentry 'Debian GNU/Linux, with Linux 3.2.0-4-686-pae' --class debian --class gnu-linux --class gnu --class os { load_video insmod gzio insmod raid insmod mdraid1x insmod part_msdos insmod part_msdos insmod ext2 set root='(mduuid/4245........a8)' search --no-floppy --fs-uuid --set=root 68b........26e echo 'Loading Linux 3.2.0-4-686-pae ...' linux /boot/vmlinuz-3.2.0-4-686-pae root=UUID=68b........26e ro nomodeset quiet echo 'Loading initial ramdisk ...' initrd /boot/initrd.img-3.2.0-4-686-pae }
My questions:
1. It seems that grub sets the root device using the array's uuid (mduuid). Than it searches for file-system id, and sets the root to that file system. Isn't it enough to set the root using only one of these methods? Either by mduuid or by fs-uuid? Is it necessary to use both?
This is generated by scripts. Nobody bothered fine tune these scripts to consider such inter-dependencies. In general it cannot be assumed that device enumeration at boot time is the same as device enumeration in booted system, so the first assignment sets default based on guessing and search makes sure correct device is found even if grub guessed wrong.
What occurs if the the fs-uuid of the mduuid device's file system is not equal to the one given in the search command?
The value of "root" variable does not change.
2. insmod part_msdos command is given 2 times. I guess it would be OK to use only once. Is this correct?
Yes.