Tuesday, February 18, 2020

Some Important commands for Linux administration....

1. To register linux server with your account: -

[root@AMITESHJSK /]#subscription-manager register --username amiteshjsk --password *******  --auto-attach

2.To check Kernel version in Linux

[root@AMITESHJSK /]# uname -a
Linux AMITESHJSK 3.10.0-514.el7.x86_64 #1 SMP Wed Oct 19 11:24:13 EDT 2016 x86_64 x86_64 x86_64 GNU/Linux

3.To check the inode number of a file or directory

Inode number or Index number is the entry in inode table containing the informations      (metadata) of a file or directories .

[root@AMITESHJSK /]# ls -li kisna.txt
14441 -rw-r--r--. 1 root root 0 Jun 30 10:30 kisna.txt

4. To create Soft links and Hard links

Soft link or symbolic link or symlink is same as shortcuts in windows OS, an easiest way to link files or directories .
To create Soft links 
[root@AMITESHJSK /]# ln -s /etc/ssh/sshd_config sshd
[root@AMITESHJSK /]# ls -ltr |grep -i sshd
lrwxrwxrwx.   1 root root   20 Jun 30 10:40 sshd -> /etc/ssh/sshd_config

Note: - /etc/ssh/sshd_config (source file)
            sshd  (link file)  

To create Hard links

[root@AMITESHJSK /]# ln /etc/ssh/sshd_config sshdhard
[root@AMITESHJSK /]# ls -ltr | grep -i sshdhard
-rw-------.   2 root root 4360 Jun 24 10:20 sshdhard

Note: - /etc/ssh/sshd_config (source file)
            sshdhard  (link file)

5. To mount your .iso file in linux server: -

[root@AMITESHJSK /]#mount -o loop rhel-server-7.3-x86_64-dvd.iso /mnt/iso

Mount Options :
ro  –  read only,  rw  –  read write,  user  –  user can mount,  exec  –  script can be execute,  noexec  –  script can’t be execute,  noauto  –  partition will not mount automatically,  auto  –  mounts automatically,  sync  –  input and output will synchronize.

6.To set Proxy address in Linux server: -

[root@AMITESHJSK /]#export http_proxy=http://192.168.11.40:8080/
----------------------------------------------------------------------------------------------------------------------

7.To configure NFS in Linux server: -

A.) First of all you have to make entry in /etc/exports of nfs server like:-

/mnt/iso (rw,sync,no_root_squash)



Note: - /mnt/iso (desired mount which you want to share)
 If you want to share mount point with only selected host(eg.- 192.168.11.42) then make entry in /etc/exports like: -

/mnt/iso 192.168.11.42 (rw,sync,no_root_squash)

B.) After that restart nfs service: -


[root@AMITESHJSK /]#service nfs restart


C.) Now you can check shared mount point details by below command: -

[root@AMITESHJSK /]#showmount -e
Export list for MONITORING:
/mnt/iso *

D.) Now mount in client server after creating a directory 

[root@AMITESHJSK /]#mkdir iso
[root@AMITESHJSK /]#mount -t nfs 192.168.11.41:/mnt/iso /iso


Note: - 192.168.11.41 (NFS Server IP )

root_squash – If we are putting root_squash, then it will map root UUID/ GID to anonymous UUID/GID. So in client side the client root user will be denied for accessing, creating file in mounted NFS partition.

no_root_squash  – In no_root_squash , It won’t map root UUID/GID to anonymous user and thus the client root user have all the privileges on the mounted NFS partition.

------------------------------------------------------------------------------------------------------------------------

8.To check list of Listening ports in Redhat Linux:-

[root@AMITESHJSK /]#netstat -tulpn














9. To find a file by name on system from any directory path: -


[root@AMITESHJSK /]#locate filename

-----------------------------------------------------------------
Creating yum  repository file for installing Redhat cluster Software Pacemaker :-

A.) First of all, Mount ISO image file in Server by using below command: -

[root@AMITESHJSK /]#mkdir iso 
[root@AMITESHJSK /]#mount -o loop rhel-server-7.3-x86_64-dvd.iso /iso

B.) Then create a repository file in /etc/yum.repos.d/ path:-

[root@AMITESHJSK /]#vi ha.repo
[repo-update]
gpgcheck=0
enabled=1
baseurl=file:///iso
name=repo-update

[repo-ha]

gpgcheck=0
enabled=1
baseurl=file:///iso/addons/HighAvailability
name=repo-ha

[repo-storage]

gpgcheck=0
enabled=1
baseurl=file:///iso/addons/ResilientStorage
name=repo-storage


C.) Exit by using :wq! from vi editor.

D.) Now we can check our repolist by:-

#yum repolist
epo id                                      repo name                                                                  status
repo-ha                                      repo-ha                                                                        37
repo-storage                                 repo-storage                                                                   42
repo-update                                  repo-update                                                                 4,751
rhel-7-server-rpms/7Server/x86_64            Red Hat Enterprise Linux 7 Server (RPMs)                                   28,773
repolist: 33,603

E.) After that we can install pacemaker by using below command: -

[root@AMITESHJSK /]#yum install -y pacemaker pcs psmisc policycoreutils-python


Stay tuned for installation and configuration of pacemaker.
--------------------------------------------------------------------------------------------------------------------------



Click below link to know more important commands----
https://lalganjrbl.blogspot.com/2020/03/small-but-thick-knowledge.html





Thursday, February 6, 2020

Restoration Process of Ignite Backup

Restore network ignite backup:-


Learn how to restore network ignite backup on HP-UX server. Learn how to restore some other server’s OS backup on diff server provided hardware model is same



Ignite backup is OS backup for HP-UX OS. Ignite-Ux is licensed tool developed by HP for their proprietary OS HP-UX. Ignite backup can be taken on local tape or over network on Ignite server. In this post we will be seeing how to restore network ignite backup on HP-UX.

Pre-requisite :

Login to Ignite server and confirm below points :

Ignite backup of server is available under /var/opt/ignite/clients/<MAC of machine> directory
Directory ownership is bin:bin
Directory permissions are 755
One spare IP with same subnet of Ignite server for installation
Restoration :

Power up your server on which network ignite backup needs to restore. Halt boot process at EFI shell. Enter EFI shell to build your boot profile. Boot profile is profile which has booting options like boot path, network path, setting up boot network parameters for current server etc.

On EFI prompt, you need to execute below command to build your boot profile :


dbprofile -dn ignite -sip 192.168.11.6 -cip 192.168.11.140 -m 255.255.255.0 -b "/opt/ignite/boot/nbp.efi"

Important Notes:-

-sip is Ignite server IP on which backup resides
-cip is machine ip to be used to boot machine with (spare IP I mentioned earlier)
-gip is gateway IP
-m is subnet mask
-b is boot path
-dn is profile name
Here we are building profile with name testprofile and related network parameters using which machine will boot and look for backup.

Now, boot your machine over LAN with this profile using below command from EFI shell:


EFI>lanboot select -dn ignite

This will boot machine with taking himself IP defined in cip, with gateway in gip and will search for boot path on Ignite server sip. Once its query reaches ignite server, it check the MAC address from which query is generated and then serves backup boot path from directory with that MAC address title. That's why we checked permission and ownership previously.

Once everything goes smoothly, you will be served with text based GUI installation menu on your putty terminal. You can go ahead with installation and restore network ignite backup.

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...