you are viewing a single comment's thread
view the rest of the comments
[–] 3 points 10 months ago* (last edited 10 months ago)

I have to dual boot for work, so every day I have to reboot into a different OS install. It's on its own drive with its own bootloader, so I can't use systemctl reboot --boot-loader-entry. But I was able get a smooth process using efibootmgr.

This is my Nushell implementation:

def boot-to [
  device: string@boot-devices # Identifier of device to boot to (e.g. 0003)
] {
  sudo efibootmgr --bootnext $device
  systemctl reboot
}

# This function exists to provide tab completion for boot-to
def boot-devices [] {
  efibootmgr | parse --regex 'Boot(?<value>\S+)\* (?<description>(?:\w+ )*\w+)'
}
  • source