You are not logged in.

#1 2022-07-23 21:25:53

branthebuilder
Member
Registered: 2016-10-01
Posts: 65

Migrate from GRUB to systemd-boot

The wiki entry for installing systemd-boot states

This assumes that you have chrooted to your system's mount point.

I don't know what that means when trying to migrate the current system. Do I have to boot into a live environment and chroot from there to install systemd-boot in the installed system? Or do I chroot into /boot?

Secondary question, the wiki says bootctl install will attempt to install at /efi, /boot, and /boot/efi. My current installation has /boot/EFI/ and /boot/grub. In the /boot/EFI directory there is /boot/bootx64.efi and /boot/grubx64.efi. Will bootctl install overwrite one or both of those? Should I prepare /boot first by

mkdir /boot/efi

Offline

#2 2022-07-23 22:01:05

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,772

Re: Migrate from GRUB to systemd-boot


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#3 2022-07-23 22:14:43

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,845
Website

Re: Migrate from GRUB to systemd-boot

You don't need to boot a LiveCD to install/setup systemd-boot if you're already booted into your install.

My current installation has /boot/EFI/ and /boot/grub.

Which of these, if either, is your ESP mount point? What is the output of 'mount'?


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#4 2022-07-23 23:01:54

branthebuilder
Member
Registered: 2016-10-01
Posts: 65

Re: Migrate from GRUB to systemd-boot

'mount':

proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
sys on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
dev on /dev type devtmpfs (rw,nosuid,relatime,size=10172720k,nr_inodes=2543180,mode=755,inode64)
run on /run type tmpfs (rw,nosuid,nodev,relatime,mode=755,inode64)
efivarfs on /sys/firmware/efi/efivars type efivarfs (rw,nosuid,nodev,noexec,relatime)
/dev/sdb2 on / type btrfs (rw,relatime,ssd,space_cache=v2,subvolid=5,subvol=/)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev,inode64)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
cgroup2 on /sys/fs/cgroup type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate,memory_recursiveprot)
pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime)
bpf on /sys/fs/bpf type bpf (rw,nosuid,nodev,noexec,relatime,mode=700)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=30,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=12482)
mqueue on /dev/mqueue type mqueue (rw,nosuid,nodev,noexec,relatime)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime,pagesize=2M)
debugfs on /sys/kernel/debug type debugfs (rw,nosuid,nodev,noexec,relatime)
tracefs on /sys/kernel/tracing type tracefs (rw,nosuid,nodev,noexec,relatime)
configfs on /sys/kernel/config type configfs (rw,nosuid,nodev,noexec,relatime)
fusectl on /sys/fs/fuse/connections type fusectl (rw,nosuid,nodev,noexec,relatime)
/dev/sdb1 on /boot type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro)
/dev/sda7 on /.snapshots type btrfs (rw,relatime,space_cache=v2,subvolid=256,subvol=/.snapshots)
/dev/sda7 on /data type btrfs (rw,relatime,space_cache=v2,subvolid=257,subvol=/data)
/dev/sda6 on /tmp type btrfs (rw,relatime,space_cache=v2,subvolid=5,subvol=/)
/dev/sda5 on /var type btrfs (rw,relatime,space_cache=v2,subvolid=5,subvol=/)
tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=2037620k,nr_inodes=509405,mode=700,uid=1000,gid=1000,inode64)
gvfsd-fuse on /run/user/1000/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000)

Offline

#5 2022-07-23 23:27:23

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,845
Website

Re: Migrate from GRUB to systemd-boot

So your ESP is /dev/sdb1 and is mounted to /boot. That is fine. 'bootctl install' should work fine without needing to specify the ESP path manually.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#6 2022-07-23 23:30:26

branthebuilder
Member
Registered: 2016-10-01
Posts: 65

Re: Migrate from GRUB to systemd-boot

Running

# bootctl install

returns

Couldn't find EFI system partition. It is recommended to mount it to /boot or /efi.
Alternatively, use --esp-path= to specify path to mount point.

Offline

#7 2022-07-24 01:03:18

JaydenDev
Member
Registered: 2022-07-11
Posts: 172

Re: Migrate from GRUB to systemd-boot

branthebuilder wrote:

Running

# bootctl install

returns

Couldn't find EFI system partition. It is recommended to mount it to /boot or /efi.
Alternatively, use --esp-path= to specify path to mount point.

Is your EFI partition mounted? Paste the output of lsblk in code tags. I really have to get better at reading the entire post, turns out you already posted the output of 'mount'. In that case, if your boot partition is mounted. There's no reason for it to fail.

Last edited by JaydenDev (2022-07-24 01:04:33)


System Specs:
Intel Core i5-2400 Nvidia GTX 1050ti Logitech G402 Hyperion Fury (Mouse) BestBuy Essentials USB Keyboard
Software Specifications:
Desktop Environment: KDE Plasma Window Manager: KWin Operating System: Arch Linux (btw)

Offline

#8 2022-07-24 02:32:26

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,544

Re: Migrate from GRUB to systemd-boot

How about `fdisk -l /dev/sdb`?

Online

#9 2022-07-24 17:27:43

branthebuilder
Member
Registered: 2016-10-01
Posts: 65

Re: Migrate from GRUB to systemd-boot

Scimmia wrote:

How about `fdisk -l /dev/sdb`?

Disk /dev/sdb: 465.76 GiB, 500107862016 bytes, 976773168 sectors
Disk model: Samsung SSD 850
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x9b26b00a

Device     Boot  Start       End   Sectors   Size Id Type
/dev/sdb1  *      2048    616447    614400   300M ef EFI (FAT-12/16/32)
/dev/sdb2       616448 976773167 976156720 465.5G 83 Linux

Seems weird that if I run "# bootctl status" I get "Couldn't find EFI system partition." but if I run "#bootctl status --esp-path=/boot" I get

File system "/dev/block/8:17" is not on a GPT partition table.
systemd-boot not installed in ESP.
System:
     Firmware: n/a (n/a)
  Secure Boot: disabled (unsupported)
 TPM2 Support: no
 Boot into FW: not supported

Current Boot Loader:
      Product: n/a
     Features: ✗ Boot counting
               ✗ Menu timeout control
               ✗ One-shot menu timeout control
               ✗ Default entry control
               ✗ One-shot entry control
               ✗ Support for XBOOTLDR partition
               ✗ Support for passing random seed to OS
               ✗ Load drop-in drivers
               ✗ Boot loader sets ESP information
          ESP: n/a
         File: └─n/a

Random Seed:
 Passed to OS: no
 System Token: not set
       Exists: no

Available Boot Loaders on ESP:
          ESP: /boot
         File: └─/EFI/BOOT/bootx64.efi

Boot Loaders Listed in EFI Variables:
Boot Loader Entries:
        $BOOT: /boot

0 entries, no entry could be determined as default.

Last edited by branthebuilder (2022-07-24 19:50:12)

Offline

#10 2022-07-24 20:31:17

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,544

Re: Migrate from GRUB to systemd-boot

Disklabel type: dos

That's likely a problem. You should be using GPT for UEFI.

Online

#11 2022-07-24 21:51:26

branthebuilder
Member
Registered: 2016-10-01
Posts: 65

Re: Migrate from GRUB to systemd-boot

That makes sense. Probably not something I should change while booted into that system. I could boot to live USB and repartition and then just install systemd-boot from there, yeah?

Offline

#12 2022-07-24 22:50:42

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,544

Re: Migrate from GRUB to systemd-boot

You can convert the disk to GPT with gdisk, but yeah, you'd want to do that from the live USB. Make sure to set the correct partition types if it doesn't do it automatically.

Last edited by Scimmia (2022-07-24 22:51:01)

Online

#13 2022-08-14 00:53:29

branthebuilder
Member
Registered: 2016-10-01
Posts: 65

Re: Migrate from GRUB to systemd-boot

Well this ended up being a more painful odyssey than I would have liked. I ended up not being able to just change the disklabel with gdisk. I had to delete the partition and recreate it because there was an issue with block alignment or something. So then I was able to install systemd-boot with `bootctl install` but that was also tricky. You can't run that from the chroot environment because it lacked access to the device. So from the LiveUSB with the boot partition mounted I did `bootctl install --esp-path=/path/to/mounted/boot`. I then forgot to add the loader *.conf files, but got that sorted pretty quick. Finally I had fortunately backed up the old boot partition and could just copy over my kernel img files and we're in business.

Offline

Board footer

Powered by FluxBB