Friday, February 18, 2022

AWK

 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++



++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


cat /tmp/logins_2.log | awk "/$value1/ "' { print $0 }' >> /tmp/logins_3.log

Friday, February 4, 2022

DNS Server Configuration

 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

DNS Server Configuration 

https://www.youtube.com/watch?v=0X9em99Vcl0

How to configure DNS Server on CentOS 7

https://www.unixmen.com/setting-dns-server-centos-7/


CIDR - IP RANGE : https://www.ipaddressguide.com/cidr

 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


>> BIND is a DNS package on the linux OS


  • We will go through what is DNS 
  • How a DNS Server Works
  • How it will look for various servers in the root hierarchy
  • How it will look for a particular IP Address from that domain 
  • How it will look for an IP address of a system which is in completely in a different geography
  • Finally the 10 step configuration to setup a DNS server
Domain Name System 

What is DNS ?

Translates Internet Domain and host names to IP Addresses and vice-versa . Every Host is physically identified by using its IP address , but most of you might not know that each IP address is unique only to that domain .

The act of sending a request is called the lookup request ,  and what you get in response from the DNS server is the lookup - response

Whichever machine you configure the DNS is called the DNS server , and every system that accesses the server is called the DNS client . So we do not have much of a configuration to from the DNS client side . 

DNS LookUp request  :


Forward Lookup : when you enter a hostname in your URL , an IP address is return - this is called a forward lookup. it resolved a hostname to an IP Address . 

Reverse Lookup : if you enter an IP address of the hostname , it will return you with the hostname this is called reverse lookup. 

Where does the DNS sever gets the IP address of the hostname ?

Let's say we are trying to access google.com now that request will first of all go to a resolver - Now your resolver is nothing but your ISP server - It is basically built into your network operating system and the IP Address of google.com will be built into resolver , it will be present in the cache memory and since the IPADDRESS rez would be present the hostname will be resolved 

But if you are trying to access a new website and the resolver does not have your IP Address . We have the different root hierarchies of DNS , those would be accessed , that's when the whole concept of DNS comes to the picture , that's where we have something called as the root server . Now the root server sit at the top of the DNS hierarchy

There are about 13 sets of root server placed strategically around the world and about 12 organizations access or control these root servers .

The root servers will not tell you the IP Address to which your hostname is resolved to . What the root server will do is it will point you to another server and that is called the "Top-Level-Domain Servers" . Also called TLD servers and when they point you to TLD server , TLD servers will have further information - They will point you to a direction where you will get the IP Address 

So the root server will point you back to the TLD Servers in which your domain may be hosted. The domain that you are trying to access that may be hosted on one of the domains over here . One of these domains is what make up these 13 sets of root servers . From the 13 you shortlist one of them , those come to the resolver it tries to access the Top-Level-Domain servers and these top-level domain server store information such as .com , .net , .dot.org domains  be it google.com , facebook.com those kind of information shall be present in the top level domain servers 

Even now you cannot total resolve to particular domains IP Address , suppose I want to access a particular IP Address inside a domain . The top level  domain servers only knows that these kind of IPAddress are hosted in these servers . What the TLD will do is it will again return back the particular domain -- lets say authoritative name server , - The TLD will return authoritative name server authoritative name server  to the resolver - so based on that information the resolver will query the authoritative nameserver . Now name server is what knows everything about the domain including the IP Address .

Root server will return the top-level domain servers ie .com , .net, or .org . and the top level domain servers will return the domains where your IPAddress is part of that is through the authoritative name servers and finally the resolver will get to the respective IP Address through the authoritative name server . Finally it will store the IP Address in its cache locally for later use. 


So if the next time someone is trying to access this website through your ISP they can straight away fetch the IP address from the resolvers cache . 

DNS Server : There are loads of DNS server available in the market 

We will be using "BIND DNS Servers" . BIND is the most popular and the one of the oldest DNS servers and it is basically a nameserver and can also be configured for mail service 

Others DNS servers  : Unbound , Power DNS

Configure a BIND DNS server in 10 steps .

Firstly we need to install BIND , because BIND is a DNS service and we will have to install it. 

You can use "yum" command in CentOS machines to install them , in Ubuntu machines "apt-get install"



1. Step : Install DNS Package


2. Step : Assign a Static IP Address

Why we add a static IP address to your machine where you are configuring the DNS server . 

>> because if your server reboots you do not want your IP Address to change , that is the reason for having a Static IP Address. You say Boot protocol is static 


We need to add these lines IPADDR, NETMASK,GATEWAY - the rest remains the same. 

Then you need to define a fully qualified hostname

Assign A FQDN for server 


Configure /etc/hosts file


In this case you can avoid the "dns1" here but you need to put in the domain name "vardhan.com"

Configure /etc/resolv.conf

This is something that you also have to configure on your DNS client machine . This is the only step that you need to do it in the DNS client side.

you must say name server and point your IP Address that you want to act as the DNS Server 


> Configure /etc/named.conf  -- From here the configuration is about BIND DNS

 This file is popped up when you install BIND 


You will have the key word : localhost here you need to replace this with the IPAddress . You will have one more number which is the IPV6 Port number . You need to comment out this line , you don't need this line any more .

  • You will have the key word : localhost here you need to replace this with the IPAddress
  • You will have one more number which is the IPV6 Port number . You need to comment out this line , you don't need this line any more .
  • allow-query = any   // you need to replace "none" with any


> Configure /etc/rfc.1912.zones --  This file appears when you install BIND , here is where you define your zones . 

Now there are two concepts of "Forward Lookup" and "Reverse Lookup" 

when you type "hostname" and hit enter that is called the Forward Lookup howevet you enter the IPAddress that is the reverse lookup . 

If you want people to query your server either in the forward or reverse fashion one of these lookup fashions that time for that purpose you need to setup two different zones. 

So your first zone will have rules and settings for what should be returned to them when they access you from forward look up. And when they access your server from the reverse lookup then the settings will be present in this zone . 

  • I have configured the forward look up as my domain name below which is like a domain name for the reverse look up it will be from the IP Address and i have named it as reverse. Zone 

the reverse configuration is a little trick at this step . Stay tuned to know more .

Next step is configuring the forward and the reverse zones - we have created a new file "Forward.zone" and another file "Reversed.zone"  .


> Configuring the Forward and the Reverse Zones :

We have to add the rules over here that's what you will do over here you create one and you open them you will have a basic template , you need to edit that template and replace it with  your hostname and your IPAddress.

  • In the forward.zone file you will replace template with your domain name 
  • In the reverse.zone file you will replace template with your IPAddress
When you do this your DNS servers is well and good , however when you do this you may have to change your group ownership 

> Change the group ownership of those two files. 

After changing the group ownership of those file.

Restart your DNS servers and your service will be up and running . 

 

> Hands On


> NEXT VIDEO -- DNS server configuration .

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Hindi Video : https://www.youtube.com/watch?v=MgIHgbcKjIw

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

check if BIND package is present on OS

$ rpm -qa |  grep bind 


BIND is already present on this system . Choose another system where the bind was not available . to install DNS server .

Below is the command to install DNS server .

  • $ yum install bind    
  • or 
  • $ yum install bind*  -- prefered

> Configuring DNS Server :

DNS Configuration file is > named.conf   > /etc/named.conf 

DNS Port 53 and works on UDP protocol 


The things to edit in this area of the file > /etc/named.conf

Check the IP Address of your DNS Server  > ifconfig

You will have to edit the first line with the IPAddress, you can keep the IPAddress mentioned in there . You can even remove that , but it advisable to keep that and add your IPAddress by adding a semi-colon . 


Next parameter : 

which machines can query the DNS server .


   "any" = allows any client to query the DNS server . 

But if you have a particular network and you want to only provide a set of IP Addresses to query your DNS server then  you can specify the IP range, 


If it is a public DNS we normally use "any" for this parameter . 

This file also has two files included . And there is no other changes that need to perform on this 

There are two files included here. 

  • /etc/named.rfc1912.zone > example : include "/etc/named.rfc1912.zone"
  • /etc/named.root.key >  example :  include "/etc/named.root.key "


This we use for DDNS : Dynamic DNS Server ,  when you set up your DHCP and when your client machine takes the IP from the DHCP , then the DHCP provides the hostname -- when does it give when you set up DDNS 

So that it pickups the hostname of the machine which is available in the computer and it register the name in the DDNS and this is done dynamically . 

DDNS is used when DHCP is used. Without DHCP you cannot configure DDNS server .

But we are setting static DNS server where the registry is manually done . 

-- We make the following changes .


if you are removing this from the file :  include "/etc/named.rfc1912.zone  -- you will have to give the path of the zone inside the same file configuration file 

since this is already included you don't need to open this file . 

save the file  /etc/named.conf 

Open this file : /etc/named.rfc1912.zone


Editing the domain name and the zone 


if you create the file as "/data/f.zone";  -- then you need to create the directory /data and f.zone file with in it. 

or keep it as f.zone alone without a directory - if you need to create a directory you can do that indeed. 

The above ENTRY is for forward.zone 

Now lets make an entry of reverse.zone -- go to the bottom of the page


copy paste the above configuration and make the editing


and we change the "f.zone" in above configuration to "example.com"


 We copied both the configurations that we made into a Notepad . 

Save file : /etc/named.rfc1912.zone

Now create the zone file > cd /var/named

-- One thing that you need to make sure if these file are are present in the /var/named

  1. name.localhost
Go to /etc/named.rfc1912.zone

There is a default entry 



2. name.loopback 


 So these two files needs to be there under /var/named


copy the named.localhost > cp named.localhost example.com



opy the named.loopback > cp named.loopback 



cp named.loopback 0.168.192.in-addr.arpa










Friday, January 7, 2022

IDM : Linux

 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Red Hat identity and access management vision, solution, and roadmap - YouTube


+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

 Defining Host-Based Access Control Rules

 Link : https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/identity_management_guide/hbac-rules

Defining Host-Based Access Control Rules

Access controls, at a high level, define who has access to what. The who is an IdM user, and the what can be either a host (target host), service, or service group, or a combination of the three. 

 

 

Thursday, December 2, 2021

Linux Patching - RHEL

 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

EASY RED HAT 8.3 SERVER PATCHING STEP BY STEP | LINUX ADMINISTRATION PATCHING A BEGINNER'S GUIDE - YouTube


 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Red Hat 8.3 : OPatching 

STEP 1 : PRE CHECK

  • su root
  • cat /etc/redhat-release or  cat /etc/os*
  • uname -r
  • rpm -q kernel --last
  • subscription-manager status
  • subscription-manager list
  • yum repolist
  • yum list available 
  • yum updateinfo summary
  • yum list kernel
STEP 2 : BASIC HEALTH CHECK
  • ifconfig
  • df -Hk
  • netstat -nr
  • cat /etc/fstab
STEP 3 : IMPLMENTATION
  • yum update 
  • uname -r
  • init 6
STEP 4: VERIFICATION
  • rpm -qa kernel
  • uname -r
  • yum updateinfo summary
Login into Red Hat system


Open terminal

Switch to root user 
  • su root
Verify the redhat OS version
  • cat /etc/redhat-release 
Verify the kernel version 
  • uname -r
Check the kernel installation date and time 
  • rpm -q kernel --last
Check the subscription status
  • subscription-manager status
Check the subscription list
  • subscription-manager list 


List the repo
  • yum repolist
Check the available updates
  • yum list available
  • yum updateinfo summary 



Step 1 pre-check completed 

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

STEP 2 : BASIC HEALTH CHECK

  • ifconfig
  • netstat -nr 
  • df -hk
  • cat /etc/fstab
-----------------------------------

STEP 3 : IMPLEMENTATION

  • yum update



  • uname -r
  • yum list kernel
  • rpm -qa kernel
  • init 6 -- command gracefully reboots the system running all the K* shutdown scripts first
  • vmware 

After reboot -- verify the kernel version 

  • rpm -qa kernel
  • uname -r
  • yum updateinfo summary 
  • cat /etc/redhat-release
  • uname -r
  • yum update summary 
  • yum updateinfo summary 
OS patch done. 

----------------Command to Patch the system-----------------------------------

For Red Hat Linux distributions (e.g. RedHat, CentOS, Oracle), the following commands check for updates and patches the system:

yum check-update

yum update

For Suse-based Linux (e.g. Suse Linux Enterprise, OpenSuse), the following commands check for updates and patch the system:

zypper check-update

zypper update

For Suse-based Linux (e.g. Suse Linux Enterprise, OpenSuse), the following commands check for updates and patch the system:

zypper check-update

zypper update


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


SHELL SCRIPTING: BEGINNERS

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Shell Scripting Tutorial for Beginners 1 - Introduction - YouTube   Ubuntu is used ....

Shell Scripting Tutorial-1 Course Content - YouTube   

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Shell Scripting Tutorial-1 Course Content - YouTube   



Sunday, October 31, 2021

IP TABLE :

 

 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

 IP TABLES

 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

IP Tables and Firewalld an Introduction :

Redhat has a Powerful firewall built in - Called IP Tables  . But if you were to look at it more carefully it is IP Tables /Netfilter

IP Tables is a user space module , the bit with which the user interact with at the command line to enter firewall rules into per-defined tables  .

Netfilter : Is the kernel module built into the kernel which actually does the filtering .

Front end GUI available for IP Tables , that allows users to add or define rule based on a point and click user interface . But this often lacks the flexibility that the command line tool provides .

We are going to learn the command line interface of IP Tables

Basic Understanding the way it works. 


  • IP Tables Places rules into per-defined chains . INPUT, OUTPUT and FORWARD That are checked against any network traffic IP packets  relevant to those chains . And a decision is made from these IP Packets based on the outputs of those rules that is accepting or copying the packet . These actions are referred to as targets - The most common per-defined targets are DROP to drop the packets or ACCEPT to accept a packet
  • There are three per-defined chains in the filter tables to which we  can add rules for processing IP addresses. 
  • These packets are INPUT this means all packets are destined for the host computer . 
  • OUTPUT : All packets originating from the host computer .
  • FORWARD : All packets neither destined for originating from the host computer . But passing by or routed by the  host computer. This chain is used if you are using your computer as a router
  • for most parts we are going to dealing with INPUT chains while dealing with packets entering our machines keeping the bad guys out .
  • Rules are added in a list to each chain and a packet is checked against each role  in turn , starting in the top and if it matches a rule a action is taken . such as  ACCEPTING when accepting DROP when you drop a packet . Once the packets are matched and an action is taken the packet is processed according to the as the outcome of that rule. And  Isn't processed by further rules in the chain.
  • If it passes through all the rules in the chain and reaches the bottom with out being matched against any rule the the default action for the chain is taken . This is referred to as the default policy or may be set to ACCEPT or DROP the packet .

 


There are three predefined chains in the filter table which we can add rules for processing IP Addresses .

The concept of default policy

Working with IP Table from the command line needs root privileges , so you need to become root for most things you are doing . 

One important things - We will be turning off the IP table and resetting the firewall rule so if you are relying on firewall as your primary line of defense you should be aware of this .

 IP Tables should be installed by default on all CentOS and Redhat machines . you can check that by running the below command

$ rpm -q iptables

Next we can check if IP Table modules are loaded with the -l switch to inspect the currently loaded rules

$ lsmod | grep ip_tables

$ iptables -L


If IPtable is not running on your system this is how you can get it started 

$ system-config-securitylevel^C

In CentOS

sudo systemctl start iptables
sudo systemctl enable iptables

In this lecture we are going to write a simple rule-set . At this point we are going to clear the default rule set, so if you are connecting so if you are connecting remotely to a server via SSH for this tutorial

Then there is a real possibility that you can lock yourself out of your machine .

So you must set the default INPUT policy to ACCEPT before flushing the current rules. And then add a rule from the first to explicitly allow yourself access to prevent against locking yourself up. So this is just a cautionary note .

We will use an example based approach to examine the various IP tables command . In this example we will create a very simple set of rules to setup up state-ful packet inspection or SPI firewall that will allow all out going connection but block all unwanted incoming connection .

$ iptables -P INPUT ACCEPT

$ iptables -F

$ iptables -A INPUT -i lo -j ACCEPT

$ iptables -A INPUT -m state --state ESTABLISHED, RELATED ACCEPT


Last one is >  iptables -L -v

lets take a look at all the commands that we have run so far . 

 $ iptables -P INPUT ACCEPT -- while connecting remotely we need to temporarily set the default policy on your input chain . other while flushing the current rules we will be locked out of the server .


 

 

 

 

 

 

Friday, October 29, 2021

SHELL - SHELL SCRIPTING : Adding Disks | Logical Volume | PV etc

 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

https://www.youtube.com/watch?v=hugEkh50Ynk

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

(HOW-TO) Add disks in VirtualBox and extend disk space using LVM for Linux guests

How to add virtual disk to an existing virtual machine and then using common LVM - using Logical Volume Management Tools inside linux we will extend the size

There are couple of ways to create additional disk space for virtual machines . There is a tool on your host machine for Virtual Box - Called VBOX Manage and you can modify HD . you could expand the size . Right now I have the default size of 12G . I could make it Bigger if I want .

But I will show you another method to do this. We will just create new drives in here .

The command lines that I am going to show will work for any distribution . It does not matter if you have a GUI or not or debian based or RPM based

check the logical volumes 

$ lvdisplay    --  This will display all the logical volumes that you have in there .



There is a single Volume Group called mint-vg

Adding New Virtual Disk - VM -- Storage -- Add a Hard disk


You can bind them all here - the multiple disks in here and the you can group them together to have large volume group

We created two new Virtual disks .

>>> lsblk


Check the hard disks 

$ ls -l /dev/sd *   -- sd stands for scsi disk devices


The Original Virtual disk we have in there /dev/sda

      And there are three partition under it.

  • /dev/sda1
  • /dev/sda2
  • /dev/sda5

And the below ones are the New disks we added. /dev/sdb & /dev/sdc

The first we are going to do is Partition .

$ sudo su - / move in as root

We are going to use the fdisk utility for doing the partition

$ fdisk /dev/sdb




Hex Code : 8e -- Mean Linux VM


W to write the table to the disk 



Now if you do

$ ls -l /dev/sd*   --  this will show up the new partitions

That's how you use fdisk -- this created partitions for you .

Next thing that we are going to do it 

$ pvdisplay

As you can see you only have a single Physical Volume

$ pvcreate -- to add these two new virtual disks partitions 

The pvcreate command initializes a physical volume for later use by the Logical Volume Manager for Linux. Each physical volume can be a disk partition, whole disk, meta device, or loopback file.

 $ pvcreate /dev/sdb1 /dev/sdc1


Will do pvdisplay again

$ pvdisplay

now two physical volume has been created 

/dev/sdb1 /dev/sdc1


display existing Volume Groups in there 

$ vgdisplay


Now we have one Volume Group. And now we are going to add the two physical volume to this single Volume group that we have 

$ vgextend -t  / t stands for test to test it out this won't comment or change anything .

$ vgextend -t -v mint-vg /dev/sdb1 /dev/sdc1


This was in the test mode so the data will not be updated. this time we will use the same command without the -t test option in there

$ vgextend -v mint-vg /dev/sdb1 /dev/sdc1

$ vgdisplay  --As you can see there is one existing Volume group 

Now we are going to add two of these physical volumes


The important thing to know is PE - stands for Physical Extend .1541 is number that we need to remember. we have 6 GIG that is current free .

The orginal Logical volume has 11.73 -- this is what the real state of the computer was .

We have added additional 3 Gig each to it which makes up to 6GB -- This is what we have added .

This is the Physical extends and we want to add this into Logical Volumes .

 Currently We have only two logical Volumes

 


 $ lvextend -l   //- l means the amount of size you  want

 $ lvextend  -l  +1541 -r   // -r for automatically resize the file system

 $ lvextend  -l  +1541 -r -t // -t for test

 $ lvextend  -l  +1541 -r -t -v // -v define the volume group


 $ lvextend  -l  +1541 -r -t -v /dev/mint-vg/root


Now we will remove the -t flag


 $ lvextend  -l  +1541 -r  -v /dev/mint-vg/root

Now if you do  df -h


The root mount point is added with 16GB


 LVM Partition Management


Command Description
dumpconfig Dump the active configuration
formats List the available metadata formats
help Display the help commands
lvchange Change the attributes of logical volume(s)
lvcreate Create a logical volume
lvdisplay Display information about a logical volume
lvextend Add space to a logical volume
lvmchange Due to use of the device mapper, this command has been deprecated
lvmdiskscan List devices that may be used as physical volumes
lvmsadc Collect activity data
lvmsar Create activity report
lvreduce Reduce the size of a logical volume
lvremove Remove logical volume(s) from the system
lvrename Rename a logical volume
lvresize Resize a logical volume
lvs Display information about logical volumes
lvscan List all logical volumes in all volume groups
pvchange Change attributes of physical volume(s)
pvcreate Initialize physical volume(s) for use by LVM
pvdata Display the on-disk metadata for physical volume(s)
pvdisplay Display various attributes of physical volume(s)
pvmove Move extents from one physical volume to another
pvremove Remove LVM label(s) from physical volume(s)
pvresize Resize a physical volume in use by a volume group
pvs Display information about physical volumes
pvscan List all physical volumes
segtypes List available segment types
vgcfgbackup Backup volume group configuration
vgcfgrestore Restore volume group configuration
vgchange Change volume group attributes
vgck Check the consistency of a volume group
vgconvert Change volume group metadata format
vgcreate Create a volume group
vgdisplay Display volume group information
vgexport Unregister a volume group from the system
vgextend Add physical volumes to a volume group
vgimport Register exported volume group with system
vgmerge Merge volume groups
vgmknodes Create the special files for volume group devices in /dev/
vgreduce Remove a physical volume from a volume group
vgremove Remove a volume group
vgrename Rename a volume group
vgs Display information about volume groups
vgscan Search for all volume groups
vgsplit Move physical volumes into a new volume group
version Display software and driver version information


++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

https://www.youtube.com/watch?v=dMHFArkANP8


++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

 LVM is short for Logical Volume Manager

 What it does ? it allows for the creation of groups of disks or partitions that can assembles into single (or multiple filesystems )

  •  Logical Volume can be used for nearly any mount point except for boot (Boot has to be regular file system.  The reason for this the boot cannot read the LVM meta data .
  • One of the great things about LVM is its flexibility : Allows for resizing of volumes .
  • You can shrink a volume to reduce unused  space or you can grow a volume which is handy for locations which is /var where we have a whole lot of log files 
  • Snap Shot : Another important feature is the snapshot - allows you to take point in time copies of your logical volume . That snap shot you can copy it back to a different location and use it as a backup method for you current hard disk .

 Example of a Logical Volume Group . 

At the bottom level you are going to have your Physical Volumes which are your actual disks that you have in your system such as below ones .


Now you don't have to have three disk . I am just showing this as an example . You can even have a system with just one disk .

Above your physical volume you have something called your Volume Group . As you can see the Volume Group VG_Base encompasses all volume groups .


And once again a Volume Group can be attached to one disk . But here we are showing that all the Physical disk belong to this Volume . 

And top of your Volume Group you are going to have your actual Logical Volume .


This is where we actually curve our volume group into individual components that are a lot like partitions

Above the Logical Volumes we have your actual filesystems .


Your logical volume again acts like a partition . Your logical volumes again acts something like a partitions . But a Partition still needs a file system on it. This is where you put your XFS , EXT4 on top of your Logical Volume . On the file system layer you have your actual directory

Basic commands that will display the setup here on the machine .

$ pvs command for Physical Volume command

Physical Volume Scan : pvs

This display all physical volume that belong to one logical volume manager setup .

This Physical disk has a volume group 


here we have only one Volume group PV and this belongs to VG VolGroup00 ,

Now lets go one step above that and take a look at Volume Groups. We use the vgs command for this . VGS like PVS scans for various volume groups on your system


There is a Physical Volume attached by there are two logical volumes contained in this Volume Group .

So lets run LVS to run a short volume scan to see what these logical volumes are .

$ lvs

ans here we can see two individual logical volumes