Labels

hpunix (63) marathi kavita (52) linux (21) solaris11 (11) AWS (5) numerology (5)
Showing posts with label redhat. Show all posts
Showing posts with label redhat. Show all posts

Tuesday, December 22, 2020

How to check kernel version in linux

How to check kernel version in linux

There are various commands by which we can check current kernel version in linux:

1. #uname -r 

2. #cat /proc/version 

3. #dmesg |grep -i linux

4. #hostnamectl

by above commands we can get current kernel version installed on the system. 

If we want more information like installed date, release date etc.. of that kernel rpm then use below commands:

1. #rpm -qa --last |grep -i kernel  --> to get the date of kernel update

2. #cat /var/log/yum.log |grep -i kernel  ---> If the kernel update is done via yum repository then in the yum.log files will get information of when the kernel installed or kernel related packages updated.

3. #rpm -qi <kernel version name>  ---> We can get the complete kernel version name using above 1-4 commands.


Regards,

Kiraan B Jadhav

Monday, January 4, 2016

Linux Commands to scan/rescan Virtual Disk - Linux

Linux Commands to scan/rescan Virtual Disks:

1. If a new disk is added to VM:

#cd /sys/class/scsi_host/

# ls –lrt  It will show host0, host1….

#echo "- - -" > /sys/class/scsi_host/host[0-1-2]/scan


2. To rescan existing disk. If a existing disk is extended by VMWare team. Then rescan the same disk so the extended size of pv will reflect.

Note down the path [2:0:4:0] or disk name [/dev/sde] which is extended by VMWare team.

#echo 1 > /sys/class/scsi_device/*/device/rescan

# echo 1 > /sys/class/scsi_device/2:0:4:0/device/rescan --> fdisk -l will show new size of that lun

or go to #cd /sys/class/scsi_device/2:0:4:0/device/
#echo 1 > rescan

then

#pvresize [particular PV]

#pvresize /dev/sde --> #pvs command will show extended size of that PV

Tuesday, December 1, 2015

/usr/share/cracklib/pw_dict: error reading header + Linux

At the time of changing password of user "kirjad" we got below error:

root@testsrv ~]# passwd kirjad
Changing password for user kirjad.
New password:
/usr/share/cracklib/pw_dict: error reading header
PWOpen: Success

Solution:

1. Re-install "cracklib-dicts" rpm.
[root@testsrv ~]# rpm -e cracklib-dicts --nodeps

-e : to erase/uninstall cracklib-dicts rpm

2. 
[root@testsrv ~]# yum install cracklib-dicts
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
yum                                                      | 3.9 kB     00:00 ...
yum-update                                               | 3.0 kB     00:00 ...
yum-update/primary_db                                    |  13 MB     00:00 ...
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package cracklib-dicts.x86_64 0:2.8.16-4.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
Package                Arch           Version                Repository   Size
================================================================================
Installing:
cracklib-dicts         x86_64         2.8.16-4.el6           yum         3.6 M

Transaction Summary
================================================================================
Install       1 Package(s)

Total download size: 3.6 M
Installed size: 8.9 M
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
** Found 1 pre-existing rpmdb problem(s), 'yum check' output follows:
pam-1.1.1-17.el6.x86_64 has missing requires of cracklib-dicts >= ('0', '2.8', None)
  Installing : cracklib-dicts-2.8.16-4.el6.x86_64                           1/1
  Verifying  : cracklib-dicts-2.8.16-4.el6.x86_64                           1/1

Installed:
  cracklib-dicts.x86_64 0:2.8.16-4.el6

Complete!

3. 
[root@testsrv ~]# passwd kirjad
Changing password for user kirjad.
New password:
Retype new password:
passwd: all authentication tokens updated successfully.
[root@testsrv ~]# 


Regards,
Kalyanjit