Disc Mirroring : problem with eth0

Discussion in 'General' started by vaibhavs, Oct 21, 2009.

  1. vaibhavs

    Joined:
    Oct 2, 2009
    Messages:
    95
    Likes Received:
    0
    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
     
  2. dicko

    Joined:
    Oct 24, 2008
    Messages:
    4,099
    Likes Received:
    0
    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.
     
  3. vaibhavs

    Joined:
    Oct 2, 2009
    Messages:
    95
    Likes Received:
    0
    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
     
  4. dicko

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

    Joined:
    Oct 2, 2009
    Messages:
    95
    Likes Received:
    0
    What is the rc.local solution ?
     
  6. dicko

    Joined:
    Oct 24, 2008
    Messages:
    4,099
    Likes Received:
    0
    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
     
  7. vaibhavs

    Joined:
    Oct 2, 2009
    Messages:
    95
    Likes Received:
    0
    Can you pls help me with to add in rc.local, I am a bit lost here...
    Thx
     
  8. dicko

    Joined:
    Oct 24, 2008
    Messages:
    4,099
    Likes Received:
    0
    :) :)

    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
     
  9. vaibhavs

    Joined:
    Oct 2, 2009
    Messages:
    95
    Likes Received:
    0
    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
     
  10. dicko

    Joined:
    Oct 24, 2008
    Messages:
    4,099
    Likes Received:
    0
    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. :) :)
     

Share This Page