Il 05/03/2025 11:59, Thomas Lange ha scritto:

I never tried such a configuration and I don't know if this can work.
Didn't think that having to keep some RAID volumes across reinstalls would be so problematic :) Should be quite a common scenario :)

Can you please check if the RAID is already assembled before
setup-storage starts? I'm not sure if setup-storage can handle an
already running raid, or if it wan't to detect the partitions and the
reassembles the RAID itself.
The RAID is not assembled, or at least when setup-storage aborts install there is no /proc/mdstat .

There's a kernel cmdline option for dracut, which boots the FAI
environment (option callled rd.auto=1) which can enable building the
RAIDs.
Currently not using it.

We're still doing some tests, but this config seems to work, at least if disks are wiped when booting with 'initial' flag:

-8<--
disk_config disk1 bootable:1 align-at:1M preserve_lazy:3,6,7
primary -       200M         -       -
primary swap    2G           swap    -
primary -       120M-128M    -       -
logical -       15G          -       -
logical -       500G         -       -
logical -       1G-          -       -

disk_config disk2 sameas:disk1
disk_config disk3 sameas:disk1

# preserve_lazy references md devices only, starting from md0 !
disk_config raid fstabkey:uuid preserve_lazy:1,3,4
raid1 /boot disk1.1,disk2.1,disk3.1 ext4 rw,noatime,errors=remount-ro mdcreateopts="--metadata=0.90" raid1 - disk1.3,disk2.3,disk3.3 ext4 noauto,noatime createopts="-L PERMDATA" raid5 / disk1.5,disk2.5,disk3.5 ext4 rw,noatime,errors=remount-ro raid1 /var/lib/mysql disk1.6,disk2.6,disk3.6 ext4 rw,noatime,nosuid,nodev raid5 /home disk1.7,disk2.7,disk3.7 ext4 rw,noatime,nosuid,nodev
-8<--

As noted in the comment, preserve_lazy references different objects (partitions in the first disk_config, md devices in the second). The worst thing is that it seems it's not allowed to specify preserve_lazy after the names of the md device components (diskX.Y...:preserve_lazy).

Some tests on a VM were OK, and preserved partitions did not get erased. I'm still not sure why I have to wipe the disks even when using flag_initial and why preserve_reinstall errors out when disks are wiped (IIUC if flag_initial=1 it shouldn't even try to read partitions info....).

--
Diego Zuccato
DIFA - Dip. di Fisica e Astronomia
Servizi Informatici
Alma Mater Studiorum - Università di Bologna
V.le Berti-Pichat 6/2 - 40127 Bologna - Italy
tel.: +39 051 20 95786

Antwort per Email an