0% found this document useful (0 votes)
154 views

How To Recover and Start A Veritas Volume Manager Logical Volume Where The Volume Is DISABLED ACTIVE and Has A Plex That Is DISABLED RECOVER

Plex is a group of sub-disks that can be organized in stripes, mirrors, or RAID configurations. Plexes are used to form volumes, and the 'vxassist' command automatically creates plexes during volume creation. A plex can also be created separately with the 'vxmake' command and attached to a volume later. When a volume or plex encounters a problem, VxVM changes the state of the volume and plexes. The 'vxrecover -g <diskgroup>' command is generally used to recover and start volumes not in the ENABLED state. The specific steps shown recover a volume by changing the plex to DISABLED STALE and DISABLED CLEAN states, then starting

Uploaded by

venkatesh
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
154 views

How To Recover and Start A Veritas Volume Manager Logical Volume Where The Volume Is DISABLED ACTIVE and Has A Plex That Is DISABLED RECOVER

Plex is a group of sub-disks that can be organized in stripes, mirrors, or RAID configurations. Plexes are used to form volumes, and the 'vxassist' command automatically creates plexes during volume creation. A plex can also be created separately with the 'vxmake' command and attached to a volume later. When a volume or plex encounters a problem, VxVM changes the state of the volume and plexes. The 'vxrecover -g <diskgroup>' command is generally used to recover and start volumes not in the ENABLED state. The specific steps shown recover a volume by changing the plex to DISABLED STALE and DISABLED CLEAN states, then starting

Uploaded by

venkatesh
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 12

What are plex in VxVM

Plex is a group of sub-disks. Plex can be organized as stripes, mirror and RAIDs. Plexes are used to form volumes. 'vxassist'
command automatically creates plexes while creating volumes. Plex can also be created seperately with 'vxmake' command and
attached to a volume later.

How to recover and start a Veritas Volume Manager logical volume where the volume is DISABLED ACTIVE
and has a plex that is DISABLED RECOVER
When a system encounters a problem with a volume or a plex, or if Veritas Volume Manager (VxVM) has any reason to
believe that the data is not synchronized, VxVM changes the kernel state, KSTATE and state, STATE, of the volume
and its plexes accordingly. The plex state can be stale, empty, nodevice, etc. A particular plex state does not necessarily
mean that the data is good or bad. The plex state is representative of VxVM's perception of the data in a plex.
# vxprint -ht -g testdg
Veritas Volume Manager provides the "vxrecover -g <disk-group-name> -bs" command which is generally used to recover and
start volumes not in an ENABLED state.
1. Change the plex test-01 to the DISABLED STALE state:
# vxmend -g  diskgroup fix stale <plex_name>
For example:
# vxmend -g testdg fix stale test-01
This output shows the plex test-01 as DISABLED STALE:
# vxprint -ht -g testdg
 
                 
DG NAME NCONFIG NLOG MINORS GROUP-ID      
DM NAME DEVICE TYPE PRIVLEN PUBLEN STATE    
RV NAME RLINK_CNT KSTATE STATE PRIMARY DATAVOLS SRL  
RL NAME RVG KSTATE STATE REM_HOST REM_DG REM_RLNK  
V NAME RVG KSTATE STATE LENGTH USETYPE PREFPLEX RDPOL
PL NAME VOLUME KSTATE STATE LENGTH LAYOUT NCOL/WID MODE
SD NAME PLEX DISK DISKOFFS LENGTH [COL/]OFF DEVICE MODE
SV NAME PLEX VOLNAME NVOLLAYR LENGTH [COL/]OFF AM/NM MODE
 
2. Change the plex test-01 to the DISABLED CLEAN state:
# vxmend -g diskgroup fix clean <plex_name>
For example:
# vxmend -g testdg fix clean test-01

This output shows the plex test-01 as DISABLED CLEAN:


# vxprint -ht -g testdg
 
                 
DG NAME NCONFIG NLOG MINORS GROUP-ID      
DM NAME DEVICE TYPE PRIVLEN PUBLEN STATE    
RV NAME RLINK_CNT KSTATE STATE PRIMARY DATAVOLS SRL  
RL NAME RVG KSTATE STATE REM_HOST REM_DG REM_RLNK  
V NAME RVG KSTATE STATE LENGTH USETYPE PREFPLEX RDPOL
PL NAME VOLUME KSTATE STATE LENGTH LAYOUT NCOL/WID MODE
SD NAME PLEX DISK DISKOFFS LENGTH [COL/]OFF DEVICE MODE
SV NAME PLEX VOLNAME NVOLLAYR LENGTH [COL/]OFF AM/NM MODE
                 
 
3. Start the volume test:
# vxvol -g diskgroup start  <volume>
For example:
 
# vxvol -g diskgroup start test

This output shows that the volume test and its plex test-01 are both ENABLED ACTIVE:
 
# vxprint -ht -g testdg
 
                 
DG NAME NCONFIG NLOG MINORS GROUP-ID      
DM NAME DEVICE TYPE PRIVLEN PUBLEN STATE    
RV NAME RLINK_CNT KSTATE STATE PRIMARY DATAVOLS SRL  
RL NAME RVG KSTATE STATE REM_HOST REM_DG REM_RLNK  
V NAME RVG KSTATE STATE LENGTH USETYPE PREFPLEX RDPOL
PL NAME VOLUME KSTATE STATE LENGTH LAYOUT NCOL/WID MODE
SD NAME PLEX DISK DISKOFFS LENGTH [COL/]OFF DEVICE MODE
SV NAME PLEX VOLNAME NVOLLAYR LENGTH [COL/]OFF AM/NM MODE
                 
 
4. Mount the volume to its associated mount point (refer to the /etc/vfstab file if the mount point location is not known) if the
file system is a Veritas File System (VxFS) file system:
# mount -F vxfs /dev/vx/dsk/diskgroup/volume /mount point

For example:
 
# mount -F vxfs /dev/vx/dsk/testdg/test /testvol

How to create mirror volume in vxvm

The value can be set in /etc/default/vxassist . If there is a reason to implement a particular layout, you can specify layout=mirror-
concat or layout=concat-mirror to implement the desired layout. Specify the -b option if you want to make the volume
immediately available for use.
To create a new mirrored volume
 Create a new mirrored volume, using the following command:
 # vxassist [-b] [-g diskgroup] make volume length \
layout=mirror [nmirror=number] [init=active]
Specify the -b option if you want to make the volume immediately available for use.
For example, to create the mirrored volume, volmir, in the disk group, mydg, use the following command:
# vxassist -b -g mydg make volmir 5g layout=mirror
The following example shows how to create a volume with 3 mirrors instead of the default of 2 mirrors:
# vxassist -b -g mydg make volmir 5g layout=mirror nmirror=3

How to create diskgroup in vxvm


You can use the vxdg command to create a new disk group. A disk group must contain at least one disk at the time it is created.
You also have the option to create a shared disk group for use in a cluster environment. Disks must be placed in disk groups
before they can be used by VxVM.
To create a new disk group
 Use the vxdg command as follows:
# /opt/VRTS/bin/vxdg init disk_group [disk_name=disk_device]
The following is an example of creating a disk group using the vxdg command:
To create a disk group named PRODdg on a raw disk partition Disk_0, where the disk name PRODdg01 references the
disk within the disk group:
# /opt/VRTS/bin/vxdg init PRODdg PRODdg01=Disk_0
To create a new shared disk group in an Oracle RAC environment
 Use the vxdg command as follows:
# /opt/VRTS/bin/vxdg -s init disk_group [disk_name=disk_device]
Where the -s option allows the disk group to be shared.
Warning: Veritas Storage Foundation for Oracle RAC supports shared disk groups. Veritas Storage Foundation
for Oracle Standard and Enterprise editions support single disk groups.
To create a disk group named PRODdg on a raw disk partition Disk_0, where the disk name PRODdg01 references the
disk within the disk group:
# /opt/VRTS/bin/vxdg -s init PRODdg PRODdg01=Disk_0

what are the private and public regions in vcs


The public and private regions are on the same disk area (with the public area following the private area). The public and private
regions are on different disk partitions. The disk is formatted as a Cross-platform Data Sharing (CDS) disk that is suitable for
moving between different operating systems.
private A small area where configuration information is stored. A disk header label, configuration records for VxVM
region   objects (such as volumes, plexes and subdisks), and an intent log for the configuration database are stored
here. The default private region size is 32 megabytes, which is large enough to record the details of several
thousand VxVM objects in a disk group. 
Public An area that covers the remainder of the disk, and which is used for the allocation of storage space to
region  subdisks. 

How to determine free space in a disk group using the


vxassist maxsize and maxgrow commands
1. To determine regions of total free space on all disks across all imported disk groups:
# vxdg free

2. To determine regions of total free space for a specific imported disk group, type:
# vxdg -g <disk group> free

When querying the system to determine how much space will be available for a particular volume, it is crucial you
specify the volume layout for the type of volume you are going to create:

Example
Using the following disk group " tdg" (Each LUN is 2G insize):

# vxdg -g tdg free


DEVICE      TYPE            DISK        GROUP        STATUS
sdb          auto:sliced    disk01      tdg          online
sdc          auto:sliced    disk02      tdg          online
sdd          auto:sliced    disk03      tdg          online

The vxassist " maxsize" argument allows you to determine the maximum volume size you could create for specified
diskgroup "tdg":
# vxassist -g tdg maxsize
Maximum volume size: 12472320(6090Mb)

NOTE: The maxsize operation will use the default concatenated (concat) layout by default to establish the maximum
volume size.

To indicate a different volume layout use the "layout" parameter:


# vxassist -g tdg maxsize layout=striped
Maximum volumesize: 8314880 (4060Mb)

The available size has changed for the above example from 6090Mb (concat layout) to 4060Mb for the striped volume
layout. The default stripe column count is 2 columns, when no column count is specified.
The "maxgrow" command can be used to determine how much space can be added to an existing volume.  This
command respects volume layout device restrictions.

Example Section:

# vxassist -g tdg make tvol 1000M layout=striped ncols=3

# vxprint -htqg tdg

dgtdg          default      default  0        1262975382.14.therat

dmdisk01      sdb          auto     2074    4158112  -


dmdisk02      sdc          auto     2074    4158112  -
dmdisk03      sdd          auto     2074    4158112  -

v  tvol        -            ENABLED  ACTIVE  2048000  SELECT    tvol-01  fsgen


pltvol-01      tvol        ENABLED  ACTIVE  2048256  STRIPE    3/128    RW
sddisk01-01    tvol-01      disk01  0        682752   0/0      sdb      ENA
sddisk02-01    tvol-01      disk02  0        682752   1/0      sdc      ENA
sddisk03-01    tvol-01      disk03  0        682752   2/0      sdd      ENA

To determine how much space is left available for a concat volume (total free space in disk group):
# vxassist -g tdg maxsize
Maximum volume size: 10424320(5090Mb)

To determine how much space is left available for a new 2 column stripe volume:
# vxassist -g tdg maxsize layout=striped ncols=2
Maximum volume size: 6948864(3393Mb)

To determine how much the existing volume 'tvol' can be grown:


# vxassist -g tdg maxgrow tvol
Volume tvol can be extended by10424320 to: 12472320 (6090Mb)
 
VCS command line reference
VCS command line reference
Cluster operations Command line
hastart [-onenode]
Start VCS
hastart -force system_name
hastop -local [-force|-evacuate|-noautodisable]
hastop -local [-force|-evacuate -noautodisable]
Stop VCS hastop -sys system_name [-force|-evacuate|-noautodisable]
hastop -sys system_name [-force|-evacuate -noautodisable]
hastop -all [-force]
haconf -makerw
Enable/disable read-write access to VCS configuration
haconf -dump -makero
Add user hauser -add user_name
VCS commands for service group and resource operations
Service group and resource operations Command line
hagrp -add |-delete group_name
Configure service groups hagrp -modify group attribute value
hagrp -link parent_group child_group dependency
Service group and resource operations Command line
hares -add resource type group_name
hares -delete resource_name
Configure resources
hares -modify resource attribute value
hares -link parent_resource child_resource
Configure agents or resource types hatype -modify type attribute value
hagrp -online service_group -sys system_name
Bring service groups online and take them offline
hagrp -offline service_group -sys system_name
hares -online resource_name -sys system_name
Bring resources online and take them offline
hares -offline resource_name -sys system_name
hagrp -freeze group_name [-persistent]
Freezing/unfreezing service groups
hagrp -unfreeze group_name [-persistent]
VCS commands for system operations
System operations Command line
List systems in a cluster hasys -list
Retrieve detailed information about each system hasys -display system_name
hasys -freeze [-persistent][-evacuate] system_name
Freezing/unfreezing systems
hasys -unfreeze [-persistent] system_name
VCS commands for status and verification
Status and verification Command line
Cluster status hastatus -summary
lltconfig
lltconfig -a list
LLT status/verification
lltstat
lltstat -nvv
GAB status/verification gabconfig -a
amfconfig
AMF kernel driver status/verification
amfstat
VCS commands for cluster communication
Communication Command line
lltconfig -c
Starting and stopping LLT
lltconfig -U
gabconfig -c -n seed_number
Starting and stopping GAB
gabconfig -U

Move Resources Manually


[root@pcmk-1 ~]# pcs resource move WebSite pcmk-1
[root@pcmk-1 ~]# pcs constraint
Location Constraints:
Resource: WebSite
Enabled on: pcmk-1 (score:50)
Enabled on: pcmk-1 (score:INFINITY) (role: Started)
Ordering Constraints:
start ClusterIP then start WebSite (kind:Mandatory)
Colocation Constraints:
WebSite with ClusterIP (score:INFINITY)
Ticket Constraints:
[root@pcmk-1 ~]# pcs status
Cluster name: mycluster
Stack: corosync
Current DC: pcmk-2 (version 1.1.18-11.el7_5.3-2b07d5c5a9) - partition with quorum
Last updated: Mon Sep 10 17:28:55 2018
Last change: Mon Sep 10 17:28:27 2018 by root via crm_resource on pcmk-1

2 nodes configured
2 resources configured

Online: [ pcmk-1 pcmk-2 ]

Full list of resources:

ClusterIP (ocf::heartbeat:IPaddr2): Started pcmk-1


WebSite (ocf::heartbeat:apache): Started pcmk-1

Daemon Status:
corosync: active/disabled
pacemaker: active/disabled
pcsd: active/enabled
Once we’ve finished whatever activity required us to move the resources to pcmk-1 (in our case nothing), we can then
allow the cluster to resume normal operation by removing the new constraint. Due to our first location constraint and our
default stickiness, the resources will remain on pcmk-1.
We will use the pcs resource clear command, which removes all temporary constraints previously created by pcs
resource move or pcs resource ban.
[root@pcmk-1 ~]# pcs resource clear WebSite
[root@pcmk-1 ~]# pcs constraint
Location Constraints:
Resource: WebSite
Enabled on: pcmk-1 (score:50)
Ordering Constraints:
start ClusterIP then start WebSite (kind:Mandatory)
Colocation Constraints:
WebSite with ClusterIP (score:INFINITY)
Ticket Constraints:
Note that the INFINITY location constraint is now gone. If we check the cluster status, we can also see that (as expected)
the resources are still active on pcmk-1.
[root@pcmk-1 ~]# pcs status
Cluster name: mycluster
Stack: corosync
Current DC: pcmk-2 (version 1.1.18-11.el7_5.3-2b07d5c5a9) - partition with quorum
Last updated: Mon Sep 10 17:31:47 2018
Last change: Mon Sep 10 17:31:04 2018 by root via crm_resource on pcmk-1

2 nodes configured
2 resources configured

Online: [ pcmk-1 pcmk-2 ]

Full list of resources:

ClusterIP (ocf::heartbeat:IPaddr2): Started pcmk-1


WebSite (ocf::heartbeat:apache): Started pcmk-1

Daemon Status:
corosync: active/disabled
pacemaker: active/disabled
pcsd: active/enabled

What are the logical Steps to Install Red Hat satellite Server 6.2 ?
Ans: Following are the logical Steps:
a) Register Your RHEL 6.x / 7.x Server to Red Hat Network and attach Satellite subscription to it
b) Install the satellite package using below command
  # yum install satellite
c) Install the satellite Server using below command
# Satellite-installer  --foreman-admin-username admin  --foreman-admin-password {Enter_Password}
d) Generate the Manifest for Satellite server from Red Hat Portal and upload it to your satellite Server.
e) Sync the Repositories based on your requirement and Create Contents views and Life cycle environment.
f) Start Registering the RHEL systems using the Activation Keys.
How to retrieve Satellite Server admin password in case you have forgotten ?
Ans:  To get the new password for admin user, run the beneath command
# foreman-rake permission:reset
what are the different ways to register RHEL machine to Satellite Server for patching ?
Ans: There are two ways to register RHEL machine to satellite server
a) Use the username and password in subscription-manager command like,
subscription-manager register –username {user}  --password {password}
b) Using the activation keys we can also register RHEL server to satellite, like
subscription-manager subscription-manager register --org="Test" --activationkey="RHEL7-Test"

How to enable specific Red Hat repository on your register client ?


Ans: We can enable the specific Red Hat repository using the following commands:
# subscription-manager repos  --list
# subscription-manager repos --enable={repository-id}
Q:10 How to unregister a server from Red Hat Satellite Server ?
Ans: To unregister a server from satellite server first run the command from the  server’s terminal “subscription-manager
unregister” then go to satellite dashboard remove or unregister that hosts from content hosts entry if it is there.
Q:11 How to verify the subscription status of a RHEL Server in Satellite ?
Ans: From the server’s terminal run the command “subscription-manager status”, it will display the current subscription
status and we can also verify the subscription status from Satellite dashboard, Go to the hosts Tab –> then content hosts
–> See the subscription details.
Q:12 What are different ports used between satellite server and its client for smooth patching ?
Ans: Following are required ports that needs to allowed in the firewall between satellite and its client
 80 TCP – HTTP, ( provisioning purpose)
 443 TCP – HTTPS, (web access and api communication )
 5646 / 5647 TCP – qdrouterd – (used for client and Smart Proxy actions)
 9090 TCP – HTTPS – ( used for communication with the Smart Proxy )
Q:13 How to verify whether satellite server’s service is up and running ?
Ans: From the Satellite server terminal execute the following command:
# katello-service status
Above command will verify the service status of each satellite component and will display the status accordingly
What is Hammer CLI and why it is used in Red Hat Satellite Server ?
Ans: Hammer CLI is a command line utility through which we can configure and manage our Red Hat Satellite Server.
In other words we can say whatever tasks we do from Satellite dashboard same can accomplished via hammer cli.
To use the hammer cli, make sure you have installed a package “tfm-rubygem-hammer_cli_katello”.  To connect to
Satellite Server via hammer cli use the command
is it possible to provision bare metal & virtual machine using Satellite Server ?
Ans: Yes, we can provision bare metal & virtual machines using Red Hat satellite Server. Foreman is the component in
Red Hat Satellite Server through which provisioning is possible. On further details on provisioning refer the following
article
How to Patch Your Linux Installation
Like all OSes, every once in a while you need to update the software running on your Linux server. You can do this in
one of three ways :
 Download the updated packages and manually install them yourself.
 Use a built-in open source application that comes with the OS distribution.
 Use a third party application that downloads the file and then runs the installation for you.
Let’s look at these in more detail.
Manual Updates
One way you can update your RedHat or SuSE machine is by going to your particular vendor’s Web or FTP site, and
downloading the packages directly from the online file repository or a trusted mirror site. For recent products, like
Novell’s SLES or RedHat Enterprise Servers, once you get the file onto your machine you can then run the RedHat
Package Manager (aka “rpm”) and update the target program you choose.

linux rpm redhat


After downloading the rrdtool’s latest RPM, you can run “rpm –i" to install the new package, or “rpm –u” if you are
updating rrdtool. The next RPM command queries all the installed RPMs, and extracts only the information you want,
using the grep command. The third command uninstalls the rrdtool using “rpm –e”. Finally, the last line confirms that the
application rrdtool is not installed anymore.

If you have a location of a package available via a URL, you can point RPM to update it for you. This image shows the
update, the confirmation, and the removal of the livna-release-6-1 package.
In a perfect world, once you run the rpm command, you’re done in a moment or two. Confirmation may be a short
message provided by the package installation, or you just get a command prompt ready for your next Linux command.
However, since we don’t live in a perfect world, things can get a little confusing. You may run into a dependency issue
where another package on your machine has to be updated before you can update your target program.

linux rpm
A failed RPM installation will generate the above message and not continue the install.
Things can get worse when you realize that these packages that need updates also require further updates themselves,
turning a simple upgrade into a longer exercise of having to figure out how to deal with all these dependencies and sub-
dependencies.

difference between physical and logical extraction


There are two methods for retrieving data from a cell phone: logical extraction and physical
extraction. Logical extraction is easier and less time-consuming, but returns less information.
Physical extraction is more difficult and takes much longer, but has a greater return of hidden
or deleted information.
what is the default logical extent size
4 MiB.
The default is 4 MiB.… [H]aving a large number of extents will slow down the tools but have no impact on I/O
performance to the logical volume. When they say "no impact on I/O performance", they mean that literally.

How to patch and rollback patch in Redhat/CentOS


Linux?
[root@linuxunix ~]# cat /etc/redhat-release
CentOS release 6.8 (Final)
[root@linuxunix ~]#
[root@linuxunix ~]# yum update
[root@linuxunix ~]# grep -v '^#' /etc/grub.conf
[root@linuxunix ~]# cat /etc/redhat-release
Now when I reboot my system it will boot with the new kernel 2.6.32-696.13.2.el6.x86_64.
[root@linuxunix ~]# uname -a
Linux linuxunix 2.6.32-696.13.2.el6.x86_64 #1 SMP Thu Oct 5 21:22:16 UTC 2017 x86_64 x86_64
x86_64 GNU/Linux
[root@linuxunix ~]#

Rollback patch
Step 1: Boot from the old kernel.
[root@linuxunix ~]# uptime
 16:34:24 up 8 min,  1 user,  load average: 0.08, 0.08, 0.06
[root@linuxunix ~]# uname -a
Linux linuxunix 2.6.32-642.el6.x86_64 #1 SMP Tue May 10 17:27:01 UTC 2016 x86_64 x86_64 x86_64
GNU/Linux
[root@linuxunix ~]#
Step 2: Now run the yum history command to view a history of previous yum activities.
[root@linuxunix ~]# yum history
Loaded plugins: fastestmirror, security
ID     | Login user               | Date and time    | Action(s)      | Altered
-------------------------------------------------------------------------------
18 | root <root>              | 2017-10-28 16:00 | I, U           |  287 E<    
17 | root <root>              | 2017-05-16 04:38 | Install        |    1 ><    
We are interested in transaction id number 18. This is the latest one which altered 287 packages. This is the transaction
id for our yum update command.
We view more information about this transaction by typing yum history info <id>
[root@linuxunix ~]# yum history info 18
Loaded plugins: fastestmirror, security
Transaction ID : 18
Step 3: Now, we will rollback this transaction via the yum history undo command.
[root@linuxunix ~]# yum history undo 18
Loaded plugins: fastestmirror, security
Once this completes we take a look at the /etc/grub.conf file.
[root@linuxunix ~]# grep -v ^# /etc/grub.conf
default=0
timeout=5
The entries for the new kernel have been removed.
But the entry in /etc/redhat-release file will not be updated automatically. We’ll need to do it manually.
Step 4: Once the rollback operation completes it’s highly recommended that you reboot the system. Now when we
reboot the system and interrupt the boot process we find that only the original kernel is now available to boot from.

Once the system boots, we can run the uname -a command to verify that the system is running on the old kernel.
[root@linuxunix ~]# uname -a
Linux linuxunix 2.6.32-642.el6.x86_64 #1 SMP Tue May 10 17:27:01 UTC 2016 x86_64 x86_64 x86_64
GNU/Linux
[root@linuxunix ~]# date
Sat Oct 28 17:46:26 IST 2017
Let’s run the ‘yum history’ command again to view information on our rollback task:
[root@linuxunix ~]# yum history
Loaded plugins: fastestmirror, security
ID     | Login user               | Date and time    | Action(s)      | Altered
-------------------------------------------------------------------------------
19 | root <root>              | 2017-10-28 16:43 | D, E           |   15 EE
18 | root <root>              | 2017-10-28 16:00 | I, U           |  287 E<
17 | root <root>              | 2017-05-16 04:38 | Install        |    1 ><

Linux File Systems: Ext2 vs Ext3 vs Ext4 vs Xfs


ext2, ext3 and ext4 are all filesystems created for Linux.

 High level difference between these filesystems.


 How to create these filesystems.
 How to convert from one filesystem type to another.

Ext2

 Ext2 stands for second extended file system.


 It was introduced in 1993. Developed by Rémy Card.
 This was developed to overcome the limitation of the original ext file system.
 Ext2 does not have journaling feature.
 On flash drives, usb drives, ext2 is recommended, as it doesn’t need to do the over head of
journaling.
 Maximum individual file size can be from 16 GB to 2 TB
 Overall ext2 file system size can be from 2 TB to 32 TB

How to create an ext2 filesystem


# mke2fs /dev/sda1

Ext3

 Ext3 stands for third extended file system.


 It was introduced in 2001. Developed by Stephen Tweedie.
 Starting from Linux Kernel 2.4.15 ext3 was available.
 The main benefit of ext3 is that it allows journaling.
 Journaling has a dedicated area in the file system, where all the changes are tracked. When the
system crashes, the possibility of file system corruption is less because of journaling.
 Maximum individual file size can be from 16 GB to 2 TB
 Overall ext3 file system size can be from 2 TB to 32 TB
 There are three types of journaling available in ext3 file system.
o Journal – Metadata and content are saved in the journal.
o Ordered – Only metadata is saved in the journal. Metadata are journaled only after writing the
content to disk. This is the default.
o Writeback – Only metadata is saved in the journal. Metadata might be journaled either before
or after the content is written to the disk.
 You can convert a ext2 file system to ext3 file system directly (without backup/restore).
How to create ext3 file system :-
# mkfs.ext3 /dev/sda1
(or)
# mke2fs –j /dev/sda1
( -j for adding journaling capability )
How to  convert  ext2 to ext3 :-
# umount /dev/sda2
# tune2fs -j /dev/sda2
# mount /dev/sda2  /var

Ext4

 Ext4 stands for fourth extended file


system.
 It was introduced in 2008.
 Starting from Linux Kernel 2.6.19 ext4
was available.
 Supports huge individual file size and
overall file system size.
 Maximum individual file size can be
from 16 GB to 16 TB
 Overall maximum ext4 file system size
is 1 EB (exabyte). 1 EB = 1024 PB (petabyte). 1 PB = 1024 TB (terabyte).
 Directory can contain a maximum of 64,000 subdirectories (as opposed to 32,000 in ext3)
 You can also mount an existing ext3 fs as ext4 fs (without having to upgrade it).
 Several other new features are introduced in ext4: multiblock allocation, delayed allocation, journal
checksum. fast fsck, etc. All you need to know is that these new features have improved the
performance and reliability of the filesystem when compared to ext3.
 In ext4, you also have the option of turning the journaling feature “off”.

Creating ext4 file system :-


# mkfs.ext4 /dev/sda1
(or)
# mke2fs -t ext4 /dev/sda1
Converting ext3 to ext4
( Warning :- Never try this live or production servers )
# umount /dev/sda2
# tune2fs -O extents,uninit_bg,dir_index  /dev/sda2
# e2fsck -pf /dev/sda2
# mount /dev/sda2 /var
Find your servers filesystem type
We can find the filesystem type used in our servers using any one of the following commands
# mount
/dev/sda3 on / type ext3 (rw)
proc on /proc type proc (rw)
/dev/sda1 on /boot type ext3 (rw)
tmpfs on /dev/shm type tmpfs (rw)
# file -sL /dev/sda1
/dev/sda1: Linux rev 1.0 ext3 filesystem data (needs journal recovery)
# df -T | awk ‘{print $1,$2,$7}’ | grep “^/dev”
/dev/sda3 ext3 /
/dev/sda1 ext3 /boot

XFS
The XFS file system is an extension of the extent file system .XFS is a high performance 64 bit journaling file system .Support of
XFS
was merged into the linux kernel in around 2002 and In 2009 Red Hat Enterprise Linux version 5.4 usage of XFS file system .
Now RHEL 7.0 uses XFS as the default file system .
XFS supports maximum file system size of 8 exbibytes for 64 bit file system .Some comparison of XFS file system is XFS file
system cannot be shrunk and poor performance with
deletions of large numbers of files.
32-bit system 64-bit system
File size: 16 Terabytes 16 Exabytes
File system: 16 Terabytes 18 Exabytes

Creating Xfs file system


#fdisk /dev/sdb <-create font="" partition="" the="">
#mkfs.xfs -f /dev/sdb1
#mount -t xfs /dev/sdb1 /storage
#df -Th /storage

You might also like