Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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!

share|improve this question

1 Answer 1

up vote 10 down vote accepted

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).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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