[systemd-devel] howto switch from grub2-bios to systemd-boot

Michał Zegan webczat_200 at poczta.onet.pl
Mon Jun 22 15:19:16 UTC 2020


The thing that loads kernel and initramfs must itself be able to read
the fs, and systemd-boot delegates to uefi for that.
So things should be in ESP or you should use grub2 on uefi too and have
the grub image itself on ESP only.
Not sure about the current required partition structure I.E. where ESP
would then be mounted, though. If you have a gpt with biosboot then you
should be able to leave all grub files intact as even uefi-compatible
grub modules are in a separate directory from what I remember. although
I may be wrong at that last point because I was not using grub for some
time.

W dniu 22.06.2020 o 16:01, Reindl Harald pisze:
> what is the best way to get a Fedora using legacy-boot to UEFI and at
> the same time switch from grub2 to systemd-boot?
> 
> * how to get in installed from a live-iso to
>   the existing setup on disk
> * how to get the config files right at the first try
> * how does it work with kernel-updates
> * how to get GRUB_CMDLINE_LINUX over
> * is it possible to not kill grub2 for the time beeing
>   to boot back into BIOS-mode in case of emergency
> 
> can /boot holding the kernel itself still be a Linux RAID1 or classical
> ext4 partition or is it required that the kernel and initrd live on the
> EFI partition too?
> 
> how to get the mounts right?
> how to get the files to the correct locations?
> 
> -------------------------------------------------------
> 
> the "EFI system partition" is prepared, in that case as partition on the
> first vdisk (VMware)
> 
> in the future i need to replace my physical machines where i don't wont
> do touch the RAID1/RAID10 holding systemd and data dating back to 2011
> and in that case i consider to use a usb-drive for the EFI partition
> 
> so this is more or less a testballon for the production servers given
> that ove time i would like to switch completly to systemd-boot
> 
> -------------------------------------------------------
> 
> everything i found is talking about "you have already bootet in UEFI
> mode" which makes it a little hard especially when it comes to dnf
> operations
> 
> https://kowalski7cc.xyz/blog/systemd-boot-fedora-32/
> 
> what i don't like here at all is this (besides sudo):
> sudo dnf remove grubby grub2\* shim\* memtest86\ && sudo rm -rf
> /boot/grub2 && sudo rm -rf /boot/loader
> 
> -------------------------------------------------------
> 
> [root at testserver:~]$ df
> Filesystem     Type  Size  Used Avail Use% Mounted on
> /dev/sdb1      ext4   12G  6.3G  5.4G  54% /
> /dev/sda3      ext4  376M   43M  310M  12% /boot
> /dev/sda1      vfat  100M     0  100M   0% /boot/efi
> /dev/md0       ext4  1.9G  3.0M  1.9G   1% /mnt/raid10
> 
> -------------------------------------------------------
> 
> Number  Start (sector)    End (sector)  Size       Code  Name
>    1            2048          206847   100.0 MiB   EF00  EFI system
> partition
>    2          206848          227327   10.0 MiB    EF02  BIOS boot partition
>    3          227328         1048542   401.0 MiB   8300  Linux filesystem
> 
> -------------------------------------------------------
> 
> that was the steps to prepare the partitioning and re-install grub2 for
> now on the new layout which could be dd'ed to dozenzs of identical
> machines with one step
> 
> * rsync.sh /boot/ /data/boot/
> * umount /boot/
> * dd if=/dev/zero of=/dev/sda
> * partprobe /dev/sda
> * gdisk /dev/sda
> * o
> * n
> * end at +100M
> * type: EF00 (EFI-System)
> * n (Neue Partition erzeugen)
> * end at +10M
> * type: ef02 (BIOS boot partition)
> * n (Neue Partition erzeugen)
> + accept defaults
> * w
> * partprobe /dev/sda
> * mkfs.vfat /dev/sda1
> * mkfs.ext4 -I 256 -O ^has_journal /dev/sda3
> * e2label /dev/sda3 boot
> * UUID der bootdisk in /etc/fstab aktualisieren
> * systemctl daemon-reexec
> * mount /dev/sdb3 /boot/
> * rsync.sh /data/boot/ /boot/
> * grub2-install /dev/sda
> 
> -------------------------------------------------------
> 
> [root at testserver:~]$ cat /etc/default/grub
> GRUB_TIMEOUT=2
> GRUB_DISTRIBUTOR="Fedora"
> GRUB_SAVEDEFAULT="false"
> GRUB_TERMINAL_OUTPUT="console"
> GRUB_GFXPAYLOAD_LINUX="text"
> GRUB_CMDLINE_LINUX="quiet transparent_hugepage=never edd=off
> hpet=disable audit=0 rd.plymouth=0 plymouth.enable=0 zswap.enabled=0
> nodmraid raid=noautodetect nomodeset selinux=0 net.ifnames=0
> biosdevname=0 noswapaccount nousb usbcore.nousb noisapnp noresume
> hibernate=no kaslr thermal.off=1 nmi_watchdog=0 consoleblank=0 rd.luks=0
> rd.lvm=0 rd.md=0 rd.dm=0 vconsole.font=latarcyrheb-sun16
> vconsole.keymap=de-latin1-nodeadkeys locale.LANG=C.UTF-8"
> GRUB_DISABLE_RECOVERY="true"
> GRUB_DISABLE_SUBMENU="true"
> GRUB_DISABLE_OS_PROBER="true"
> GRUB_ENABLE_BLSCFG="false"
> _______________________________________________
> systemd-devel mailing list
> systemd-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/systemd-devel
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20200622/0e398ed4/attachment.sig>


More information about the systemd-devel mailing list