Posts by ct100

    I just finished testing and uploaded the new version of the install script that does skip the ionice setup when schedutil is the governor.

    I ran the new install script a few times and it looks good.


    After install:

    Code
    root@nanopi:~# cat /etc/default/cpufrequtils
    ENABLE="true"
    GOVERNOR="schedutil"
    MAX_SPEED="0"
    MIN_SPEED="0"

    even if you start with a bad armbian base file with "ondemand" still in it.


    The ionice/taskset part gets skipped automatically.


    Great idea with the logfile btw. Thank you!

    I did a test with OpenMediaVault 6.8.0.-1 and during the installation of the openmediavault package it correctly changes the governor to schedutil now for my ARM64 RK3588s system.


    After installation:

    Code
    root@nanopi:~# cat /etc/default/cpufrequtils
    ENABLE="true"
    GOVERNOR="schedutil"
    MAX_SPEED="0"
    MIN_SPEED="0"


    ryecoaaron Could you skip the ionice/taskset part of the installscript when schedutil governor is detected? Or at least add a parameter for the script to skip the part?


    It makes no sense to taskset the processes because schedutil moves them between small and big cores already.

    Any idea why Armbian is not setting the default to schedutil on this bigLittle board? I think the install script was actually doing something better by using the kernel's default governor when /etc/default/cpufrequtils doesn't exist.

    They might use the same base files for all images. I don't think this is intentional since schedutil is definitly correct for big.LITTLE.


    Maybe read out Kernel default governor on Armbian and skip cpufrequtils file. Also could get rid of taskset list for big.LITTLE with schedutil.

    Another way to investigate the problem could be to run omv-salt at the time the IPv6 network failed. The command will fix whatever is currently wrong, so its output might help determine what needs to be fixed.

    Might be this bug that was fixed in systemd-networkd last year:


    Systemd version on debian bullseye is quite old.

    I don't want to make it too complicated. So you suggest to default the governor to schedutil as suggested in my previous post? If users want a different one, they can use the environment variable to customize it.

    I don't think you can set all ARM to schedutil. What if they dont support it?


    If the InstallScript would save the setting from beeing overwritten during install that would be enough. And btw with schedutil governor the ionice/taskset part could be skipped.

    schedutil is recommended for heterogeneous CPU topologies like ARM big.LITTLE or Intel CPUs with different size cores because it supports energy aware scheduling. So it can correctly schedule tasks between small and big cores.


    Energy Aware Scheduling — The Linux Kernel documentation

    Intel P-State Driver Shifting To "Schedutil" Governor Default With Linux 5.7 - Phoronix


    I don’t know how to automatically detect a heterogeneous CPU in Linux. Some models have different max clock speeds for small and big cores. With “cat /proc/cpuinfo” the CPU variant & part parameter is different between CPU cores at least for ARM.


    RK3588s on Armbian example:


    I did some tests and the GOVERNOR change in my "/etc/default/cpufrequtils" file happens at line 282 of the InstallScript during this command:

    Code
    280  aptFlags="--yes --auto-remove --show-upgraded --allow-downgrades --allow-change-held-packages --no-install-recommends"
    281  cmd="apt-get ${aptFlags} install openmediavault"
    282  if ! ${cmd}; then


    List of packages that get installed by this command:

    votdev I just looked at your Github commits and they look correct now. I only noticed this:


    Set MACAddressPolicy if alternative MAC addresses are configured · openmediavault/openmediavault@f223ef5
    This is necessary otherwise these alternative MAC addresses are not applied. Fixes: https://github.com/openmediavault/openmediavault/issues/1564 Fixes:…
    github.com


    Is there a reason to put this new file into "/usr/lib/systemd/network" instead of "/etc/systemd/network"? I think in "/usr/lib/systemd" should only be files that the software distribution or package manager place there.


    systemd.network

    "All configuration files are collectively sorted and processed in alphanumeric order, regardless of the directories in which they live."

    I have a fresh armbian bullseye system with the following "/etc/default/cpufrequtils" file:

    Code
    ENABLE="true"
    MIN_SPEED="0"
    MAX_SPEED="0"
    GOVERNOR="schedutil"


    After using the OMVExtras InstallScript to install OpenMediaVault with OMVExtras the same file looks like this:

    Code
    ENABLE="true"
    GOVERNOR="ondemand"
    MAX_SPEED="0"
    MIN_SPEED="0"


    Also in "/etc/default/openmediavault" the cpufrequtils GOVERNOR was set to "ondemand" as default:

    Code
    OMV_CPUFREQUTILS_GOVERNOR="ondemand"


    In the source code of the InstallScript it seems the configuration gets copied with:

    Code
    cpuFreqDef="/etc/default/cpufrequtils"
    
    if [ -f "${cpuFreqDef}" ]; then
      . ${cpuFreqDef}

    But it still changes the GOVERNOR to "ondemand".


    I hope this can be fixed.

    votdev I tested the changes you made in Github:


    Issue #1589: Fix a problem in the netplan.io configuration for ethern… · openmediavault/openmediavault@efef860
    …et network interfaces with non-permanent MAC addresses Fixes: https://github.com/openmediavault/openmediavault/issues/1589 Signed-off-by: Volker Theile…
    github.com


    This works as expected. Match by mac address only for ethernet adapters with a permanent mac address.

    It fixes the race condition on my systems. Thank you!



    Fix issue in netplan.io configuration when an alternative MAC address… · openmediavault/openmediavault@9177b16
    … is set for an network interface Taken from https://netplan.readthedocs.io/en/stable/netplan-yaml/#properties-for-all-device-types: ``` This will not work…
    github.com


    This does not work and and even before this change it only worked if you changed systemd-networkd defaults.


    Why? Because you can only change the mac address if MACAddressPolicy is not persistent (check https://www.freedesktop.org/so…emd/man/systemd.link.html). But the systemd-networkd default is "MACAddressPolicy=persistent". If you try to set a new mac address with "MACAddressPolicy=persistent" it only leads to an error "Could not set MAC address, ignoring".


    Its possible to set the MACAddressPolicy individually for each network adapter in a systemd-networkd configuration but not with netplan. So for alternative mac address to work with netplan you would have to change the default for the whole system. For example by overwriting "/usr/lib/systemd/network/99-default.link" settings with a new setting in "/etc/systemd/network/99-default.link" where MACAddressPolicy=none.


    But this should only be done if an user wants to set his mac addresses manually since it breaks all stable mac addresses for adapters without permanent mac address.


    Also there is the problem that salt.grains.core.hwaddr_interfaces only returns the current mac address and not the real hardware mac address. So if you use an alternative mac address the next time you change the network configuration it writes the alternative mac address as match into the netplan file and that match will fail after a system restart vs the real hardware mac address.

    This seems to be the bug i reported upstream @ systemd: https://github.com/systemd/systemd/issues/27854.

    I don't think that's the same bug. Maybe another race condition bug but its different because this persistent mac, matching by mac race condition bug does not lead to systemd-networkd crashing or even showing any error. It just fails to match the .network file because the mac it matches against doesn't exist yet.


    I did some tests this morning to see what versions of systemd are affected by this persistent mac, matching by mac race condition bug:


    systemd/bullseye 247.3-7+deb11u4 arm64 (YES)

    systemd/bullseye-backports 252.5-2~bpo11+1 arm64 (NO)


    systemd/jammy 249.11-0ubuntu3.9 arm64 (NO)


    systemd/bookworm 252.12-1~deb12u1 arm64 (YES)


    I don't know why the bug reappears in 252.12.1 from debian bookworm. I think its best to not match by mac address for network adapters without stable mac address and not rely on systemd to fix this. They seem to have quite some race condition bugs in their code.


    Matching by name seems to always work even when the system starts extremely fast and udev is also renaming the ethernet adapters.

    There is no real need to set a static ip anymore. Just use local DNS / Avahi / WSD.


    I can reach my server with "servername", "servername.local" and "servername.fritz.box" (Fritzbox is a popular router in Germany). And that also works with IPv6.


    For DNS local cached DNS from your router is faster and its also possible to configure more secure DNS over TLS (DoT) for all devices in your network at once if your router supports that.

    I'm not sure this is accurate. You are probably using recent Windows versions. People are using old devices that still require the smb1 protocol and likely aren't signed.


    That's why i wrote "today". I tested with Windows 10, Debian Bullseye & Bookworm, Android Samsung Files SMB and some older Android file managers that support SMB-connections. All signed.


    People should not use SMB1 or NETBIOS anymore since its a huge security risk.

    Update to this thread with a lot more information:


    (german)

    [Guide] - Ultra Low Power SSD NAS | 1G 0,85W Idle | 2.5G 1,5W Idle
    Man nehme: - Single Board Computer mit Rockchip RK3588s SoC und M.2 Slot. Dieser SoC ist im 8nm Low Power Prozess gefertigt und hat 4 kleine und 4 große…
    www.hardwareluxx.de


    (english - google auto-translate)

    [Guide] - Ultra Low Power SSD NAS | 1G 0,85W Idle | 2.5G 1,5W Idle
    Man nehme: - Single Board Computer mit Rockchip RK3588s SoC und M.2 Slot. Dieser SoC ist im 8nm Low Power Prozess gefertigt und hat 4 kleine und 4 große…
    www-hardwareluxx-de.translate.goog

    Currently the OMVExtras InstallScript (https://github.com/OpenMediaVa…cript/blob/master/install) inserts


    Code
    smbOptions="min receivefile size = 16384\ngetwd cache = yes"


    into Samba SMB/CIFS Extra Options.


    It seems that both of these options are obsolete and have no effect.


    "getwd cache = yes" was made default in samba a long time ago: https://github.com/samba-team/…1adff6bdacd4d09db8c06c611


    "min receivefile size = 16384" only works for non-signed SMB connections but aren't practically all connections signed today? I checked the connection of all my SMB clients and every single one was using a signed connection.

    Currently OpenMediaVault matches the network configuration for every ethernet adapter by mac address in its netplan network configuration files.


    openmediavault/deb/openmediavault/srv/salt/omv/deploy/systemd-networkd/netplan/files/ethernet.j2 at master · openmediavault/openmediavault
    openmediavault is the next generation network attached storage (NAS) solution based on Debian Linux. It contains services like SSH, (S)FTP, SMB/CIFS, DAAP…
    github.com

    Lines 6-7

    Code
     match:
        macaddress: {{ mac_address }}


    That also happens for ethernet adapters without a permanent or completely random mac address.


    It relies on systemd-networkd default settings in "99-default.link" (https://github.com/systemd/sys…n/network/99-default.link).

    Code
    MACAddressPolicy=persistent

    This setting makes systemd-networkd create a stable mac address from the machine-id, interface name and additional interface parameters for adapters without a stable mac address during system startup in userspace.


    The problem with OMVs reliance on this is that (at least with the systemd 247.3-7 in current debian bullseye) this creates a race condition during system startup.


    If systemd-networkd is able to create the stable mac address for the adapter before it tries to match the network configuration file by that mac address everything is fine. But on fast systems this leads to a broken network configuration because the matching by mac address fails since the stable mac address has not been created yet.



    I have multiple RK3588 ARM systems where this is 100% reproducible.


    Random mac address for an adapter:

    Code
    kernel: r8125 0003:31:00.0 (unnamed net_device) (uninitialized): Invalid ether addr 00:00:00:00:00:00
    kernel: r8125 0003:31:00.0 (unnamed net_device) (uninitialized): Random ether addr 4e:54:94:b5:ad:c7


    Systemd-networkd creates a stable mac address during system startup:

    Code
                        HW Address: de:d1:aa:55:c9:bf
              HW Permanent Address: 4e:54:94:b5:ad:c7

    (HW Permanent Address is random at every start, but newly created HW Address is stable)


    OpenMediaVault creates a netplan configuration for this mac address and netplan auto creates a systemd-networkd .network file:


    Slow boot from microSD with ~60Mb/s speed:


    Fast boot from eMMC with ~300Mb/s:

    Network configuration is broken and the machine is offline when connected via that adapter.



    Currently im forced to delete lines 6-7 in "/srv/salt/omv/deploy/systemd-networkd/netplan/files/ethernet.j2" to remove matching by mac address and match by name only to have a working system.



    I think OpenMediaVault should not match by mac address for ethernet adapters without a permanent mac address.


    There is a kernel parameter "/sys/class/net/<iface>/addr_assign_type" (https://www.kernel.org/doc/Doc…I/testing/sysfs-class-net).


    By reading this parameter its possible to detect these adapters. For normal ethernet adapters with a fixed hw mac address or ethernet adapters of virtual machines this parameter is always 0 (permanent address). If systemd-networkd detects that the mac address of an adapter is not stable and creates a stable mac address it sets this parameter to 3.


    If OpenMediaVault would only match by mac address when this setting for the adapter is 0 and by interface name for >0 this bug would no longer happen.

    I'm not sure assuming there is more than one backup because you can have multiple scheduled is a good assumption. You can do that with the rsync plugin as well. Do people assume that is making more than one backup?

    Well you know every plugin in great detail. When i first looked at the backup part i assumed it would do more than one backup because of the daily/weekly/monthly settings. Until i looked into the Backup folder and realized it was one backup per container.


    I wonder how many users have daily, weekly and monthly backups activated at the same time even when it makes no sense to do weekly or monthly when you already have daily backups running.