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

Re: udev being an ass, SOLVED



On Wednesday 28 August 2019 16:55:20 Greg Wooledge wrote:

> On Wed, Aug 28, 2019 at 04:04:48PM -0400, Greg Wooledge wrote:
> > He apparently wants to make his operating system refuse to register
> > persistent interface names, on the grounds that he frequently moves
> > a physical hard drive from one system to another, and doesn't want
> > to go through the hassle of reassigning the interface names each
> > time.
> >
> > If you know a way to do that other than the ways I suggested, go
> > ahead and tell us.
>
> This came up by surprise in IRC for a totally unrelated issue, but it
> appears to be relevant to Gene's wish set:
>
> In squeeze, wheezy, and jessie, and *possibly* stretch, the persistent
> interface names that are stored in
> /etc/udev/rules.d/70-persistent-net.rules are created by
> /lib/udev/rules.d/75-persistent-net-generator.rules.
>
> If for some reason one wishes to AVOID having udev's persistent
> interface names in these older Debian releases (and is not using the
> "predictable" net.ifnames thing in stretch), one may follow these
> steps:
>
>   touch /etc/udev/rules.d/75-persistent-net-generator.rules
>   rm /etc/udev/rules.d/70-persistent-net.rules
>
> Apparently, creating an *empty* file named
> /etc/udev/rules.d/75-persistent-net-generator.rules overrides the
> instructions in /lib/udev/rules.d/75-persistent-net-generator.rules
> and causes the generator not to run, when it would normally run.
>
That is not exactly whats been done. That /e/d/r/70-p*-net.rules file has 
only been deleted once. After a reboot, using the net.ifnames=0 kernel 
option, its re-created and reads like this:

root@GO704:~# cat /etc/udev/rules.d/70-persistent-net.rules
# This file was automatically generated by the /lib/udev/write_net_rules
# program, run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single
# line, and change only the value of the NAME= key.

# PCI device 0x14e4:/sys/devices/pci0000:00/0000:00:1c.0/0000:02:00.0 
(tg3)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", 
ATTR{address}=="00:13:72:72:66:3c", ATTR{dev_id}=="0x0", 
ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

EOF

eth0, which I fixed in /e/n/i.  And its since been rebooted quite a few 
times with no further change.  And That Is What I Wanted.  And I expect 
I could move that drive back to its original box with no further drama.

I have more interface cards ordered, but its come to my attention that 
powering the cards from separate psu's of their own, is also preventing 
them from being given a powerdown reset by power cycleing the computer. 
I can and will jumper them  to the computer 5 volts tomorrow, and that 
may well fix it.  If not, replacement cards, to be flashed to the proper 
firmware by me, are one day closer by priority mail.

> This prevents the recreation of
> /etc/udev/rules.d/70-persistent-net.rules which means your interfaces
> will not be saved across reboots.  You'll go through the fun steps of
> having the system pull interfaces out of a hat and name them, every
> single time.  Which seems to be what Gene wants.

Not what I am getting, see above.

> I have not tested this.  I am not going to.  If it doesn't work, too
> bad.


Cheers, Gene Heskett
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
If we desire respect for the law, we must first make the law respectable.
 - Louis D. Brandeis
Genes Web page <http://geneslinuxbox.net:6309/gene>


Reply to: