Hi,

My notebook broke the screen and I use an external monitor. This external monitor only works when the system loads the video drivers. So, I can not access the bios and the selection of grub. I tried anyway to make the external monitor work as soon as you turn on the notebook, but I did not find a response anywhere, even physically unplugging the notebook screen.

This week my KaOS installation did not start correctly and because of the monitor problem, I did not know what happened. Since I do not have access to bios to change the boot via USB, I need to do a new installation by loading .iso into another partition.

I have 3 partitions, one of them has Elementary installed. So I was able to access this Elementáry by choosing the blind boot for grub.

For it I can point to an ISO and make it start by changing the grub. It works fine, but only with Ubuntu and derivatives. To make an iso of the Elementary itself I leave my grub.cfg configured like this:

menuentry "Elementary Live Desktop amd64" {
set isoname="elementaryos-0.4.1-stable.20170814.iso"
set isofile="/file/path/iso/${isoname}"
loopback loop (hd0,8)$isofile
linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=${isofile} quiet splash
initrd (loop)/casper/initrd.lz
}

Being (hd0,8) the partition where the iso file is.
After that, the system loads and it is possible to install on another partition, unmounting the /isofile before.

In Ubuntu also works by changing a small detail, but with the KaOS iso does not work. It even starts loading, but stops at a screen with a prompt for basic commands.

Then finally I ask. Is there any way to make the iso of KaOS start from another partition by grub? What changes would I need to make mo grub?

I tried this way:

menuentry "KaOS OS" {
   set isoname="KaOS-2017.11-x86_64.iso"
   set isofile="/file/path/iso/${isoname}"
   loopback loop (hd0,8)$isofile
   linux (loop)/kdeos/boot/x86_64/kdeosiso boot=kdeos/boot/x86_64/ iso-scan/filename=${isofile} quiet splash
   initrd (loop)/kdeos/boot/x86_64/kdeosiso.img
}

Where is the error?

KaOS ISOs are not set to use grub (for BIOS system it uses syslinux, for UEFI it uses systemd-boot).

Try this

menuentry "KaOS   iso"  {
    set isoname="KaOS-2017.11-x86_64.iso"
    set isofile="/file/path/iso/$isoname"
    search --no-floppy -f --set=root $isofile
    probe -u $root --set=abc
    set pqr="/dev/disk/by-uuid/$abc"
    loopback loop $isofile
    probe -l (loop) --set=klabel
    linux  (loop)/kdeos/boot/x86_64/kdeosiso  img_dev=$pqr img_loop=$isofile kdeosisobasedir=kdeos kdeosisolabel=$klabel xdriver=no nouveau.modeset=1 i915.modeset=1 radeon.modeset=1 nonfree=no
    initrd  (loop)/kdeos/boot/x86_64/kdeosiso.img
}

Yes @gohlip !! That worked.

I needed to make a small change to point out which partition was .iso (hd0,8).

It looks like this:

menuentry "KaOS iso" {
set isoname="KaOS-2017.11-x86_64.iso"
set isofile="/file/path/iso/$isoname"
search --no-floppy -f --set=root $isofile
probe -u $root --set=abc
set pqr="/dev/disk/by-uuid/$abc"
loopback loop (hd0,8)$isofile
probe -l (loop) --set=klabel
linux (loop)/kdeos/boot/x86_64/kdeosiso img_dev=$pqr img_loop=$isofile kdeosisobasedir=kdeos kdeosisolabel=$klabel xdriver=no nouveau.modeset=1 i915.modeset=1 radeon.modeset=1 nonfree=no
initrd (loop)/kdeos/boot/x86_64/kdeosiso.img
}

The system opened and I was able to install on a third partition!

Thank you!

    I have one more question, although I think it might be better to open a new topic.

    The installation was done with UEFI using systemd-boot. Before, when it was Grub, I changed the boot order in grub.cfg to choose the system I would start, since I do not have access to the list at startup because of my broken monitor.

    How do I change the boot order with systemd-boot after booting the system, to take effect in the next reboot?

      gravitacoes to make a small change to point out which partition was .iso (hd0,8).

      There is no need in this grub menu because the line
      search --no-floppy -f --set=root $isofile
      finds that isofile and set root to that partition.

      gravitacoes How do I change the boot order with systemd-boot after booting the system, to take effect in the next reboot?

      At any (uefi) linux OS in your system, first check with
      efibootmgr or 'efibootmgr -v' (for complete information of esp partitions)
      All efi boots (including system-d boot) will be listed with the bootorders.

      So say '0003' is the systemd-boot.
      To set systemd-boot at top of bootorder,
      efibootmgr -o 0003,000A,000B,000C

      Then systemd-boot will be at the top of bootorder (not only at next reboot, but always).

      To boot systemd-boot only on next reboot (not always), use

      efibootmgr -n 0003

      ps: most commands above need root (sudo)

      Oh.. if you have nvidia graphic card, KaOS is very suited for nvidia, so to boot with nvidia drivers, at the linux line above, use 'nonfree=yes'

      linux  (loop)/kdeos/boot/x86_64/kdeosiso  img_dev=$pqr img_loop=$isofile kdeosisobasedir=kdeos kdeosisolabel=$klabel xdriver=no nouveau.modeset=1 i915.modeset=1 radeon.modeset=1 nonfree=yes

      And to add Elementary into systemd-boot menu, copy its core.efi into systemd $esp and make an entry in entry directory (I assume your Elementary $esp (/boot/efi) is in another separate $esp - [1]) or you can try (after copying) at KaOS terminal.
      bootctl update

      You must copy as sym-links won't work in fat32 and $esp's are in fat32.

      Of course, Elementary OS will have KaOS automatically listed in its grub menu already with 'update-grub'.

      [1] - not good to have same $esp for Elementary and KaOS as KaOS $esp is mounted as /boot and Elementary $esp is mounted as /boot/efi

      I'm still confused. Actually, I think I'm afraid of failing.

      Now on my HD I have 8 partitions. Here is my scenario:

      /dev/sda1 Swap
      /dev/sda2 EFI system of old installations
      /dev/sda3 Elementary
      /dev/sda4 Partition only of files for backup
      /dev/sda5 /boot - EFS system linked to KaOS
      /dev/sda6 / - KaOS installed and I'm currently using
      /dev/sda7 EFI system of old installations
      /dev/sda8 Old Kaos installation with grub (broken and disabled)

      My efibootmgr:

      BootCurrent: 0002
      Timeout: 0 seconds
      BootOrder: 0002,0001,0005,0006,000B,0004,000C,000D,0003,0000
      Boot0000* Windows Boot Manager
      Boot0001* ubuntu
      Boot0002* Systemd Boot Manager
      Boot0003* linuxmint
      Boot0004* Windows Boot Manager
      Boot0005* Linux Boot Manager
      Boot0006* Windows Boot Manager
      Boot000B* TSSTcorp DVDWBD SN-406AB
      Boot000C* ubuntu
      Boot000D* ubuntu

      and my efibootmgr -v

      BootCurrent: 0002
      Timeout: 0 seconds
      BootOrder: 0002,0001,0005,0006,000B,0004,000C,000D,0003,0000
      Boot0000* Windows Boot Manager  VenHw(99e275e7-75a0-4b37-a2e6-c5385e6c00cb)WINDOWS.........x...B.C.D.O.B.J.E.C.T.=.{.9.d.e.a.8.6.2.c.-.5.c.d.d.-.4.e.7.0.-.a.c.c.1.-.f.3.2.b.3.4.4.d.4.7.9.5.}....................
      Boot0001* ubuntu        HD(2,GPT,8ce8772e-1231-4f74-ade5-e557237f4c90,0xd00000,0x100000)/File(\EFI\ubuntu\shimx64.efi)
      Boot0002* Systemd Boot Manager  HD(5,GPT,7691b24f-0269-430d-9678-19a290cb217c,0x41000000,0x100000)/File(\EFI\systemd\systemd-bootx64.efi)
      Boot0003* linuxmint     VenHw(99e275e7-75a0-4b37-a2e6-c5385e6c00cb)
      Boot0004* Windows Boot Manager  HD(2,GPT,8ce8772e-1231-4f74-ade5-e557237f4c90,0xd00000,0x100000)/File(\EFI\Microsoft\Boot\bootmgfw.efi)
      Boot0005* Linux Boot Manager    HD(2,GPT,8ce8772e-1231-4f74-ade5-e557237f4c90,0xd00000,0x100000)/File(\EFI\goofiboot\goofibootx64.efi)
      Boot0006* Windows Boot Manager  HD(7,GPT,4013bb95-7b3b-4c24-83f6-267c307fa803,0x66900000,0x100000)/File(\EFI\Microsoft\Boot\bootmgfw.efi)
      Boot000B* TSSTcorp DVDWBD SN-406AB      BBS(CDROM,,0x0)AMBO
      Boot000C* ubuntu        HD(2,GPT,8ce8772e-1231-4f74-ade5-e557237f4c90,0xd00000,0x100000)/File(\EFI\Ubuntu\grubx64.efi)
      Boot000D* ubuntu        HD(7,GPT,4013bb95-7b3b-4c24-83f6-267c307fa803,0x66900000,0x100000)/File(\EFI\Ubuntu\grubx64.efi)

      I studied the efibootmgr commands a bit and tested start with all inputs (sudo efibootmgr -n 000x). I noticed it has a TSSTcorp DVDWBD input, which seems to be my DVD player. It did not start with live cd too, after I chose 000B. By analyzing the outputs of the commands, I can conclude that they are old plant residues that no longer exist in HD. From what I understand I can delete those entries and leave only the one that works, right?

      I used to secure a UFI partition for each install, but I almost always chose to let Grub manage the boot. Then Elementary will not start that way. My only reason for having 2 systems working is that if something goes wrong in KaOS, I can start an OS on the same machine to try to recover it. That's what happened this week.

      I learned a lot from this topic. Thanks for the help and encouragement. I'll get a solution, even if I have to take the HD to another machine.

      KaOS is great!

        Generally speaking, using grub2 only, most have only one $esp, and that is for all OS's.
        And that is also sharing with windows.
        But windows major updates sometimes bork all the linux 'things' in the shared $esp and we need to fix back the linux bootloaders.

        With systemd-boot sharing with windows, these major windows updates also bork the systemd-boot 'things' in the shared $esp; again we will need to fix back the systemd-boot (perhaps a bit easier).

        But with having a separate windows $esp (so it cannot bork any linux 'things'), systemd-boot will not be able to pick up the windows OS in the menu and boot it [1]. Whereas in grub2, linux grub can pick up windows OS in another $esp, as would another systemd-boot linux in another $esp (or any linux with their own $esp)

        [1] - we can copy window's bootmgfw.efi to systemd-boot $esp though and create an entry for it in the systemd menu.

        So all linux OS's using $esp as /boot/efi (grub2) can use the same $esp but since systemd-boot uses $esp as /boot, it is advisable to use a different $esp separate from linux OS's using grub2. Of course if other linux's use systemd-boot, it can share the same $esp as KaOS.

        gravitacoes From what I understand I can delete those entries and leave only the one that works, right?

        If we remove essential bootorder, like 'hard disk' cdrom, etc.. it will regenerate back on the next reboot but I see no point in removing them. You can remove linux bootorder that you don't use anymore, but if the $esp directories are still there, it will also regenerate back also. Therefore you should remove the uninstalled linux OS directories in the $esp before removing their bootorders.

        I am not clear what other OS's you have in your system and what is their $esp partition (you said all have their own $esp's) and since uninstalled OS's still have their $esp's, I am not sure which $esp's are these.
        If you need further suggestions, please provide "sudo parted -l" (all disks), sudo blkid, and identify the OS partitions as well as their respective $esp's, and those uninstalled with $esp remaining. I have difficulty identifying what is the Elementary $esp and all the other partitions you've identified as "old installations"
        KaOS OS is in sda6, $esp in sda5. that is clear.
        Elementary OS in sda3, $esp in ??
        Anything else? Ubuntu? Linux Mint? No windows? In another disk perhaps?
        Reminder, provide parted -l and blkid of all disks (that is., if you need further clarification)

        BTW, the 'UUID's shown in 'efibootmgr -v are not UUID's but PARTUUID's.

        Glad that you have booted and installed KaOS (with the faulty laptop screen) and cheers.

        I decided not to make any changes for now, since everything is working.
        I leave here the exits of the commands as clarification.

        sudo parted -l

        Modelo: ATA ST1000LM024 HN-M (scsi)
        Disco /dev/sda: 1000GB
        Tamanho do setor (lógico/físico): 512B/4096B
        Tabela de partições: gpt
        Opções de disco: 
        
        Número  Início  Fim     Tamanho  Sistema de arquivos  Nome                  Opções
         1      1049kB  6979MB  6978MB   linux-swap(v1)
         2      6979MB  7516MB  537MB    fat32                EFI System Partition  boot, esp
         3      7516MB  21,5GB  14,0GB   ext4
         4      21,5GB  558GB   537GB    ext4
         5      558GB   559GB   537MB    fat32                                      boot, esp
         6      559GB   881GB   322GB    ext4                                       boot, esp
         7      881GB   882GB   537MB    fat32                EFI System Partition  msftdata
         8      882GB   1000GB  119GB    ext4

        sudo blkid

        /dev/sda1: UUID="b7a39558-864b-47d0-8f47-9bf79b8a40e8" TYPE="swap" PARTUUID="e2e21ddd-3920-4ddc-869a-1d2986bf91bb"
        /dev/sda2: UUID="2168-FAFB" TYPE="vfat" PARTLABEL="EFI System Partition" PARTUUID="8ce8772e-1231-4f74-ade5-e557237f4c90"
        /dev/sda3: UUID="ace6932c-651a-4173-a46c-2a048a867f55" TYPE="ext4" PARTUUID="c79801d2-7768-40b4-989f-6757f4c918b9"
        /dev/sda4: UUID="d48d03ad-d3f0-4327-841c-21c79a4a4f0f" TYPE="ext4" PARTUUID="48237d69-3115-47dd-9800-32e3307c27c6"
        /dev/sda5: UUID="DC2C-3DFE" TYPE="vfat" PARTUUID="7691b24f-0269-430d-9678-19a290cb217c"
        /dev/sda6: UUID="9225f7ca-c3e6-4476-abcd-9854d5110ed4" TYPE="ext4" PARTUUID="dc039da4-1b52-4ef4-9729-5b3accd8dcab"
        /dev/sda7: UUID="4D1A-D8C1" TYPE="vfat" PARTLABEL="EFI System Partition" PARTUUID="4013bb95-7b3b-4c24-83f6-267c307fa803"
        /dev/sda8: UUID="784d219f-cae1-421f-87ec-0ba5aef4b273" TYPE="ext4" PARTUUID="1a6798c0-4004-4928-b53e-e9ff830d8cf5"

        Thank you again

        Writing ahead because it is very late here.

        If what I think is correct, you only have KaOS in your system.
        All other OS's are non-functional, including Elementary OS.
        (Your first post gives the impression Elementary is working).

        If that is the case, use gparted to format all these partitions: do not delete or resize.
        Leaving only the following untouched.
        sda1 -swap
        sda4 - files
        sda5 - kaos $esp
        sda6 - kaos OS

        Then boot into KaOS and remove non-essential bootorders.
        First check again with 'efibootmgr'
        Remove bootorders as follows.
        sudo efibootmgr -b 0000 -B
        sudo efibootmgr -b 0001 -B
        sudo efibootmgr -b 0003 -B
        sudo efibootmgr -b 0004 -B
        sudo efibootmgr -b 0005 -B
        sudo efibootmgr -b 0006 -B
        sudo efibootmgr -b 000C -B
        sudo efibootmgr -b 000D -B

        What should remain is only systemd-boot bootorder and other hardware (hard disk, cdrom...) boots.

        Good night and good luck.