[lfs-support] Regeneration of udev net rules

Geoff Swan gswan3 at bigpond.net.au
Thu Jun 4 00:16:50 PDT 2015

On 2015-06-04 1:48 PM, Bruce Dubbs wrote:
> Geoff Swan wrote:
>> On 2015-06-03 6:53 AM, Paul Rogers wrote:
>>>> However, when I move this OS drive to another similar server, the
>>>> network devices fail to start because the definitions in the udev rule
>>>> file are stilll bound to the MAC addresses of the previous hardware.
>>>> The question is, is there a mechanism to allow the system to
>>>> regenerate
>>>> the rules file and bind the names to the new hardware devices
>>>> automatically?
>>>> Perhaps if the file was emptied before the OS drive being moved
>>>> then it
>>>> would be generated for the new hardware?
>>> Yep, that'll do it.  Just delete the file.  It'll make a new one,
>>> though
>>> the order it finds them on that first boot.  Note, however, if you need
>>> a particular NIC/plug to have a particular name, eth?, you can just
>>> edit
>>> the MAC address.
>> No, deleting the file just causes the interface initialisation to fail.
>> It did not rebuild the 70-persistent-net-rules file.
>> I am looking for a way to have this file generated or updated according
>> the the interfaces currently in the hardware that the OS drive is
>> plugged in to. It could be moved between several machines.
> What you need to do is (as root):
> rm /etc/udev/rules.d/70-persistent-net.rules
> bash /lib/udev/init-net-rules.sh
>   -- Bruce
Thanks Bruce.
I guess there is no automatic mechanism for when the box has not KB or
monitor attached, which was what I was hoping for.
Even if I remove the rules file before moving the OS drive, it does not
appear to rebuild the rules file automaticaaly when started on a
different box.
I guess I could exec the init-net-rules.sh script at startup if the
rules file is not present to have it build it automatically.

More information about the lfs-support mailing list