This Blog is to share our knowledge and expertise on Linux System Administration and VMware Administration

Tuesday, October 31, 2017

Different types of Kernel packages in Red Hat Enterprise Linux?

Tuesday, October 31, 2017

Red Hat Enterprise Linux contains the following kernel packages (some may not apply to your architecture, and not all are available in all major releases):

    Kernel - contains the Kernel and following key features:
        Uniprocessor support (will utilize a single processor on multi-processor systems) (RHEL3,4,5)
        Multi-processor support for Intel EM64T systems (RHEL 3 only)
        4GB RAM support on Intel and AMD x86 systems (1)
    Kernel-BOOT contains the installation Kernel (x86 only)  Uniprocessor support
    Kernel-{*-}devel (RHEL 4 and ongoing) - contains kernel header files replaces Kernel-source
    Kernel-debug - contains the same kernel as kernel but with debugging options enabled (RHEL 5 only)
    Kernel-doc - contains kernel documentation previously found in /usr/src/linux{-*}/Documentation
    Kernel-hugemem (i686 only) - in addition to the options of kernel-smp :
        4GB/4GB split - ~4GB of virtual address space for kernel resources and ~4GB for each user processor  Should be utilized on systems/loads where more addressable kernel resources are required including greater than 16GB systems isn't shipped in RHEL5 and above.

    Kernel-kdump (RHEL 6 only; POWER and s390x architectures only) - secondary Kernel for Kernel crash dump capture;
    Kernel-largesmp (RHEL 4 only; 64-bit architectures only) - similar to kernel-smp, but with support for higher numbers of CPU on x86_64, Itanium2 and POWER;
    Kernel-PAE (RHEL 5 only; x86 only) - kernel with support for up to 16 Gb of RAM;
    Kernel-rt-* (Red Hat Enterprise MRG Realtime) - realtime kernels, discussed in the section of the MRG Realtime Installation Guide.
    Kernel-smp - in addition to the options of kernel (not shipped with RHEL6 and above:
        multi-processor support (all architectures)
    Kernel-PAE - Physical Address Extension (Intel x86 only) upto 16GB RAM (2)
    Kernel-pcmcia-cs (RHEL 3 only) - contains support for PCMCIA cards
    Kernel-source (RHEL 3 only) - contains complete source code for the Linux Kernel
    Kernel-utils - contains utilities that can be used to control the kernel or system hardware
    Kernel-xenU - kernel used by paravirtualised guests (RHEL 4.5+)

    Kernel-xen - kernel which runs in Xen VM (RHEL 5 only)
    * for X86 only
    * supports up to 16 Gb of RAM in all installs if the processor allows it.
    * supports a maximum of 16 CPUs
        for AMD64 and Intel 64
            supports up to 1TB of RAM
            on RHEL5.0 and 5.1, supports up to 32 CPUs
            on RHEL5.2 supports up to 64 CPUs
            on RHEL5.3 supports up to 126 CPUs
            on RHEL5.4 and 5.5 supports up to 192 CPUs
        for Intel Itanium
            supports up to 32 CPUs
            
    Kernel-{*-}unsupported (RHEL 3 only/some architectures) - contains modules not supported by Red Hat, Inc. in any SLA  is not installed during installation updates and fixes may not be provided over time

(1) Refer to the Red Hat Enterprise Linux product pages, in particular for other configuration limits.

(2) Kernel-hugemem is required if system memory is greater than 16GB on x86 machines. x86_64 and AMD64 architectures support 64GB and EM64T supports 6GB.

Thursday, October 26, 2017

How to Covert the Time Zone in Linux Server?

Thursday, October 26, 2017 0
Below steps are used to Covert the GMT time zone UTC time zone.

1. Check the current Time zone.

[root@testserver ~]# date
Tue Feb  7 07:51:59 GMT+6 2017

2. List the available Time zone (Check the UTC is abavilable or not)

[root@testserver ~]# ls /usr/share/zoneinfo/Etc/

Linvirtshell.com

3. Copy the UTC Time Zone file to /etc/localtime & run the date command to verify.

[root@testserver ~]# cp /usr/share/zoneinfo/Etc/UTC /etc/localtime
cp: overwrite `/etc/localtime'? y
[root@testserver ~]#
[root@testserver ~]# date -u
Tue Feb  7 13:52:32 UTC 2017
[root@testserver ~]# date
Tue Feb  7 13:52:33 UTC 2017


Some special case (RHEL 6.9), need to update the /etc/sysconfig/clock file as well.

[root@testserver ~]#cat  /etc/sysconfig/clock
ZONE="Asia/Kuala_Lumpur"

Hope it helps

Wednesday, October 25, 2017

How to get the huge files size & name with single command in Linux Server?

Wednesday, October 25, 2017 0

Use the below command to get the huge file size and name.

root@testserver:~# /usr/bin/find / -xdev -type f -size +1024 -ls | awk '{print $7,"",$11}' |sort -m | awk '{print $1/1024/1024,"","MB","",$2}' |sort -rn -k 1

45.284  MB  /var/cache/apt/pkgcache.bin
45.264  MB  /var/cache/apt/srcpkgcache.bin
39.8765  MB  /var/lib/apt/lists/in.archive.ubuntu.com_ubuntu_dists_xenial_universe_binary-amd64_Packages
39.7197  MB  /var/lib/apt/lists/in.archive.ubuntu.com_ubuntu_dists_xenial_universe_binary-i386_Packages
26.518  MB  /var/cache/apt/archives/libpython2.7-dev_2.7.12-1ubuntu0~16.04.1_amd64.deb
24.7127  MB  /usr/lib/x86_64-linux-gnu/libicudata.so.55.1
22.3409  MB  /var/lib/apt/lists/in.archive.ubuntu.com_ubuntu_dists_xenial_universe_i18n_Translation-en
21.4124  MB  /usr/lib/gcc/x86_64-linux-gnu/5/cc1plus
19.9162  MB  /usr/lib/gcc/x86_64-linux-gnu/5/cc1
19.4404  MB  /usr/lib/python2.7/config-x86_64-linux-gnu/libpython2.7.a
19.1068  MB  /usr/lib/gcc/x86_64-linux-gnu/5/lto1
18.8433  MB  /usr/lib/python2.7/config-x86_64-linux-gnu/libpython2.7-pic.a
18.7048  MB  /usr/lib/snapd/snapd
14.6835  MB  /usr/bin/snap

....
...
..
.
Hope it helps.

Tuesday, October 24, 2017

How to solve the Error "sendmail dead but subsys locked" sm-client (pid 28752) is running?

Tuesday, October 24, 2017 0
 Error "sendmail dead but subsys locked" sm-client (pid  28752) is running - This is because of 2 MTA (Mail Transfer Agent) were sunning same time. Something is trying to start the postfix service also cause this issue.

[root@testserver ~]# /etc/init.d/sendmail status
sendmail dead but subsys locked
sm-client (pid  28752) is running...
First check postfix is running on the server

[root@testserver ~]# /etc/init.d/postfix status
-b (pid  1765) is running...
[root@testserver ~]#


Try to stop the service if not able to bring down the service & kill the process. Then restart the sendmail service.

[root@testserver ~]# /etc/init.d/postfix stop
Shutting down postfix:                                     [FAILED]
[root@testserver ~]#

[root@testserver ~]# ps -ef | grep -i postfix
root      1765     1  0 Jun09 ?        00:02:06 /usr/libexec/postfix/master
postfix   1772  1765  0 Jun09 ?        00:00:03 qmgr -l -t fifo -u
root     25822 24576  0 16:56 pts/7    00:00:00 grep -i postfix

[root@testserver ]# kill -9 1765
[root@testserver ]#

[root@testserver ]# /etc/init.d/sendmail restart
Shutting down sm-client:                                   [  OK  ]
Shutting down sendmail:                                    [  OK  ]
Starting sendmail:                                         [  OK  ]
Starting sm-client:                                        [  OK  ]
[root@testserver ]#

[root@testserver ]# /etc/init.d/sendmail status
sendmail (pid  28421) is running...
sm-client (pid  28429) is running...

Hope it helps

Monday, October 23, 2017

Multipath Queries & Multipath Command Options in Linux Server

Monday, October 23, 2017 0
You can use the -l and -ll options of the multipath command to display the current multipath configuration.

The -l option displays multipath topology gathered from information in sysfs and the device mapper.

The -ll option displays the information the -l displays in addition to all other available components of the system.

When displaying the multipath configuration, there are three verbosity levels you can specify with the -v option of the multipath command. Specifying -v0 yields no output. Specifying -v1 outputs the created or updated multipath names only, which you can then feed to other tools such as kpartx. Specifying -v2 prints all detected paths, multipaths, and device maps.

The following example shows the output of a multipath -l command.

# multipath -l

3600d0230000000000e13955cc3757800 dm-1 WINSYS,SF2372
size=269G features='0' hwhandler='0' wp=rw
|-+- policy='round-robin 0' prio=1 status=active
| `- 6:0:0:0 sdb 8:16  active ready  running
`-+- policy='round-robin 0' prio=1 status=enabled
  `- 7:0:0:0 sdf 8:80  active ready  running

The following example shows the output of a multipath -ll command.

# multipath -ll

3600d0230000000000e13955cc3757801 dm-10 WINSYS,SF2372
size=269G features='0' hwhandler='0' wp=rw
|-+- policy='round-robin 0' prio=1 status=enabled
| `- 19:0:0:1 sdc 8:32  active ready  running
`-+- policy='round-robin 0' prio=1 status=enabled
  `- 18:0:0:1 sdh 8:112 active ready  running
3600d0230000000000e13955cc3757803 dm-2 WINSYS,SF2372
size=125G features='0' hwhandler='0' wp=rw
`-+- policy='round-robin 0' prio=1 status=active
  |- 19:0:0:3 sde 8:64  active ready  running
  `- 18:0:0:3 sdj 8:144 active ready  running

Useful multipath Command Options

Option                Description
-l                    Display the current multipath configuration gathered from sysfs and the   device mapper.
-ll                   Display the current multipath configuration gathered from sysfs, the device mapper, and all other available components on the system.
-f device         Remove the named multipath device.
-F                   Remove all unused multipath devices.
-w device        Red Hat Enterprise Linux 6.6 and later) Remove the wwid of the specified device from the wwids file.
-W                  Red Hat Enterprise Linux 6.6 and later) Reset the wwids file to include only the current multipath devices.

Saturday, October 21, 2017

How to limit yum so that it lists or installs only Security Updates in Linux Server?

Saturday, October 21, 2017
Install the yum-security plugin

It is now possible to limit yum to install only security updates  using Red Hat Enterprise Linux 5,6, and 7. To do so, simply install the yum-security plugin:

For Red Hat Enterprise Linux 7

The plugin is already a part of yum itself, no need to install anything.

For Red Hat Enterprise Linux 6

# yum install yum-plugin-security

For Red Hat Enterprise Linux 5

# yum install yum-security

Alternatively, download the yum-security package from the Red Hat Network (RHN) and manually install it on the system.

For Red Hat Enterprise Linux 6 and 7

Using yum-security plugin

To list all available erratas without installing them, run:

# yum updateinfo list available

To list all available security updates without installing them, run:

# yum updateinfo list security all
# yum updateinfo list sec


To get a list of the currently installed security updates this command can be used:

# yum updateinfo list security installed

For Red Hat Enterprise Linux 5

Using yum-security plugin

To list all available erratas without installing them, run:

# yum list-sec

To list all available security updates without installing them, run:

# yum list-security --security

For both Red Hat Enterprise Linux 5, 6, and 7

To list all available security updates with verbose descriptions of the issues they apply to:

# yum info-sec

Run the following command to download and apply all available security updates from Red Hat Network hosted or Red Hat  Network Satellite:

# yum -y update --security

NOTE: It will install the last version available of any package with at least one security errata thus can install non-security erratas if they provide a more updated version of the package.

To only install the packages that have a security errata use
# yum update-minimal --security -y

yum-security also allows installing security updates based on the CVE reference of the issue. To install a security update  using a CVE reference run:

# yum update --cve <CVE>

e.g.

# yum update --cve CVE-2008-0947


Viewing available advisories by severities:

# yum updateinfo list

This system is receiving updates from RHN Classic or RHN Satellite.
RHSA-2014:0159 Important/Sec. kernel-headers-2.6.32-431.5.1.el6.x86_64
RHSA-2014:0164 Moderate/Sec.  mysql-5.1.73-3.el6_5.x86_64
RHSA-2014:0164 Moderate/Sec.  mysql-devel-5.1.73-3.el6_5.x86_64
RHSA-2014:0164 Moderate/Sec.  mysql-libs-5.1.73-3.el6_5.x86_64
RHSA-2014:0164 Moderate/Sec.  mysql-server-5.1.73-3.el6_5.x86_64
RHBA-2014:0158 bugfix         nss-sysinit-3.15.3-6.el6_5.x86_64
RHBA-2014:0158 bugfix         nss-tools-3.15.3-6.el6_5.x86_64

If you want to apply only one specific advisory:

# yum update --advisory=RHSA-2014:0159

However, if you would like to know more information about this advisory before to apply it:

# yum updateinfo RHSA-2014:0159

For more commands consult the manual pages of yum-security with

# man yum-security

If you face any missing dependency issue while applying security patches on system then refer to yum update --security fails with missing dependency errors.

Friday, October 20, 2017

How to solve the issue with Large Number of LUNs in Linux server?

Friday, October 20, 2017 0
When a large number of LUNs are added to a node, using multipathed devices can significantly increase the time it  takes for the udev device manager to create device nodes for them. If you experience this problem, you can correct  it by deleting the following line in /etc/udev/rules.d/40-multipath.rules:

KERNEL!="dm-[0-9]*", ACTION=="add", PROGRAM=="/bin/bash -c '/sbin/lsmod | /bin/grep ^dm_multipath'", RUN+="/sbin/multipath -v0 %M:%m"


This line causes the udev device manager to run multipath every time a block device is added to the node. Even with this line removed, the multipathd daemon will still automatically create multipathed devices, and multipath will still be called during the boot process for nodes with multipathed root file systems. The only change is that multipathed devices will not be automatically created when the multipathd daemon is not running, which should not be a problem for the vast majority of multipath users.