Is it possible to install a system directly from an ISO without using an installer?

One question: are you trying to use the ISO contents simply as an installer, or are you thinking of using the ISO contents like an installed system?

I assume you meant the latter, but in case you didn’t, just wanted to add this:

If you mean the first, then: ISO can be copied to a partition of another drive simply as an ISO file and use that to install EndeavourOS to the machine. You just need to add a simple grub entry to boot directly from the ISO file.

1 Like

Thanks @manuel for the reply!

This.
I’m sorry that the title of the topic is not clear enough. I should be changing it.

I’m thinking about the possibility of extracting the content of the ISO into a subvolume on a BTRFS partition, putting the files where they should be, making the necessary changes to render the system bootable/functional. Something along the lines of what @flyingcakes have done above with the only difference of the BTRFS instead of EXT4.

I got to think of this, mainly inspired by @dalto’s multiboot system on only one BTRFS partition, installing each OS into its own subvolumes.

This is very interesting as well. Having an option like this will eliminate the need for using a flashdrive for booting into the live environment in case there is a need for repair or other maintenance. Or installing the system as well. If you wouldn’t mind pointing out how I could go about to do this, I would truly appreciate.

I guess you guessed right! :slightly_smiling_face:

This is a great approach! I don’t know how you do it but I know you know how to do it.

That would be great! I couldn’t ask for more.

Here is the grub menu entry. You can write it into /boot/grub/custom.cfg, then it won’t be overwritten by any grub update.
The entry below assumes the ISO file exists under folder /ISO in the drive where you copy it. Line set isofile=... can be changed if you want to use another folder.
Additional note: the menu entry assumes Intel CPU. If you have an AMD CPU, change the microcode name on the initrd line.

menuentry 'Boot endeavouros-2021.04.17-x86_64.iso' {
    set isofile=/ISO/endeavouros-2021.04.17-x86_64.iso
    search --no-floppy --set=root --file $isofile
    probe -u $root --set=uuid
    loopback loop $isofile
    linux (loop)/arch/boot/x86_64/vmlinuz-linux img_dev=/dev/disk/by-uuid/$uuid img_loop=$isofile
    initrd  (loop)/arch/boot/intel-ucode.img (loop)/arch/boot/x86_64/archiso.img
}
2 Likes

First off, thank you so much for your input @manuel! Greatly appreciated!

I am sorry for the embarrassing typo :man_facepalming:t5:

Of course I meant, IF

That’s awesome! Thank you!
Perhaps I should adapt it to the naming of my BTRFS subvolumes? In my case they begin with @ (which is completely irrelevant for the naming of the subvolumes, something @dalto actually pointed out in another thread).

 probe -u $root --set=uuid

Also, do i need to set the proper UUID for the partition where the subvolume containing the ISO resides?

1 Like

No problem, that was easy to guess even for a non-native English guy… :wink:
I make typos as well, they are astonishingly hard to avoid! But that’s just life.

I’m not really using btrfs (only ext4) and haven’t tested this ISO entry with it, so probably @dalto can help you with the correct syntax.

The menu entry above should do it automatically. But as I said, never tested this on btfŕfs, so the syntax may have some differences.

1 Like

It is surprisingly easy. You just take a read-only snapshot and send it over.

Here is how I merged in debian for example:

sudo mount /dev/sda2 /mnt
sudo mkdir /mnt/snapshots
sudo btrfs subvolume snapshot -r /mnt/@rootfs /mnt/snapshots/transfer-debian-root
sudo btrfs send /mnt/snapshots/transfer-debian-root | ssh dalto@192.168.1.100 "sudo btrfs receive /btrfs-root/snapshots"

If you have more than one subvolume to send over, just repeat the last two lines for each subvolume.

After that, I chroot into the subvolume from one of the other distros already installed and perform a few steps:

  • Take snapshot to convert the read-only snapshot to a read-write and get the name correct for the new system, like this:
    sudo btrfs subvolume snapshot /btrfs-root/snapshots/transfer-debian-root /btrfs-root/debian-root
    sudo btrfs subvolume delete /btrfs-root/snapshots/transfer-debian-root
    
  • mount and chroot into the subvolume(s)
  • Update /etc/fstab, the bootloader config and sometimes /etc/crypttab with correct UUID’s and subvol names
  • Rebuild the initrams
  • Update the bootloader

Notes:

  • On the receiving machine, I have the root of the btrfs partition mounted at /btrfs-root
  • In the VM the root of the btrfs partition lives on the device `/dev/sda2
  • The VM can be on the receiving machine or on another machine
  • The receiving machine needs to be on, and have ssh enabled
  • The user used in the btrfs receive command needs to have the ability to run sudo btrfs without being prompted for a password.
2 Likes

Brilliant! Thanks @dalto !

I will have to take it in all by bits and pieces and then see if I am able to make it. I have another thread open which is not totally unrelated to this one. I am eagerly following both.

1 Like