3

My goal is to duplicate a Linux box (Debian) across two identical sets of hardware. I used the dd utility to clone the drive of Box A to the drive of Box B. When I pop the drive for Box B back into its machine, I boot the OS and the network isn't connected. ifconfig -a shows only an interface for eth3 and lo, not the eth0 I was expecting.

Could this be the Linux installation using hardware infomation from the Box A, which is wrong when cloned to Box B? (Like a MAC address?) What is the best method to fix it?

Thanks!

Whit
  • 133
  • 4

1 Answers1

10

There is a file: "/etc/udev/rules.d/70-persistent-net.rules" (might be called a bit differently on your system), which stores rules "about naming devices". So a device with MAC0 is given name eth0 (usually first device found), device with MAC1 is given eth1, etc.

line from file (device with mac 11:22:33:11:22:33 is named eth0):

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="11:22:33:11:22:33", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

Since you copied this file too, you have eth0 defined there already (and probably eth1 too), but it belongs to a device which isn't present in your new system. After rebooting the new system, it assigned a new name (eth3) to the new ethernet card. Since your eth3 is not configured in your network config (/etc/network/interfaces or simmilar), you dont have a working network connection.

You can edit that file (change the mac), or you can even move it (or delete it) and it will be regenerated on next reboot (with device names starting with eth0, and on).

mulaz
  • 10,682
  • 1
  • 31
  • 37