* [pve-devel] [PATCH docs] network: override device names: suggest running update-initramfs
@ 2024-05-21 12:55 Friedrich Weber
2024-05-21 14:01 ` [pve-devel] applied: " Thomas Lamprecht
0 siblings, 1 reply; 2+ messages in thread
From: Friedrich Weber @ 2024-05-21 12:55 UTC (permalink / raw)
To: pve-devel
The initramfs-tools hook /usr/share/initramfs-tools/hooks/udev copies
link files from /etc/systemd/network to the initramfs, where they take
effect in early userspace. If the link files in the initramfs diverge
from the link files in the rootfs, this can lead to confusing
behavior, as reported in enterprise support. For instance:
- If an interface matches link files both in the initramfs and the
rootfs, it will be renamed twice during boot.
- A leftover link file in the initramfs renaming an interface A to a
new name X may prevent a link file in the rootfs from renaming a
different interface B to the same name X (it will fail with "File
exists").
To avoid this confusion, mention the link files are copied to the
initramfs, and suggest updating the initramfs after making changes to
the link files.
Suggested-by: Hannes Laimer <h.laimer@proxmox.com>
Signed-off-by: Friedrich Weber <f.weber@proxmox.com>
---
pve-network.adoc | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/pve-network.adoc b/pve-network.adoc
index be8d63c..acdcf39 100644
--- a/pve-network.adoc
+++ b/pve-network.adoc
@@ -184,6 +184,13 @@ manpage] for more details.
Then, you can assign a name using the `Name` option in the `[Link]` section.
+Link files are copied to the `initramfs`, so it is recommended to refresh the
+`initramfs` after adding, modifying, or removing a link file:
+
+----
+# update-initramfs -u -k all
+----
+
For example, to assign the name `enwan0` to the Ethernet device with MAC
address `aa:bb:cc:dd:ee:ff`, create a file
`/etc/systemd/network/10-enwan0.link` with the following contents:
@@ -197,8 +204,9 @@ Type=ether
Name=enwan0
----
-Do not forget to adjust `/etc/network/interfaces` to use the new name.
-You need to reboot the node for the change to take effect.
+Do not forget to adjust `/etc/network/interfaces` to use the new name, and
+refresh your `initramfs` as described above. You need to reboot the node for
+the change to take effect.
NOTE: It is recommended to assign a name starting with `en` or `eth` so that
{pve} recognizes the interface as a physical network device which can then be
--
2.39.2
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
* [pve-devel] applied: [PATCH docs] network: override device names: suggest running update-initramfs
2024-05-21 12:55 [pve-devel] [PATCH docs] network: override device names: suggest running update-initramfs Friedrich Weber
@ 2024-05-21 14:01 ` Thomas Lamprecht
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Lamprecht @ 2024-05-21 14:01 UTC (permalink / raw)
To: Proxmox VE development discussion, Friedrich Weber
Am 21/05/2024 um 14:55 schrieb Friedrich Weber:
> The initramfs-tools hook /usr/share/initramfs-tools/hooks/udev copies
> link files from /etc/systemd/network to the initramfs, where they take
> effect in early userspace. If the link files in the initramfs diverge
> from the link files in the rootfs, this can lead to confusing
> behavior, as reported in enterprise support. For instance:
>
> - If an interface matches link files both in the initramfs and the
> rootfs, it will be renamed twice during boot.
> - A leftover link file in the initramfs renaming an interface A to a
> new name X may prevent a link file in the rootfs from renaming a
> different interface B to the same name X (it will fail with "File
> exists").
>
> To avoid this confusion, mention the link files are copied to the
> initramfs, and suggest updating the initramfs after making changes to
> the link files.
>
> Suggested-by: Hannes Laimer <h.laimer@proxmox.com>
> Signed-off-by: Friedrich Weber <f.weber@proxmox.com>
> ---
> pve-network.adoc | 12 ++++++++++--
> 1 file changed, 10 insertions(+), 2 deletions(-)
>
>
applied, thanks!
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-05-21 14:01 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-21 12:55 [pve-devel] [PATCH docs] network: override device names: suggest running update-initramfs Friedrich Weber
2024-05-21 14:01 ` [pve-devel] applied: " Thomas Lamprecht
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox