I know the purpose of "biosdevname"
feature in Linux, but I'm not sure how
exactly it works.
I tested it with Ubuntu 14.04 and Ubuntu 14.10 (both 64-bit server editions)
and it looks like they enable it by default - right after system startup my
network interface has a name such as p4p1
instead of eth0
, no customization
is needed. As I understood it, in order for biosdevname
to be enabled, BOTH
of these two conditions must be met:
- a boot option
biosdevname=1
must be passed to a kernel biosdevname
package must be installed
As I already mentioned, both Ubuntu 14.04 and 14.10 seem to offer biosdevname
as a default feature: they come with biosdevname
package already installed, I
didn't need to modify grub.cfg
either - GRUB_CMDLINE_LINUX_DEFAULT
has no
parameters and my network interface still has a BIOS name (p*p*
) instead of a
kernel name (eth*
.)
Later I wanted to restore the old style device naming and that's where the
interesting part begins. I decided to experiment a bit while trying to disable
the biosdevname
feature. Since it requires biosdevname
package to work (or
so I read here and there), I assumed removing it would be enough to disable the
feature, so I typed:
sudo apt-get purge biosdevname
To my surprise, after reboot my network interface was still p4p1,
so
biosdevname
clearly still worked even though biosdevname
package had been
wiped out.
As a next step, I applied appropriate changes to /etc/network/interfaces
in
order to restore the old name of my network interface (removed entry for p4p1
and added entry for eth0
). As a result, after another reboot, ifconfig
reported neither eth0
nor p4p1
which was another proof that OS still
understood BIOS names instead of kernel names.
It turned out that I also had to explicitly change GRUB entry to
GRUB_CMDLINE_LINUX_DEFAULT=biosdevname=0
and update GRUB to get the expected
result (biosdevname
disabled and old name of network interface restored).
My question is: how could biosdevname
work without biosdevname
package? Is
it not required after all? If so, what exactly provides the biosdevname
functionality and how does it work?