How to restore deleted NIC

I deleted a nic in the cli and I cannot figure out how to restore it. The card is still in the system and shows up using lspci | grep Ethernet.

Use the console (keyboard and display), reconfigure the NIC there, very easy!

It’s no longer listed in configure interfaces (option 1). This is also the same area that I deleted it from (dumb mistake…). I’ve tried Googling an answer and have not found anything about how to “restore” it after deletion.

Reboot

Tried that, still didn’t bring it back into the list. I did happen to catch the interface name pop up during shut down (didn’t get the whole line, but something to the effect of renaming eth0 to en**** (can’t remember the exact name)).

What does dmesg have to say after last boot? Any eth or en entries? Is this a system board nic? You don’t mention hardware.

Reinstall SCALE and restore from an exported config file?

1 Like

Hardware is an ASUS motherboard with an Intel i7. The interface I deleted was the onboard one (Intel® I225-V 2.5Gb Ethernet). This is the best I can filter out of dmesg (I’m not real good at this stuff, just a hobbyist).

[ 0.634507] pci 0000:07:00.0: [8086:15f3] type 00 class 0x020000
[ 0.634903] pci 0000:07:00.0: reg 0x10: [mem 0x8fc00000-0x8fcfffff]
[ 0.635211] pci 0000:07:00.0: reg 0x1c: [mem 0x8fd00000-0x8fd03fff]
[ 0.635710] pci 0000:07:00.0: PME# supported from D0 D3hot D3cold
[ 0.761463] pci 0000:07:00.0: Adding to iommu group 16
[ 1.287429] igc 0000:07:00.0: PTM enabled, 4ns granularity
[ 1.341295] igc 0000:07:00.0 (unnamed net_device) (uninitialized): PHC added
[ 1.368228] igc 0000:07:00.0: 4.000 Gb/s available PCIe bandwidth (5.0 GT/s PCIe x1 link)
[ 1.368779] igc 0000:07:00.0 eth0: MAC: 24:4b:fe:7d:e9:fe
[ 10.036556] igc 0000:07:00.0 enp7s0: renamed from eth0
[ 54.317712] igc 0000:07:00.0 enp7s0: PHC removed

Interesting.

1 Like

Would be nice to have an “undelete” option as well as the delete that they provide…

I’m not trying to be snarky, but these are your own words.


Just reinstall and restore from config. (Make sure not to touch your actual data/storage pool(s) during the installation setup.)


For future reference, don’t try to modify or tinker around in the command-line, other than to review information non-destructively. Trust me, if you limit yourself to the web UI, the chances of borking your system drop significantly.

1 Like

Not sure if cli was the correct word, maybe console (keyboard and monitor). Just did a reinstall. After reinstall the nic showed up. After restoring the config file, the nic disappeared again. Guessing when I deleted the nic it set something in the config file to delete it after boot?

revised dmesg after reinstall (not sure about it renaming eth0 twice?)

root@truenas[~]# dmesg | grep -i enp
[ 1.085052] igc 0000:07:00.0 enp7s0: renamed from eth0
[ 9.768668] e1000e 0000:05:00.0 enp5s0: renamed from eth0
[ 9.844764] ixgbe 0000:01:00.0 enp1s0f0: renamed from eth1
[ 9.866760] ixgbe 0000:01:00.1 enp1s0f1: renamed from eth2
[ 34.928034] ixgbe 0000:01:00.0: registered PHC device on enp1s0f0
[ 35.194238] ixgbe 0000:01:00.1: registered PHC device on enp1s0f1
[ 35.372649] ixgbe 0000:01:00.1 enp1s0f1: detected SFP+: 6
[ 37.409681] e1000e 0000:05:00.0 enp5s0: NIC Link is Up 1000 Mbps Full Duplex, Flow Control: Rx/Tx
[ 52.223249] igc 0000:07:00.0 enp7s0: PHC removed

Also started poking around a backup of the config file and found these two items:

Not sure how smart this was, but just this kinda worked until a reboot, then is removed the enp7s0 again:

  1. added the interface back into network_interfaces in the config file
  2. uploaded the config file and did the reboot (interface showed up in the web ui, but didn’t work at that point)
  3. tried using dhcp, still didn’t work
  4. found this link:

https://www.reddit.com/r/buildapc/comments/xypn1m/network_card_intel_ethernet_controller_i225v_igc/

used the reply from noisy_coil to delete and rescan

This seems like a temp fix until a reboot resets it.

Losing the network everytime the system reboots sounds like a royal pain in the arse to me.
If I was in this situation, I would at this point scrap the entire thing and redo the configuration from scratch.
As in, reinstall (don’t wipe your data drives), but don’t use the broken config-file. Manually setting up users, shares and apps the way it was.

Lesson learnt would be:
Always have a backup of the configuration file from before you potentially break everything. I get mine mailed regularly to me thanks to a fantastic little script but also make manual configuration file backups whenever I plan to do an update or some tinkering.