Thursday, February 2, 2012

Features Comparison: Ext3 vs Ext4



Here is the quick facts and comparison of Ext3 and Ext4 File systems:  Hope this helps..!




Features
Ext3
Ext4
Stands For
Ext3 stands for third extended file system.
Ext4 stands for fourth extended file system.
Introduced
It was introduced in 2001.
It was introduced in 2008.
Kernel Support
Supports from Linux Kernel 2.4.15
Supports from Linux Kernel 2.6.19
Maximum individual file size supported
Maximum individual file size can be from 16 GB to 2 TB
Maximum individual file size can be from 16 GB to 16 TB
Maximum file system size supported
Overall ext3 file system size can be from 2 TB to 32 TB
Overall maximum ext4 file system size is 1 EB (exabyte).
1 EB = 1024 PB (petabyte).
1 PB = 1024 TB (terabyte).
Maximum sub directories
Directory can contain a maximum of  32,000 subdirectories
Directory can contain a maximum of 64,000 subdirectories
Other Features
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.


There are three types of journaling available in ext3 file system.

Journal – Metadata and content are saved in the journal.

Ordered – Only metadata is saved in the journal. Metadata are journaled only after writing the content to disk. This is the default.

Writeback – Only metadata is saved in the journal. Metadata might be journaled either before or after the content is written to the disk.
In ext4, it supports journaling and also has the option of turning the journaling feature “off”.

Several other new features are introduced in ext4: multi block allocation, delayed allocation, Journal checksum, fast fsck and etc.

All you need to know is that these new features have improved the performance and reliability of the file system when compared to ext3.

Supports huge individual file size and overall file system size.

You convert ext2 to ext3 without having any data loss
You can also mount an existing ext3 fs as ext4 fs (without having to upgrade it).

Reset Failed Login Count in Linux


Depends on the PAM configuration on Linux server, the Pluggable Authentication Module (PAM)

To check the login attempts to see if it needs to be reset type faillog -u
root@testsrv:~ # faillog -u user1
Username Failures Maximum Latest
user1       15        0
Reset the counter with the -r flag:
root@testsrv:~ # /usr/bin/faillog -r user1
Username Failures Maximum Latest
user1        0        0
If you’re root but is not managing to become a user with su, you also need to reset the login counter:
root@testsrv~ # su – username
su: incorrect password
root@testsrv:~ # /sbin/pam_tally —-user user1 —-reset
User user1 (672) had 34
root@testsrv:~ # su – username
user1@testsrv:~ $

OCFS2 Cluster File System Setup Guide in Linux


What is OCFS2?
  • OCFS2 is a shared-disk cluster file system for Linux 
  • Capable of providing both high performance and high availability.  
  • Cluster-aware applications can make use of parallel I/O for higher performance with this FS 
  • OCFS2 is mostly used to host Oracle Real application clusters (RAC) database on Linux clusters. 

The below are the high level steps for creating ocfs2 filesystem on top of a multipath'd SAN LUN:

  1. Verify the nodes that will be part of your cluster.
  2. Make sure your LUNs on the SAN end are accessible on all the nodes of the cluster.
  3. If you need multipathing, configure multipath and the multipathing policy based on solution whatever you have.
  4. The following example configuration ( /etc/ocfs2/cluster.conf ) shows you a sample configuration of a 2 node cluster pool. 
  5. If you have heartbeat IP configured on these cluster nodes, use the heartbeat IP for ocfs2 cluster communication and specify the hostname without FQDN. 
  6. Copy the same file to all the hosts in the cluster. 

Sample Config file:
[root@rac-cluster ~]# cat /etc/ocfs2/cluster.conf
node:
        ip_port = 7777
        ip_address = 192.168.1.2
        number = 0
        name = rac-cluster
        cluster = ocfs2
node:
        ip_port = 7777
        ip_address = 192.168.1.3
        number = 1
        name = rac-cluster
        cluster = ocfs2
 
On each node check the status of OCFS2 cluster service and stop "o2cb" if the service is already running. 
# service o2cb status # service o2cb stop
On each node, load the OCFS2 module. 
# service o2cb load
Make the OCFS2 service online on all the nodes. 
# service o2cb online 
Now your OCFS2 cluster is ready.

Format the SAN lun device from any one of the cluster node. 
# mkfs.ocfs2 -b 4k -C 32k -L oraclerac /dev/emcpowera
Where,
-b : Block size
-C : Cluster size
-L : Label

Update /etc/fstab on all the nodes in the cluster with the mount point. 
/dev/emcpowera /u01 ocfs2 _netdev 0 0 
Mount the /u01 

Enable ocfs and o2b service on boot
# chkconfig --level 345 o2cb on# chkconfig --level 345 ocfs2 on 
The /u01 repository setup on a SAN Lun is done.

You can now configure Oracle RAC on this file System.

Resizing Online Multipath Disk in Linux

Here is the steps to Resize an Online Multipath Disk which is using Linux native device mapper as multipath solution.


1. Resize your physical disk in SAN. SAN Admins will do this. 
2. Use the following command to find the paths to the LUN:
# multipath -l
3. Now, Resize your paths. For SCSI devices, use the following command:
# echo 1 > /sys/block//device/rescan
4. Resize your multipath device by running the multipathd resize command:
# multipathd -k'resize map mpath0'
5. Resize the  File System (Assuming LVM is NOT used)
# resize2fs /dev/mapper/mpath0
If LVM is used, you need to do the following:
#pvscan
Check your Disk Changes detected under LVM:
#pvs or pvdisplay 
#vgscan
To check the VG Size is Increased:
#vgs or vgdisplay
Now Extend the LV: 
#lvextend -L +G
Finally Extend the File System
#resize2fs

Collecting Server Hardware Information in Linux


To Print Entire Hardware Information - dmidecode
To List PCI devices - lspci
To List USB devices - lsusb
To Find CPU Information - cat /proc/cpuinfo
To Find Memory/RAM in Information,
    1. cat /proc/meminfo
    2. free -m

To find Hard disk Information,
  • fdisk –l
  • df –h
  • vgdisplay
  • lvdisplay
To Know SWAP information,
   cat /proc/swaps
To detect Hardware Changes,
    service kudzu restart
To See Kernel Version, Architecture, OS Release Version, etc..
  • uname –a
  • cat /etc/redhat-release

HPASMCLI - Overview and Commands

hpasmcli stands for HP Server Management Application and Agents Command Line Interface

It comes with HP ProLiant Support Pack (PSP) and can be installed in HP ProLiant Servers to view, modify the BIOS / System settings such as  hyper-threading, boot sequence control, and UID LEDs, etc. It can also be used to display hardware status  of the HP ProLiant servers. 

It’s a scriptable command line interface for interacting with the hpasm management daemons.
hpasmcli is also usable for incorporating into shell scripts. Hpasmcli supports TAB completion of command names and has a history buffer that can be accessed using the up/down arrows. 
To get the basic information about server:

hpasmcli> show server
System        : ProLiant DL385 G1
Serial No.    : SGH532X0KK      
ROM version   : A05 06/14/2005
iLo present   : Yes
Embedded NICs : 2
NIC1 MAC: 00:14:38:4c:62:3e
NIC2 MAC: 00:14:38:4c:62:3d

Processor: 0
Name         : AMD Opteron
Stepping     : 2
Speed        : 2200 MHz
Bus          : 0 MHz
Socket       : 2
Level2 Cache : 1024 KBytes
Status       : Ok

Processor: 1
Name         : AMD Opteron
Stepping     : 2
Speed        : 2200 MHz
Bus          : 0 MHz
Socket       : 1
Level2 Cache : 1024 KBytes
Status       : Ok

Processor total  : 2

Memory installed : 1024 MBytes
ECC supported    : Yes

Verify the Automatic System Recovery values:
hpasmcli> show asr
ASR timeout is 10 minutes.
ASR is currently enabled.

To verify the boot order:

hpasmcli> show boot
First boot device is: CD-ROM.
One time boot device is: Not set.

To check the DIMM Information:

hpasmcli> show dimm
DIMM Configuration
------------------
Cartridge #:   0
Module #:      3
Present:       Yes
Form Factor:   9h
Memory Type:   12h
Size:          1024 MB
Speed:         400 MHz
Status:        Ok

Cartridge #:   0
Module #:      4
Present:       Yes
Form Factor:   9h
Memory Type:   12h
Size:          1024 MB
Speed:         400 MHz
Status:        Ok

To check the F1 Prompt:

hpasmcli> show f1
The POST F1 prompt is currently delayed.

To Verify the FANS:


hpasmcli> show fans
Fan  Location        Present Speed  of max  Redundant  Partner  Hot-pluggable
---  --------        ------- -----  ------  ---------  -------  -------------
#1   PROCESSOR_ZONE  Yes     NORMAL 18%     Yes        2        Yes           
#2   PROCESSOR_ZONE  Yes     NORMAL 18%     Yes        1        Yes           
#3   I/O_ZONE        Yes     NORMAL 18%     Yes        1        Yes           
#4   I/O_ZONE        Yes     NORMAL 18%     Yes        1        Yes           
#5   PROCESSOR_ZONE  Yes     NORMAL 18%     Yes        1        Yes           
#6   PROCESSOR_ZONE  Yes     NORMAL 18%     Yes        1        Yes           
#7   POWERSUPPLY_BAY Yes     NORMAL 18%     Yes        1        Yes           
#8   POWERSUPPLY_BAY Yes     NORMAL 18%     Yes        1        Yes           

To Verify the HT Status:

hpasmcli> show ht
Processor hyper-threading is currently disabled.

To view the IML Logs:

hpasmcli> show iml
The IML Log is empty.

hpasmcli> show ipl
IPL (Standard Boot Order)
-------------------------
#0 CDROM
#1 Floppy
#2 USBKEY
#3 HDD
#4 PXE

To check the Power Supply Status:

hpasmcli> show powersupply
Power supply #1
Present  : Yes
Redundant: No
Condition: Ok
Hotplug  : Supported

Power supply #2
Power Supply not present

To check the PXE status of the network cards:

hpasmcli> show pxe
PXE boot status (2 Embedded NICs):
NIC1: PXE enabled
NIC2: PXE disabled

To check the Serial Port status:

hpasmcli> show serial bios
BIOS console redirection port is currently set to COM1/9600.

hpasmcli> show serial bios
Embedded serial port A: COM1
Embedded serial port B: Disabled

hpasmcli> show serial virtual
The virtual serial port is currently COM2.

To check the temperature of the server:

hpasmcli> show temp
Sensor   Location              Temp       Threshold
------   --------              ----       ---------
#0        SYSTEM_BD             -          -       
#1        CPU#1                51C/123F   80C/176F 
#2        I/O_ZONE             52C/125F   62C/143F 
#3        CPU#2                46C/114F   80C/176F 
#4        PROCESSOR_ZONE       41C/105F   60C/140F 
#5        POWER_SUPPLY_BAY     41C/105F   51C/123F 

To check LED status:

hpasmcli> show uid
UID is currently off.

To check the Wake on LAN status:

hpasmcli> show wol
Wake-On-Lan is currently enabled.

To exit from hpasmcli:

hpasmcli> exit