Saturday, September 30, 2023

Grub not Found, Issue Resolution in Linux Server


Sometimes we are facing grub not found as per screenshot, while booting in a Linux Server.

So, we resolve this issue by using below simple steps: -


 


1. We need to boot in rescue mode using RHEL iso image.


(Note: - We need to mount same version of Linux server iso image.

After booting server from Iso image, need to select troubleshooting option as per shown in image.

In next screen, we need to select Rescue a Linux server. )



2. In next screen, select 1 option to enter in read write mode.


3. Run "chroot /mnt/sysimage" command.


4. We need to configure the network for grub installation.


5. To activate the eth0 device, run -


# ip link set dev eth0 up


6. To configure ip address and fetch configuration


# ip addr add 192.168.122.250/24 dev eth0

# ip route add default via 192.168.122.1

# ip addr


7. After network configuration, we need to validate the connection from our satellite server.


# subscription-manager refresh


8. After validating the connection, we need to install grub package -


# yum install grub2-efi-x64


9. Once it is installed then we need to reboot the server.


# init 6


Post that server will boot up normally.



Friday, September 16, 2022

Monitoring Commands in AIX & Linux

 =================== Some Basic AIX Commands =============================== 

To Check physical memory utilization

#svmon -G 

#vmstat 


To see unsuccessful count 

#lsuser username

 

To reset the password after password change

#pwdadm –c username


To remove unsuccessful attempts 

#chuser unsuccessful_login_count=0 username 


To see CPU information 

#sar -u


To see process and utilization 

#topas 

 


=======================LVM commands in AIX =======================

#mkvg -y vgname -s pvname 

#mklv -y lvname -t jfs2 vgname `no. of LPs pvname 

#lslv 

#lsvg 

#crfs -v jfs2 -d /dev/lvname -m filesystem name 

To extend mountpoint 

#chfs -a size=+50G filesystemname 

 



=================Some Linux Basic Commands ==================

 

To see swap/Memory information 

#free -m 


To see unsuccessful count 

#pam_tally2 --user=username 


To remove unsuccessful attempts 

#pam_tally2 --user=username --reset 


To see CPU information 

#lscpu 

 

====To give sudo access======


 (Add entry in /etc/sudoers file) 

useradd –m –g dba -c “Rami Singh” -s /bin/bash rsingh 

username ALL=(ALL) /usr/bin/su - 


Userdd commands parameters - 

-m creating home directory 

-g to assign to primary group 

-c to define values in captions 

-s to define shell 

-G to secondary groups 

To set as password change prompt for first login 

#chage -d 0 username 

To see user password expiry date details 

#chage -l username

 

================================== For Patching in Linux - ======================

To removes the cache of repositories which are enabled in /etc/yum.repos.d/*.repo.

#yum clean all

 

To check update required patches 

#yum check-update

 

To install single package

#yum install packagename

 

To see package details

#yum info packagename

 

To check repolist count

#yum repolist

 

To update all patches 

#yum update

 

To check last updated details

 #yum history

 

To remove recently update package

#yum undo trans ID 

 

=========Check Swap space Utilization ======== 

Check Swap Space 

#vmstat 

#vmstat 1 10 

#swapon -s 

#cat /proc/swaps 


========Check CPU Utilization ========= 

 

#top 

#sar -u 1 10 

 

#ps -Ao user,uid,comm,pid,pcpu,tty --sort=-pcpu | head -n 10 

#ps -eo pid,ppid,cmd,%cpu,%mem --sort=-%cpu | head 

#ps aux | sort -nrk 3,3 | head -n 10 

 

===How to Check how long-time process is running ================ 

#ps -C rsyslogd -o pid,cmd,start,etimes,etime 

#ps -aux | grep rsyslog 

#ps -p 1122 -o etime (where 1122 is PID for rsyslogd) 

#ps -p 1122 -o pid,cmd,etime,uid,gid 


============Check Disk space ============ 

#df -h 

#du -sh /syslog 

#du -x -h -a /syslog | sort -r -h | head . 

Check only GB in file size 

#du -sh * | G 


Introduction to Linux Part 1

Introduction to Linux Part 1

Introduction to Linux Linux is an operating system that works just like Windows and Mac OS X. As an operating system, Linux is a very h...