Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts

Monday, August 31, 2015

How to test UDP port is responding

Using the following command will do the trick.

# nc -zuv 3 192.168.123.123 5140
Connection to 192.168.123.123 5140 port [udp/*] succeeded!

Monday, April 7, 2014

Broadcom BCM 57810 Ethernet Driver for Linux Kernel 2.6.34


  1. Get the driver from here, look for Linux version.Once downloaded, extract the file and look for the following file: netxtreme2-7.8.56.tar.gz. (Your version might be different). It seems like there is some activity between Broadcom and Qlogic and now the nextreme2 drivers are housed on Qlogic website. The link should be this, if it is not accessible, you have to search within Qlogic site (look for the Downloads page).
  2. Copy this file to the machine where BCM 57810 in installed. Once copy, extract this using tar xvfz netxtreme2-7.8.56.tar.gz
  3. Go into this extracted directory and execute make l2build. If you see the following error, you need to edit a file in step 4, else just jump to step 5.
  4. cc1: all warnings being treated as errors
    make[3]: *** [/home/ceph-2/Downloads/netxtreme2-7.8.56/bnx2x-1.78.58/src/bnx2x_main.o] Error 1
    make[2]: *** [_module_/home/ceph-2/Downloads/netxtreme2-7.8.56/bnx2x-1.78.58/src] Error 2
    make[2]: Leaving directory `/usr/src/linux-2.6.34.11'
    make[1]: *** [bnx2x.o] Error 2
    make[1]: Leaving directory `/home/ceph-2/Downloads/netxtreme2-7.8.56/bnx2x-1.78.58/src'
    make: *** [l2build] Error 2
    
  5. Open this file - netxtreme2-7.8.56/bnx2x-1.78.58/src/Makefile and search for Werror. Comment away this line as shown below and save the file.
  6. ifeq ($(DISABLE_WERROR),)
            #override EXTRA_CFLAGS += -Werror
    endif
    
  7. Execute sudo make l2build install. Installation is successful if there is no error reported.
  8. Execute sudo modprobe bnx2x. If no error reported, you should be able to see this module when executing lsmod. Execute ifconfig should also show new interface.

Friday, August 2, 2013

Format Faster on Linux Drive (ext4)

This is actually not really a problem for most of the users as they only format filesystem once and use it afterwards. But for users who need to do repeated testing on multiple drives, this could be really helpful as it can save you a lot of time.

One way to make format faster is to modify the bytes-per-inode value. By specifying higher value for this parameter, less inode will be created. As such, this is probably not suitable for all the situation but it is suitable if your filesystem only need to store virtual machine image which each file is big in size but the number of files in the filesystem is less.

bytes-per-inode Time Free inode
16384 (default) 1m29.712s 30490613
32768 48.809s 15245301
65536 23.675s 7622645
131072 14.793s 3811317

As you can see, the lesser inode need to be created, your format can be done faster. Command to do this:

mkfs -t ext4 -i 131072 /dev/sdb1

Another way is to use lazy_itable_init when formatting filesystem. This is actually the fastest way because inode table is not fully initialized when you do the formatting, instead, it is initialized when it is mounted. So this again might not be suitable if you are doing some IO test as you never know how this initialization process will affect your real IO performance. So the time taken is -- only 3.785s.

Command to do this

mkfs -t ext4 -E lazy_itable_init=1 /dev/sdb1

Notes:

time command was used to capture the elpased time
Disk size is 500GB

Tuesday, March 20, 2012

Useful Linux Command - mkdir -p

-p (parents) option for mkdir gives you the ability to create a multiple levels deep directory with all the intermediate directories created as well.

Example: When you want to create a directory tree like this /a/b/c/d, where a,b,c,d are all not exist before, you need to create each directory independently like

mkdir /a
mkdir /a/b
mkdir /a/b/c
mkdir /a/b/c/d

if you do mkdir /a/b/c/d, you will encounter "no such file or directory" error.

With -p option, you can create /a/b/c/d with just one single line of command as shown below:

mkdir -p /a/b/c/d

Wednesday, March 9, 2011

Ksym Dependancy - rpm

If you encounter some ksym (..) dependancy problem when installing kmod package, you might want to try the --nodeps switch.

rpm -ivh --nodeps kmod.something.rpm

Some quote from the HP website

"RPM uses KMP packaging dependency data to ensure the dependencies are met
before installing the binary RPM. Red Hat maintains a whitelist of kernel
symbols which RPM uses to validate against the KMP binaries. Some symbols may
be in the kernel but not on the whitelist which results in a failed binary RPM
install. The user will need to use the "--nodeps" switch when installing the
binary."