Replacement motherboard, renumbered NICs and dvd drives?

NoOp glgxg at sbcglobal.net
Wed Feb 27 22:05:22 UTC 2008


On 02/27/2008 08:09 AM, Adam Funk wrote:
> On 2008-02-25, NoOp wrote:

>> You can safely edit and/or delete in
>> /etc/udev/rules.d/70-persistent-net.rules
> 
> Since udev automatically adds things to the 70-persistent-cd.rules and
> 70-persistent-net.rules files, could I just delete all the entries and
> let it automatically re-introduce the current devices with the
> "zeroth" names (eth0, cdrom, dvdrw, etc.)?
> 
> Would I need to restart udev or otherwise nudge it?
> 

No. If you delete all they do not get regenerated (at least in net.rules):

I just tested by renaming /etc/udev/rules.d/70-persistent-net.rules to
/etc/udev/rules.d/x-70-persistent-net.rules-x on a test machine and
rebooted. /etc/udev/rules.d/70-persistent-net.rules was not regenerated.

So then I kept the file and just deleted all of the entried & rebooted.
No entries are generated (expected).

I would just modify and then
sudo /etc/init.d/udev restart
sudo /etc/init.d/networking restart
or reboot.

For example:
====
# This file maintains persistent names for network interfaces.
# See udev(7) for syntax.
#
# Entries are automatically added by the 75-persistent-net-generator.rules
# file; however you are also free to add your own entries.

# PCI device 0x8086:0x1050 (e100)
SUBSYSTEM=="net", DRIVERS=="?*", ATTRS{address}=="00:0c:by:by:by:by",
NAME="eth0"

# USB device 0x1915:0x2233 (at76_usb)
SUBSYSTEM=="net", DRIVERS=="?*", ATTRS{address}=="00:0c:xy:xy:xy:xy",
ATTRS{type}=="1", NAME="wlan0"

# USB device 0x0b95:0x7720 (asix)
SUBSYSTEM=="net", DRIVERS=="?*", ATTRS{address}=="00:xz:xz:xz:xz:xz",
NAME="eth1"
====

It I want eth1 to be the nic with the mac address of 00:0c:by:by:by:by I
simply swap the NAME="eth0" to NAME="eth1" and swap the name for the xz.
If I want to take out the USB (xy), I can either comment out or delete.

Note that if you plug in a new device & restart networking (sudo
/etc/init.d/networking restart) the device will be added to the rule.
However once you remove it it does not automatically get deleted from
the rule. There may be a way to 'clean' the rule file, but I know of no
other way than by editing by hand.









More information about the ubuntu-users mailing list