You are not logged in.

#1 2017-03-28 22:06:06

Satas
Member
Registered: 2015-09-02
Posts: 25

[SOLVED] Two parallel arch linux installations - systemd-boot ESP img

Hello, I have the following partitions:
sda1: boot (ESP) partition
sda2: arch linux 1
sda3: arch linux 2
sda4 data

I use systemd-boot to boot the systems on sda2 and sda3.

Both mount sda1 as /boot

Until now I have the following structure:
for the arch linux 1 the images are in the root of sda1:
/initramfs-linux.img and /vmlinuz-linux
for ths arch linux 2 I use a subdirectory:
/old/initramfs-linux.img and /old/vmlinuz-linux

The root directories point the the different partitions sda2 and sda3 for arch linux 1 and 2.

The question is: do I really need this different images to start both systems or can I use the same image and just redirect to different root places?
Is it the same way for lts and rt kernels?

I am not that experienced with such specific boot question so sorry in case the question is to simple wink

For completeness the two entries for systemd-boot:
arch linux 1:

title Arch_new
linux /vmlinuz-linux
initrd /initramfs-linux.img
options root=UUID=0b8060fc-fb1d-4ece-b480-97d0fecfcf6e rw clocksource=acpi_pm intel_pstate=disable i915.semaphores=1 intel_idle.max_cstate=1

arch linux 2:

title Arch_old
linux /old/vmlinuz-linux
initrd /old/initramfs-linux.img
options root=UUID=567064a6-f372-401e-8b15-b5654f2df3a0 rw clocksource=acpi_pm intel_pstate=disable i915.semaphores=1 intel_idle.max_cstate=1

and the sda1 structure:

.
├── EFI
│   ├── boot
│   │   └── BOOTX64.EFI
│   └── systemd
│       └── systemd-bootx64.efi
├── initramfs-linux-fallback.img
├── initramfs-linux.img
├── loader
│   ├── entries
│   │   ├── arch_new.conf
│   │   └── arch_old.conf
│   └── loader.conf
├── old
│   ├── initramfs-linux-fallback.img
│   ├── initramfs-linux.img
│   ├── initramfs-linux-lts-fallback.img
│   ├── initramfs-linux-lts.img
│   ├── initramfs-linux-rt-fallback.img
│   ├── initramfs-linux-rt.img
│   ├── intel-ucode.img
│   ├── syslinux
│   │   └── syslinux.cfg
│   ├── vmlinuz-linux
│   ├── vmlinuz-linux-lts
│   └── vmlinuz-linux-rt
└── vmlinuz-linux

Last edited by Satas (2017-03-29 21:31:46)

Offline

#2 2017-03-28 22:13:42

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,447
Website

Re: [SOLVED] Two parallel arch linux installations - systemd-boot ESP img

How do you maintain the linux package on the "old" system?  If you update the linux package in "old" it will overwrite the kernel and initramfs from the other system.

There are 2 reasonable ways to do this in my view, and it really depends on what your goals are: 1) manage the kernel from only one of the two installations (one of them will have the linux package installed, the other will not); 2) install *different* kernels (at least different names) on each system.  For number 2, you could build your own kernel with the PKGBUILD from ABS ans just change the name to vmlinux-linuz-other, or you could just use linux-lts or another ready made kernel with a different name (so files don't conflict).

So what is your goal with these two systems?  Do they need different kernels?  Would you want additional kernels (normal and lts, etc)?


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#3 2017-03-28 22:21:20

Satas
Member
Registered: 2015-09-02
Posts: 25

Re: [SOLVED] Two parallel arch linux installations - systemd-boot ESP img

Ok, well, basically, the idea is to use them completely parallel so the are allowed to have different kernels (version numbers). I could live with different versions (lts and not for example) however, maybe there is a way to use a subdirectory as I already have it and just mount sda1 to /boot for the first system and sda1/old to /boot for the second. Would that be possible at all?

In /etc/fstab I use UUID to mount the boot partition. Can I combine it with a subfolder?

Offline

#4 2017-03-28 22:37:48

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,447
Website

Re: [SOLVED] Two parallel arch linux installations - systemd-boot ESP img

Satas wrote:

... and sda1/old to /boot for the second. Would that be possible at all?

Not really.  You can't mount a directory, you can only mount partitions.

Strictly speaking, you could mount sda1 somewhere (e.g. /mnt) then either bind mount or symlink /mnt/old to /boot, but I suspect this could be fairly fragile and troublesome to debug if something did go wrong.  Using linux on one and linux-lts on the other would be *very* easy and much more robust.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#5 2017-03-28 22:54:15

Satas
Member
Registered: 2015-09-02
Posts: 25

Re: [SOLVED] Two parallel arch linux installations - systemd-boot ESP img

Ok, thank you. I will think which of the two options is better:
linux and linux-lts or update only one kernel.

Offline

Board footer

Powered by FluxBB