On Sun, 2019-05-26 at 08:20 -0700, stan via users wrote: > On Sun, 26 May 2019 10:49:00 +0200 > François Patte <francois.patte@xxxxxxxxxxxxxxxxxxxx> wrote: > > > Bonjour, > > > > For a long time now grubby has replaced grub2-mkconfig to update the > > grub.cfg file. From this time, I have to correct the kernel update > > manualy with grub2-mkconfig because every time grubby chooses a wrong > > partition as the / partition. > > > > The choosen partition is not mounted, it is empty, with no boot > > flag.... > > > > Why grubby chooses this partition? It is so stupide that I am > > wondering what is the way followed by grubby to to this? > > As far as I know, grubby used to merely copy the previous first entry in > the grub.cfg file and replace the old kernel with the new kernel. > So, that would imply that there is something wrong with the grub.cfg > file. Of course, grubby could have a bug, but as you say it has worked > fine for a long time. > > And, there is the new setup in F30, where it seems instead of a config > file there are scriptlets that emulate a config file. I have no first > hand experience with that, but I've seen people having trouble with it > on this list. You might be running into that. > _______________________________________________ > users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx > To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx > Fedora Code of Conduct: https://getfedora.org/code-of-conduct.html > List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines > List Archives: My understanding is that grubby has been replaced for a standard install https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.orghttps://fedoraproject.org/wiki/Changes/BootLoaderSpecByDefault Things that may be relevant: 1. Fresh install not an upgrade 2. No separate /boot partition 3. EFI boot of install media - hence EFI installation 4. No logical volumes anywhere on the SSD 5. BLS installation by default !? I carried out a clean install of F30, it may well be different for an upgrade. In my case the F30 boot using BLS was successful. However, other F28/F29 installations on the same SSD were not detected. This was because grub2-mkconfig uses os-prober which has problems. As I am not interested in booting other OS than Fedora the addition of the other Fedora to the boot menu is manageable. Approach 1 - Older Approach Generate a /etc/grub.d/40_custom file of the form [root@naxos:/boot/efi/EFI/fedora]$ cat /etc/grub.d/40_custom #!/usr/bin/sh exec tail -n +3 $0 # This file provides an easy way to add custom menu entries. Simply type the # menu entries you want to add after this comment. Be careful not to change # the 'exec tail' line above. menuentry 'ja 29 custom ' { insmod part_gpt insmod ext2 search --no-floppy --fs-uuid --set=root 1a9ccef1-af1c-4c26-8e4d-64a25bc56fcc linux /boot/vmlinuz-5.0.16-200.fc29.x86_64 root=UUID=1a9ccef1-af1c-4c26-8e4d-64a25bc56fcc initrd /boot/initramfs-5.0.16-200.fc29.x86_64.img } Run grub2-mkconfig -o test and check things are looking good replace /boot/efi/EFI/fedora/grub.cfg with this file if you are feeling confident! //--------------------------------------------------- Approach 2 - Try Using BLS approach This should be safer than option 1 as no existing files are touched Create a BLS file of the form [root@naxos:/boot/efi/EFI/fedora]$ cat /boot/loader/entries/ja_77d7a92bb0374635a7212709d7339559-5.0.17- 300.fc30.x86_64.conf title Fedora 5.0.17-300.fc30.x86_64 version 5.0.17-300.fc30.x86_64 linux /boot/fc30/vmlinuz-5.0.17-300.fc30.x86_64 initrd /boot/fc30/initramfs-5.0.17-300.fc30.x86_64.img options root=UUID=32524647-c8e8-49cb-9c6f-ae25b663fa54 grub_users $grub_users grub_arg --unrestricted grub_class kernel architecture x64 [root@naxos:/boot/efi/EFI/fedora]$ Copy the correct kernel&initramfs files to the location shown in the file above //--------------------------------------------------- The two options are not mutually exclusive - at least, not on my system! I attach a very crude script that carries out Option 2 above There is absolutely no warranty with this script!! It may give some food for thought. Again on my new F30 install, I do not think that grub2-mkconfig is not run when a kernel upgrade is installed. Only a new config file is installed in the /boot/loader/entries directory. (and the new kernel/initramfs [stored in /boot not a subdirectory]). I have successfully run the script on "other partition" to root (/) with a version of Fedora F27 or F29 installed on the particular partitions. I have also run it on the booted root (/) partition. mount |grep " / "[root@naxos:/etc/grub.d]$ mount |grep " / " /dev/nvme0n1p8 on / type ext4 (rw,relatime,seclabel) [root@naxos:/etc/grub.d]$ /home/ja/bin/part_scan.sh /dev/nvme0n1p8 32524647-c8e8-49cb-9c6f-ae25b663fa54 Machine ID = 77d7a92bb0374635a7212709d7339559 vmlinuz-5.0.17-300.fc30.x86_64 initramfs-5.0.17-300.fc30.x86_64.img 5.0.17-300 5.0.17-300.fc30.x86_64 fc30 /boot/loader/entries/ja_77d7a92bb0374635a7212709d7339559-5.0.17-300.fc30.x86_64.conf [root@naxos:/etc/grub.d]$ [root@naxos:/etc/grub.d]$ ltr /boot/fc30 total 31140 -rwxr-xr-x. 1 root root 8863944 May 26 17:54 vmlinuz-5.0.17-300.fc30.x86_64 -rw-------. 1 root root 23017597 May 26 17:54 initramfs-5.0.17-300.fc30.x86_64.img [root@naxos:/etc/grub.d]$ [root@naxos:/etc/grub.d]$ cat /boot/loader/entries/ja_77d7a92bb0374635a7212709d7339559-5.0.17- 300.fc30.x86_64.conf title naxos.jaa.org.uk /dev/nvme0n1p8 5.0.17-300.fc30.x86_64 version 5.0.17-300.fc30.x86_64 linux /boot/fc30/vmlinuz-5.0.17-300.fc30.x86_64 initrd /boot/fc30/initramfs-5.0.17-300.fc30.x86_64.img options root=UUID=32524647-c8e8-49cb-9c6f-ae25b663fa54 grub_users $grub_users grub_arg --unrestricted grub_class kernel architecture x64 [root@naxos:/etc/grub.d]$
Attachment:
part_scan.sh
Description: application/shellscript
_______________________________________________ users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx Fedora Code of Conduct: https://getfedora.org/code-of-conduct.html List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/users@xxxxxxxxxxxxxxxxxxxxxxx