≡ Menu

kernel

Linux Find Out Virtual Memory PAGESIZE

Q. How do I check the size of PAGESIZE under Linux?

A. Most modern operating systems have their main memory divided into pages. It allows better utilization of memory. A page is a fixed length block of main memory, that is contiguous in both physical memory addressing and virtual memory addressing. Kernel swap and allocates memory using pages
[click to continue…]

Truss like command under Linux to monitor and diagnostic the system calls

Q. Solaris and FreeBSD both provide the truss command to monitor and debug system calls. I’m unable to find this command or package. How can I install truss under Linux?

A. truss is a debugging utility in Solaris and FreeBSD to monitor the system calls used. It is used to trace call and useful debugging many problems. Linux provides strace command. This command is installed by default. strace is a useful diagnostic, instructional, and debugging tool. System administrators, diagnosticians and troubleshooters will find it invaluable for solving problems with programs for which the source is not readily available since they do not need to be recompiled in order to trace them.
[click to continue…]

How Do I Find Out Linux System Memory Utilization?

How do I find out System / Server Memory Utilization under RHEL / CentOS / any other Linux distribution?
[click to continue…]

Linux nice command: Run Process With Modified Scheduling Priority ( nicenesses )

Q. How do I run a process with modified scheduling priority under Linux? I’d like to change the priority in the kernel’s scheduler while starting a command.

A. Use nice command to run a program with modified scheduling priority / nicenesses. Nicenesses range at least from -20 (resulting in the most favorable scheduling) through 19 (the least favorable). The default behavior is to increase the niceness by 10.

A niceness should not be confused with a scheduling priority, which lets applications determine the order in which threads are scheduled to run. Unlike a priority, a niceness is merely advice to the scheduler, which the scheduler is free to ignore.

nice syntax (/bin/nice command)

/bin/nice -n NUM

Add integer NUM (-20 to 19) to the niceness.

WARNING! There are multiple versions of the nice command. One built in to the shell, and one in /bin/nice. The syntax may be diffrent on your system. Refer your shell and /bin/nice command man page for details.

Change niceness by 3

Type the command as follows:
$ /bin/nice -n 3 command-name

Only a privileged user may run a process with lower niceness:
$ /bin/nice -n -1 command-name

Shell in build nice command syntax

If you use the csh or tcsh or bash, the syntax is as follows:
nice +n command
I recommend using /bin/nice syntax to avoid confusion and to save time.

Buffer I/O error on device fd0, logical block 0 error and simply soultion

Q. I’ve CentOS 5 server running on Dell hardware. I’m getting following error message in my /var/log/message file (some time message is also shown on console):

Jul 05 12:04:05 dell01 kernel: end_request: I/O error, dev fd0, sector 0
Jul 05 12:04:05 dell01 kernel: Buffer I/O error on device fd0, logical block 0
Jul 05 12:04:18 dell01 kernel: end_request: I/O error, dev fd0, sector 0
Jul 05 12:04:18 dell01 kernel: Buffer I/O error on device fd0, logical block 0
Jul 05 12:04:30 dell01 kernel: end_request: I/O error, dev fd0, sector 0
Jul 05 12:04:42 dell01 kernel: end_request: I/O error, dev fd0, sector 0

What do they mean? How do I fix this problem?

A. This message appears when you don’t have a floppy drive attached to Linux server. Solution is quite simple just disable driver for floppy and reboot the system. You can verify this with the following command (this solution works with RHEL, CentOS, Redhat, Ubuntu/Debian and other Linux distros) :
# lsmod | grep -i floppy
Output:

floppy                 95465  0

Open file called /etc/modprobe.d/blacklist:
# vi /etc/modprobe.d/blacklist
Listing a module (driver name) in this file prevents the hotplug scripts from loading it. Usually that’d be so that some other driver will bind it instead,
no matter which driver happens to get probed first. Sometimes user mode tools can also control driver binding. Append following line:
blacklist floppy
Save and close the file. Now reboot the Linux server:
# reboot

Linux Rescan HP Smart Array For New Disks

How do I rescan an HP Smart Array for new disks without rebooting in CentOS or Debian or RHEL server?
[click to continue…]

FreeBSD find out RAM size Including Total Amount of Free and Used Memory Size

How do I find out RAM size or memory size installed in my FreeBSD server? How do I display amount of free and used memory in the system powered by FreeBSD? How do I find out how much RAM is installed on a FreeBSD 10 or 11 server?
[click to continue…]

Mount NFS File System Over a Slow and Busy Network

Traffic between my home and office data center encrypted using VPN but sometime my ISP get little slow or network becomes busy. I’m using Fedora Core Linux desktop system and my system freezes for a few minutes. What optimization options should be used when mounting an exported NFS share over a slow and busy network?
[click to continue…]

Linux ntpd sendto() Bad file descriptor error and solution

Q. I’m using Red hat Enterprise Linux server. I’m getting following error in /var/log/message file:

Apr 16 16:38:02 server ntpd[22694]: sendto(10.0.77.54): Bad file descriptor
Apr 16 16:38:08 server ntpd[22694]: sendto(66.111.46.200): Bad file descriptor
Apr 16 16:38:25 server ntpd[22694]: sendto(83.133.111.7): Bad file descriptor
Apr 16 16:38:28 server ntpd[22694]: sendto(81.169.156.100): Bad file descriptor

How do I fix above errors?

A. If you are seeing Bad file descriptor errors in /var/log/messages, make sure that only one instance of ntpd is running.

Step #1: Stop ntpd

Type the following command to stop ntpd:
# /etc/init.d/ntpd stop

Step #2: kill ntpd

Type the following command to kill all instance of ntpd:
# killall ntpd

Step #3: Start ntpd

# /etc/init.d/ntpd start

Step #4: Watch log file /var/log/messages

Use tail command:
# tail -f /var/log/messages
Output:

Apr 16 16:44:35 server ntpd[17549]: Listening on interface lo, 127.0.0.1#123
Apr 16 16:44:35 server ntpd[17549]: Listening on interface eth0, 10.5.123.2#123
Apr 16 16:44:35 server ntpd[17549]: Listening on interface eth1, 71.26.1.25#123
Apr 16 16:44:35 server ntpd[17549]: kernel time sync status 0040
Apr 16 16:44:36 server ntpd[17549]: frequency initialized -58.648 PPM from /var/lib/ntp/drift
Apr 16 16:47:52 server ntpd[17549]: synchronized to LOCAL(0), stratum 10
Apr 16 16:47:52 server ntpd[17549]: kernel time sync disabled 0041
Apr 16 16:47:52 server ntpd[17549]: synchronized to 71.26.2.221, stratum 1
Apr 16 16:50:00 server ntpd[17549]: synchronized to 10.0.77.54, stratum 

Linux command to remove virtual interfaces or network aliases

Q. How do I remove virtual interfaces such as eth0:1 or eth1:1?
[click to continue…]