Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug#984650: update-initramfs fails when /etc/systemd/network/99-default.link is symlink to /dev/null

113 views
Skip to first unread message

Frederik Lindenaar

unread,
Mar 6, 2021, 9:10:02 AM3/6/21
to
Package: initramfs-tools
Version: 0.133+deb10u1
Severity: important

When one disables the "Predicatble Network InterfaceNames"
by making /lib/systemd/network/99-default.link a symlink to /dev/zero then
update-initramfs will fail as the copy of this symlink will fill-up all space
available in /var/tmp and makes it impossible to install any kernel image

the culprit is the following command executed by update-initramfs:

find /etc/systemd/network -name *.link -execdir cp -pt /var/tmp/ {} +

As it (and should) dereference de symlink, it reads zero bytes from /dev/null until the disk is full.

Changing the symlink to a zero byte file resolved the issue for me but as this
approach is one of the recommended approaches to disable predicatble network
interface names (see [1]) others may also bump into this.

[1] https://wiki.debian.org/NetworkInterfaceNames#How_to_get_it_back

-- Package-specific info:
-- initramfs sizes
-rw-r--r-- 1 root root 6.9M Mar 6 14:31 /boot/initrd.img-4.19.0-13-amd64
-rw-r--r-- 1 root root 6.9M Mar 6 14:32 /boot/initrd.img-4.19.0-14-amd64
-- /proc/cmdline
BOOT_IMAGE=/boot/vmlinuz-4.19.0-14-amd64 root=UUID=8d33b150-7c84-4dd0-8893-06eab0e7b9d7 ro quiet

-- resume
RESUME=UUID=2db37a4d-80dd-46b3-aa4d-ff57862589ba
-- /proc/filesystems
ext3
ext2
ext4

-- lsmod
Module Size Used by
vmw_vsock_vmci_transport 32768 1
vsock 40960 2 vmw_vsock_vmci_transport
ata_generic 16384 0
crct10dif_pclmul 16384 0
crc32_pclmul 16384 0
vmwgfx 331776 1
ttm 126976 1 vmwgfx
ghash_clmulni_intel 16384 0
vmw_balloon 20480 0
drm_kms_helper 208896 1 vmwgfx
intel_rapl_perf 16384 0
joydev 24576 0
pcspkr 16384 0
drm 495616 4 vmwgfx,drm_kms_helper,ttm
ahci 40960 0
vmxnet3 69632 0
ata_piix 36864 0
libahci 40960 1 ahci
sg 36864 0
libata 270336 4 ata_piix,libahci,ahci,ata_generic
vmw_vmci 81920 2 vmw_balloon,vmw_vsock_vmci_transport
i2c_piix4 24576 0
ac 16384 0
button 20480 0
ip_tables 28672 0
x_tables 45056 1 ip_tables
autofs4 49152 2
ext4 745472 1
crc16 16384 1 ext4
mbcache 16384 1 ext4
jbd2 122880 1 ext4
crc32c_generic 16384 0
fscrypto 32768 1 ext4
ecb 16384 0
crc32c_intel 24576 2
sd_mod 61440 3
aesni_intel 200704 0
psmouse 172032 0
aes_x86_64 20480 1 aesni_intel
crypto_simd 16384 1 aesni_intel
cryptd 28672 3 crypto_simd,ghash_clmulni_intel,aesni_intel
glue_helper 16384 1 aesni_intel
evdev 28672 2
serio_raw 16384 0
vmw_pvscsi 28672 2
scsi_mod 249856 4 vmw_pvscsi,sd_mod,libata,sg

-- /etc/initramfs-tools/modules

-- /etc/kernel-img.conf
# Kernel image management overrides
# See kernel-img.conf(5) for details
do_symlinks = yes
do_bootloader = no
do_initrd = yes
link_in_boot = no

-- /etc/initramfs-tools/initramfs.conf
MODULES=most
BUSYBOX=auto
KEYMAP=n
COMPRESS=gzip
DEVICE=
NFSROOT=auto
RUNSIZE=10%

-- /etc/initramfs-tools/update-initramfs.conf
update_initramfs=yes
backup_initramfs=no

-- /sys/block
sda

-- mkinitramfs hooks
/etc/initramfs-tools/hooks/:

/usr/share/initramfs-tools/hooks:
dmsetup
fsck
fuse
keymap
klibc-utils
kmod
resume
thermal
udev
zz-busybox


-- System Information:
Debian Release: 10.8
APT prefers stable-updates
APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 4.19.0-14-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=UTF-8 (charmap=UTF-8) (ignored: LC_ALL set to en_US.utf8), LANGUAGE=en_US:en (charmap=UTF-8) (ignored: LC_ALL set to en_US.utf8)
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages initramfs-tools depends on:
ii initramfs-tools-core 0.133+deb10u1
ii linux-base 4.6

initramfs-tools recommends no packages.

Versions of packages initramfs-tools suggests:
ii bash-completion 1:2.8-6

-- no debconf information

Cyril Brulebois

unread,
Mar 6, 2021, 10:40:07 AM3/6/21
to
Hello Frederik,

It seems there's some confusion around special character devices. Your
subject mentions /dev/null…

Frederik Lindenaar <deb...@frederik.lindenaar.nl> (2021-03-06):
> When one disables the "Predicatble Network InterfaceNames"
> by making /lib/systemd/network/99-default.link a symlink to /dev/zero then

… but this is about /dev/zero (not the same thing! — see `man 4 null`).

> update-initramfs will fail as the copy of this symlink will fill-up all space
> available in /var/tmp and makes it impossible to install any kernel image
>
> the culprit is the following command executed by update-initramfs:
>
> find /etc/systemd/network -name *.link -execdir cp -pt /var/tmp/ {} +
>
> As it (and should) dereference de symlink, it reads zero bytes from
> /dev/null until the disk is full.

… and here you write /dev/null but what you describe happens with
/dev/zero instead.

> Changing the symlink to a zero byte file resolved the issue for me but
> as this approach is one of the recommended approaches to disable
> predicatble network interface names (see [1]) others may also bump
> into this.
>
> [1] https://wiki.debian.org/NetworkInterfaceNames#How_to_get_it_back

This correctly describes a symlink to /dev/null, and not /dev/zero which
appears to be what you're trying to use.

Fix your symlink, and you should be good to go?


Cheers,
--
Cyril Brulebois (ki...@debian.org) <https://debamax.com/>
D-I release manager -- Release team member -- Freelance Consultant
signature.asc

Ben Hutchings

unread,
Mar 6, 2021, 10:50:02 AM3/6/21
to
Control: tag -1 moreinfo

On Sat, 2021-03-06 at 14:57 +0100, Frederik Lindenaar wrote:
> Package: initramfs-tools
> Version: 0.133+deb10u1
> Severity: important
>
> When one disables the "Predicatble Network InterfaceNames"
> by making /lib/systemd/network/99-default.link a symlink to /dev/zero then
> update-initramfs will fail as the copy of this symlink will fill-up all space
> available in /var/tmp and makes it impossible to install any kernel image
>
> the culprit is the following command executed by update-initramfs:
>
>         find /etc/systemd/network -name *.link -execdir cp -pt /var/tmp/ {} +
>
> As it (and should) dereference de symlink, it reads zero bytes from
> /dev/null until the disk is full.
[...]

It looks like you have mixed up /dev/null and /dev/zero (as a Dutch
learner, I can see how that would happen). /dev/null is always empty
and would be copied as an empty file. This is the correct target for
symlinks when you want to disable a systemd unit. /dev/zero is an
infinite stream of binary zeroes and would result in the behaviour you
saw.

Ben.


--
Ben Hutchings
Knowledge is power. France is bacon.
signature.asc

Debian Bug Tracking System

unread,
Mar 6, 2021, 11:10:03 AM3/6/21
to
Processing control commands:

> tag -1 moreinfo
Bug #984650 [initramfs-tools] update-initramfs fails when /etc/systemd/network/99-default.link is symlink to /dev/null
Added tag(s) moreinfo.

--
984650: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=984650
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems

Frederik Lindenaar

unread,
Mar 6, 2021, 11:30:03 AM3/6/21
to
Hi Ben,

Thanks for the quick reply. I am not sure how I could have mixed these two up but did a quick test with cp just now and the problem indeed looks like mixing up /dev/zero and /dev/null (I have no way to check that anymore though).

Nevertheless the result was very confusing (a full disk) so might still be good to check somehow

regards,

Frederik

Frederik Lindenaar

unread,
Mar 6, 2021, 11:30:03 AM3/6/21
to
Hi Cyril,

Thank you for the quick reply

As Ben also pointed out, I probably have indeed mixed up /dev/zero and /dev/null and had already fixed that by using an empty file. Nevertheless the result was pretty odd (the disk filling up rapidly) and very confusing so might still be useful to prevent this (if possible).

Why not use a cp -aLt <directory> {} instead to prevent this?

regards,

Frederik

Ben Hutchings

unread,
Mar 7, 2021, 2:40:03 PM3/7/21
to
Control: tag -1 - moreinfo
Control: retitle -1 update-initramfs fails if there is a symlink to /dev/zero in /etc/systemd/network
Control: reassign -1 udev
Control: severity -1 minor

Frederik Lindenaar <fred...@lindenaar.nl> wrote:
> Thanks for the quick reply. I am not sure how I could have mixed
> these two up but did a quick test with cp just now and the problem
> indeed looks like mixing up /dev/zero and /dev/null (I have no way to
> check that anymore though).
>
> Nevertheless the result was very confusing (a full disk) so might
> still be good to check somehow

So I'm updating the status. Also reassigning this to udev, as that is
the package that actually does the copying of /etc/systemd/network.

Ben.

--
Ben Hutchings
For every complex problem
there is a solution that is simple, neat, and wrong.
signature.asc

Debian Bug Tracking System

unread,
Mar 7, 2021, 3:00:03 PM3/7/21
to
Processing control commands:

> tag -1 - moreinfo
Bug #984650 [initramfs-tools] update-initramfs fails when /etc/systemd/network/99-default.link is symlink to /dev/null
Removed tag(s) moreinfo.
> retitle -1 update-initramfs fails if there is a symlink to /dev/zero in /etc/systemd/network
Bug #984650 [initramfs-tools] update-initramfs fails when /etc/systemd/network/99-default.link is symlink to /dev/null
Changed Bug title to 'update-initramfs fails if there is a symlink to /dev/zero in /etc/systemd/network' from 'update-initramfs fails when /etc/systemd/network/99-default.link is symlink to /dev/null'.
> reassign -1 udev
Bug #984650 [initramfs-tools] update-initramfs fails if there is a symlink to /dev/zero in /etc/systemd/network
Bug reassigned from package 'initramfs-tools' to 'udev'.
No longer marked as found in versions initramfs-tools/0.133+deb10u1.
Ignoring request to alter fixed versions of bug #984650 to the same values previously set
> severity -1 minor
Bug #984650 [udev] update-initramfs fails if there is a symlink to /dev/zero in /etc/systemd/network
Severity set to 'minor' from 'important'
0 new messages