Download of the day: Netbsd 4.0 CD ISO Image

Posted on in Categories Download of the day last updated December 20, 2007

NetBSD 4.0 has been released. It is available for download now. . NetBSD is a free, secure, and highly portable Unix-like Open Source operating system available for many platforms, from 64-bit Opteron machines and desktop systems to handheld and embedded devices. Its clean design and advanced features make it excellent in both production and research environments, and it is user-supported with complete source. Many applications are easily available through pkgsrc, the NetBSD Packages Collection.

Major achievements in NetBSD 4.0 include support for version 3 of the Xen virtual machine monitor, Bluetooth, many new device drivers and embedded platforms based on ARM, PowerPC and MIPS CPUs. New network services include iSCSI target (server) code and an implementation of the Common Address Redundancy Protocol. Also, system security was further enhanced with restrictions of mprotect(2) to enforce W^X policies, the Kernel Authorization framework, and improvements of the Veriexec file integrity subsystem, which can be used to harden the system against trojan horses and virus attacks.

Download NetBSD ISO CD

=> Visit official site to grab NetBSD 4 ISO images [i386 – 242M]
=> Announcing NetBSD 4.0

Linux: Find Out How Many File Descriptors Are Being Used

Posted on in Categories File system, Linux, Sys admin, Tips, Troubleshooting last updated August 21, 2007

While administrating a box, you may wanted to find out what a processes is doing and find out how many file descriptors (fd) are being used. You will surprised to find out that process does open all sort of files:
=> Actual log file

=> /dev files

=> UNIX Sockets

=> Network sockets

=> Library files /lib /lib64

=> Executables and other programs etc

In this quick post, I will explain how to to count how many file descriptors are currently in use on your Linux server system.

Understanding Linux networking stack ~ from sockets to device drivers

Posted on in Categories Beyond nixCraft, Howto, Linux, Networking last updated August 13, 2007

Read from sockets to device drivers Linux networking stack:

One of the greatest features of the Linux operating system is its networking stack. It was initially a derivative of the BSD stack and is well organized with a clean set of interfaces. Its interfaces range from the protocol agnostics, such as the common sockets layer interface or the device layer, to the specific interfaces of the individual networking protocols. This article explores the structure of the Linux networking stack from the perspective of its layers and also examines some of its major structures.

Understanding Linux networking stack ~ from sockets to device drivers
Anatomy of the Linux networking stack

Installing VMWARE server on CentOS 5 or Red hat enterprise Linux 64 bit version

Posted on in Categories CentOS, Howto, Linux, RedHat/Fedora Linux, Tips, Troubleshooting last updated July 9, 2007

VMware virtualization software is an excllent choice for x86-compatible computers. They have both commercial and free version. I received few email regarding VMWARE on 64 bit Linux. Installing VMWARE server on CentOS 5 or Red hat enterprise Linux 64 bit version is a tricky business. In this small howto I will explain vmware installation on 64 bit Linux server without facing any dependencies problem.

Following instructions are tested on both RHEL 5 and CentOS 5 running 64 bit Intel / AMD hardware and software. My kernel:
$ uname -mrs
Output:

Linux 2.6.18-8.1.6.el5 x86_64

My RHEL 5 release (same kernel for CentOS):
$ cat /etc/redhat-release
Output:

Red Hat Enterprise Linux Server release 5 (Tikanga)

Make sure you have following software installed:

  • Full gcc compiler and development environment
  • Kernel headers and devel packages for current kernel (i.e. kernel-headers and kernel-devel)

Continue reading “Installing VMWARE server on CentOS 5 or Red hat enterprise Linux 64 bit version”

nixCraft FAQ Roundup June 19, 2007

Posted on in Categories FAQ last updated June 19, 2007

Recently updated/posted Linux and UNIX FAQ (mostly useful to Linux/UNIX new administrators or users) :

nixCraft FAQ Roundup May 29, 2007

Posted on in Categories FAQ last updated May 29, 2007

Recently updated/posted Linux and UNIX FAQ (mostly useful to Linux/UNIX new administrators or users) :

Enjoy!

March 6, 2007 : nixCraft FAQ Roundup

Posted on in Categories FAQ last updated March 6, 2007

Recently updated/posted Linux and UNIX FAQ:

Linux Setting processor affinity for a certain task or process

Posted on in Categories CentOS, Debian Linux, Linux, Linux distribution, RedHat/Fedora Linux, Suse Linux, Sys admin, Tips, Ubuntu Linux last updated May 7, 2006

When you are using SMP (Symmetric MultiProcessing) you might want to override the kernel’s process scheduling and bind a certain process to a specific CPU(s).

But what is CPU affinity?

CPU affinity is nothing but a scheduler property that “bonds” a process to a given set of CPUs on the SMP system. The Linux scheduler will honor the given CPU affinity and the process will not run on any other CPUs. Note that the Linux scheduler also supports natural CPU affinity:

The scheduler attempts to keep processes on the same CPU as long as practical for performance reasons. Therefore, forcing a specific CPU affinity is useful only in certain applications. For example, application such as Oracle (ERP apps) use # of cpus per instance licensed. You can bound Oracle to specific CPU to avoid license problem. This is a really useful on large server having 4 or 8 CPUS

Setting processor affinity for a certain task or process using taskset command

taskset is used to set or retrieve the CPU affinity of a running process given its PID or to launch a new COMMAND with a given CPU affinity. However taskset is not installed by default. You need to install schedutils (Linux scheduler utilities) package.

Install schedutils

Debian Linux:
# apt-get install schedutils
Red Hat Enterprise Linux:
# up2date schedutils
OR
# rpm -ivh schedutils*
Under latest version of Debian / Ubuntu Linux taskset is installed by default using util-linux package.

The CPU affinity is represented as a bitmask, with the lowest order bit corresponding to the first logical CPU and the highest order bit corresponding to the last logical CPU. For example:

  • 0x00000001 is processor #0 (1st processor)
  • 0x00000003 is processors #0 and #1
  • 0x00000004 is processors #2 (3rd processor)

To set the processor affinity of process 13545 to processor #0 (1st processor) type following command:
# taskset 0x00000001 -p 13545
If you find a bitmask hard to use, then you can specify a numerical list of processors instead of a bitmask using -c flag:
# taskset -c 1 -p 13545
# taskset -c 3,4 -p 13545

Where,

  • -p : Operate on an existing PID and not launch a new task (default is to launch a new task)

See also:

UPDATED for accuracy.

How do I find out if my Linux server CPU can run a 64 bit kernel version (apps) or not?

Posted on in Categories CentOS, Debian Linux, Gentoo Linux, Howto, Linux, Linux desktop, RedHat/Fedora Linux, Sys admin, Tips, Troubleshooting last updated April 7, 2006

It happens many times. Often new Linux system administrators and user(s) get confused. They are not able to determine if Linux system can run a 64 bit kernel version (and application) or not. There is simple way to find out:

(a) Ask your hardware vendor

(b) Find out yourself by reading manuals

(c) Or run the following commands:
Here is output from one of my production Dual Opteron server:
$ less /proc/cpuinfo
Output:

processor       : 0
vendor_id       : AuthenticAMD
cpu family      : 15
model           : 5
model name      : AMD Opteron (tm) Processor 848
stepping        : 10
cpu MHz         : 2197.161
cache size      : 1024 KB
fpu             : yes
fpu_exception   : yes
cpuid level     : 1
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall
nx mmxext lm 3dnowext 3dnow
bogomips        : 4308.99
TLB size        : 1088 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management: ts fid vid ttp

processor       : 1
vendor_id       : AuthenticAMD
cpu family      : 15
model           : 5
model name      : AMD Opteron (tm) Processor 848
....
...
*** Output truncated ***
....

Look for flag entry in above output. If you see lm flags then you will able to run 64 bit kernel and applications. Now consider output from my Workstation (32 bit system you will not able to find out lm [long mode] flag):

$ less /proc/cpuinfo

Output:

processor       : 0
vendor_id       : GenuineIntel
cpu family      : 15
model           : 1
model name      : Intel(R) Celeron(R) CPU 1.70GHz
stepping        : 3
cpu MHz         : 1717.118
cache size      : 128 KB
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 2
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm
bogomips        : 3437.80

You can also type command uname command to find out this info:

$ uname -a

Output:

Linux ora100 2.6.5-7.252-smp #1 SMP Tue Feb 14 11:11:04 UTC 2006 x86_64 x86_64 x86_64 GNU/Linux

The x86_64 confirms you can run 64 bit apps. You can also use live CD such as Knoppix to boot and find out this info.