[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

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



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

> On 6 Mar 2021, at 16:38, Ben Hutchings <ben@decadent.org.uk> wrote:
> 
> 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.


Reply to: