Archive for the ‘Linux’ Category

Change network interfaces in linux with tg3 from eth0 to eth1

Tuesday, December 15th, 2009

Thought I would share this, because there are many of us the need to use specific interface to support specific network traffic. One of the difficulties you have probably encountered is the network device drivers. However, just think about what is going on and you will derive a solution.

Now, when the system boots there is a hardware discovery, coldplug and hotplug processes. After that initiation the drivers start to load. The problem is the order the drivers load and not the driver itself. So, the result is that you might want a PCI NIC card to become eth2 and the on-board to become eth0 and eth1.

I was working with Novell’s SLES 9 SP4 on an IBM x336. After the system booted, I would perform an “ifconfig” command and find the devices not in the order I required, with the PCI network interface always being eth0. I added “ifdown – nameif – ifup” commands to the network init script to no avail. It was like the rc script was not being read. The problem turned out to be with the tg3 (Tiggon) driver.

The solution I came up with was very simple and you might laugh after reading this post.

  1. I kept my “ifdown – nameif – ifup” scipts intact within the rcnetwok script. You will need to down the interfaces, rename them and bring them back up again.
  2. Within the /etc/sysconfig/hardware/<device file>, I set the STARTMODE to manual.
  3. At the start of the /etc/init.d/network script, just after the required start section, I added: /sbin/hwup /etc/sysconfig/hardware/<device file>

What this does it tell the system not to bring the device up. When the network init script runs, it brings the device up. This means there will be not “holds” on the device to your “ifdown – nameif – ifup” section of the network start script will run. You can do this for any device you do not want to come up until the network init script runs.

Hope that helps. Please patronize my sponsors who make this possible. Leave a comment to let everyone know how you solved this problem and if this solution worked for you.

Enjoy!

Linux: sles and how to remove a lun or disk from the system

Saturday, October 31st, 2009

Need to remove luns from a SLES device? Here is a basic procedure for performing that task. This example is based upon an Oracle instance, raw devices and multipath.

First you need to make sure nothing is holding onto the file system or device:

lsof <partition> #if we are looking at at raw device the command would be lsof /dev/raw/raw200.

The command should come back to a prompt. If it does not you will need to remove the process creating the file handle. If it is oracle 10g you will need to “kick” the devices out of ASM. Do not proceed unless you have a file system without any handles.

You want to comment out the raw device in /etc/raw. Make a note of the mapper lun identification, because you will need that for the next step.

In the /etc/multipath.conf file you will need to perform the following two steps:

  1. Comment out the device definition
    #\tmultipath {
    #                wwid                   1HITACHI_R450A8390B06
    #                alias                  raw19
    #                path_grouping_policy   multibus
    #                path_checker           readsector0
    #                path_selector          "round-robin 0"
    #                failback               60
    #}
  2. Add the wwid to the blacklist.
    wwid 1HITACHI_R450A8390730

Once that is completed you want to run the following commands:

  • /etc/init.d/multipath -F #This flushes the devices by re-reading the multipath.conf
  • /etc/init.d/multipath -v2 #This discovers any new devices

When you perform a “ls /dev/mapper/” you should no longer see the devices listed. If they are still listed you will need to rerun lsof against the device to see what still has a handle on the lun. At this point your “SAN guy or gal” should be able to pull the luns back into the array.
enjoy,

Mike Kniaziewicz, MIS