Disc Mirroring : problem with eth0

vaibhavs

Joined
Oct 2, 2009
Messages
95
Likes
0
Points
0
#1
Hi,

I tried disc mirroring today using http://www.easeus.com/disk-copy/
All went well.

But when I tried to boot from the mirrored HDD, the eth0 values changed.
The system renamed my existing ifcfg-eth0 to ifcfg-eth0.bak & created a new ifcfg-eth0 with a random IP address (like a dhcp client). I don't have a DHCP server and nor do I intend having one.

Any ideas how I can prevent this ?

I would like the mirrored disc to work on the server just like the original one without any changes to the ifcfg-eth0.

Thx
Vai
 

dicko

Joined
Oct 24, 2008
Messages
4,099
Likes
0
Points
0
#2
Whilst you mirrored the harddrive, the other machine has a different network card with a different MAC address, eth0 is bound to the MAC address in that file, you could either remove the mac address from the file before cloning, but if you have more than one eth? then you run the risk of the enumeration not working on boot. (ifcfg-X is hardlinked to three locations under /etc/sysconfig be careful in your choice of editor as many will make a temp file and rename that on saving breaking the hardlinks)), or you could use the same nic in the cloned machine, or perhaps add an ifconfig line to /etc/rc3.d/S99local to reconfigure the network interface on boot, just don't have both clones on the network at the same time. As a technicality you should probably run uuidgen on the new machine once to prevent confusion on the network.
 

vaibhavs

Joined
Oct 2, 2009
Messages
95
Likes
0
Points
0
#3
Thx dicko.

The server does have 2 nics, but only one is connected and only one is used.

From stable operations perspective, is it safe to simply hash the line which contains the MAC address ?

Thx
Vai
 

dicko

Joined
Oct 24, 2008
Messages
4,099
Likes
0
Points
0
#4
Not "safe" nor "stable" if you have two nics, used or otherwise. Use the rc.local solution.
 

vaibhavs

Joined
Oct 2, 2009
Messages
95
Likes
0
Points
0
#5
What is the rc.local solution ?
 

dicko

Joined
Oct 24, 2008
Messages
4,099
Likes
0
Points
0
#6
My apologies /etc/rc3.d/S99local is a soft link to /etc/rc.local, just add a line to it to set your network with ifconfig
 

vaibhavs

Joined
Oct 2, 2009
Messages
95
Likes
0
Points
0
#7
dicko said:
/etc/rc.local, just add a line to it to set your network with ifconfig
Can you pls help me with to add in rc.local, I am a bit lost here...
Thx
 

dicko

Joined
Oct 24, 2008
Messages
4,099
Likes
0
Points
0
#8
:) :)

try man ifconfig from a shell

or google "ifconfig howto"

or for the real lazy

echo "ifconfig eth0 inet 192.168.1.1 broadcast 192.168.1.255 netmask 255.255.255.0 up" >> /etc/rc.local
 

vaibhavs

Joined
Oct 2, 2009
Messages
95
Likes
0
Points
0
#9
dicko said:
:) :)

try man ifconfig from a shell

or google "ifconfig howto"
Sorry to sound dumb, I know the ifconfig command, I am not sure of what I have to achieve using the ifconfig command in rc.local?

On second thoughts, arn't the interfaces configured before the rc.local's execution ?

Vai
 

dicko

Joined
Oct 24, 2008
Messages
4,099
Likes
0
Points
0
#10
I relented and posted a "real lazy solution" for you.

If you "know the ifconfig command" then you will know that it is for getting or setting an interface's parameters. rc.local is indeed run later than the network configuration (in runlevel 3 as it's softlink S99local), in this case it will be used in it's setting mode. Does that make sense?

'man ifconfig' explains it much better than I can, did you try that?

Google is a very useful web-based search engine that can often give more specific details, howto's are often used in computing as as alias for tutorial, you should try that too. :) :)
 

Members online

No members online now.

Latest posts

Forum statistics

Threads
30,915
Messages
130,920
Members
17,595
Latest member
feparra121
Top