4

I am trying to rename one of my network interfaces from em1 to eth0. I do not have /etc/udev/rules.d/70-persistent-net.rules. I have tried to regenerate this file by running these commands:

udevadm trigger
udevadm trigger --action=add
udevadm trigger --action=change

I tested each command individually, rebooted, looked for the 70-persistent file, before trying the next. None of the commands work, as the file is still not there, even after reboot.

I have also tried manually running the /lib/udev/write_net_rules and I get this error:

Cannot lock /etc/udev/rules.d/70-persistent-net.rules!

This is what is in my /etc/network/interfaces file (nothing else):

auto lo
iface lo inet loopback

My ifconfig output results in no eth0 interface, but I have an em1 interface that I need to change to eth0. I don't know how to do this without re-creating the 70-persistent file. Any help in either recreating this file or changing em1 to eth0, or both, would be greatly appreciated!

1

EDIT: After a small troubleshooting session with OP I'm modifying the answer to remove the quotes for "biosdevname"

Edit the following lines in /etc/default/grub:

GRUB_CMDLINE_LINUX_DEFAULT=""
GRUB_CMDLINE_LINUX=""

To:

GRUB_CMDLINE_LINUX_DEFAULT=biosdevname=0
GRUB_CMDLINE_LINUX=biosdevname=0

Next, run sudo update-grub and then reboot.

After this, you should have the udev rules persisted in /etc/udev/rules.d/70-persistent-net.rules and you can edit them as necessary.

Make sure you're changing the right interface by comparing MAC address information properly, e.g. via ifconfig -a.

  • When I add that to grub and run sudo update-grub I get the error: biosdevname=0: not found. Am I missing a package or other file? – lchristina26 Aug 17 '15 at 16:53
  • Try sudo apt-get install biosdevname and then run sudo update-initramfs -u – John Jensen Aug 17 '15 at 16:55
  • That did not work, I still get the same error. In full it is : /usr/sbin/grub-mkconfig: 12: /etc/default/grub: biosdevname=0: not found – lchristina26 Aug 17 '15 at 18:30
  • And this is after you ran sudo apt-get install biosdevname and then sudo update-initramfs - u ? – John Jensen Aug 17 '15 at 19:20
  • Yes. Do I need to reboot after running sudo update-initramfs - u and then do ```sudo update-grub`` and reboot again? – lchristina26 Aug 17 '15 at 19:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.