Sunday, December 22, 2013

Mysql slow query logs : /var/log/mysql-slow.log

The slow query log consists of SQL statements that took more than long_query_time seconds to execute. The minimum and default values of long_query_time are 1 and 10, respectively.
The time to acquire the initial table locks is not counted as execution time. mysqld writes a statement to the slow query log after it has been executed and after all locks have been released, so log order might differ from execution order.
To enable the slow query log, start mysqld with the --log-slow-queries[=file_name] option.
If the slow query log file is enabled but no name is specified, the default name is host_name-slow.log and the server creates the file in the same directory where it creates the PID file. If a name is given, the server creates the file in the data directory unless an absolute path name is given to specify a different directory.

Warning: phpinfo() has been disabled for security reasons in

goto php.ini >> disable_functions

Monday, December 16, 2013

Server details script : Version information

#!/bin/bash
echo "==========================" >> serverdetails
ccpanel=`/usr/local/cpanel/cpanel -V`
echo "cPanel Version" ":" "$ccpanel" >> serverdetails
A1=`/usr/local/apache/bin/httpd -v | sed -n 1p | awk '{print $3}'`
echo "Apache Version"  ":" "$A1" >> serverdetails
P1=`php -v | sed -n 1p | awk '{print $2}'`
echo "PHP Version" ":" "$P1" >> serverdetails
C1=`csf -v | awk '{print $2}'`
echo "CSF Version"  ":"  "$C1" >> serverdetails
M1=`mysql -e status | grep 'Server version' | awk {'print $3'}`
echo "MySql Version" ":" "$M1" >> serverdetails
K1=`uname -a | awk {'print $3'}`
echo "Kernel Version"  ":" "$K1"  >> serverdetails
A2=`cat /usr/local/apache/conf/httpd.conf | grep "ServerSignature"`
echo "Apache Server Signature" ":" "$A2" >> serverdetails
W1=`stat /usr/bin/wget | grep "Access" | sed -n 1p | awk {'print $2'}`
echo " Wget" ":" "$W1">> serverdetails
F1=`stat /usr/bin/find | grep "Access" | sed -n 1p | awk {'print $2'}`
echo " Find"  ":" "$F1" >> serverdetails
L1=`stat /usr/bin/locate | grep "Access" | sed -n 1p | awk {'print $2'}`
echo " Locate" ":" "$L1" >> serverdetails
L2=`stat /bin/link | grep "Access" | sed -n 1p | awk {'print $2'}`
echo " Link" ":"  "$L2" >> serverdetails
L3=`stat /usr/bin/lynx | grep "Access" | sed -n 1p | awk {'print $2'}`
echo " Lynx" ":" "$L3" >> serverdetails
R1=`cat /var/cpanel/cpanel.config | grep alwaysredirecttossl`
echo "$R1" >> serverdetails
A3=`cat /var/cpanel/cpanel.config | grep allow_login_autocomplete`
echo "$A3"  >> serverdetails
S1=`cat /var/cpanel/cpanel.config | grep create_account_spf=0`
echo "$S1"  >> serverdetails
M3=`cat /var/cpanel/cpanel.config | grep  defaultmailaction=fail`
echo "$M3" >> serverdetails

Saturday, October 19, 2013

Apache Handlers, running html as php

To get regular html pages to handle php code, you need to add this line to your htaccess file.

AddHandler application/x-httpd-php5 .html .htm

Thursday, September 26, 2013

Spamming : A very useful SHELL SCRIPT to find spamming on the server. Borrowed from a friend ;)

I found this script more useful and time saving than "View Mail Statistics Summary" option in WHM.
==========================
Commands:
vi mailscript.sh
chmod 755 mailscript.sh
./mailscript.sh

==========================

Code : mailscript.sh

Note: You need to change word "username" with any existing username on server ;)


#!/bin/bash
echo > /home/username/temp_eximlog
a=`date --date="5 hours ago" +%Y-%m-%d\ %H`
b=`date +%Y-%m-%d\ %H`
awk -v s="$a" -v e="$b" '$0~s,$0~e' /var/log/exim_mainlog >> /home/username/temp_eximlog
echo > /home/username/mailqueue
echo "Top local senders by message count"  >> /home/username/mailqueue
echo "=============================" >> /home/username/mailqueue
eximstats /home/username/temp_eximlog | grep -A7 "Top 50 local senders by message count" | tail -5 | awk '{print $1,$NF}'  >> /home/username/mailqueue
echo "=============================" >> /home/username/mailqueue
echo "Top Local recipients" >> /home/username/mailqueue
echo "=============================" >> /home/username/mailqueue
eximstats /home/username/temp_eximlog | grep -A7 "Top 50 local destinations by message count" | tail -5 | awk '{print $1,$NF}'  >> /home/username/mailqueue
echo "=============================" >> /home/username/mailqueue
echo "No of emails sent by authenticated user" >> /home/username/mailqueue
echo "=============================" >> /home/username/mailqueue
cat /home/username/temp_eximlog | grep dovecot | awk {'print $9'}| cut -d: -f2|sort|uniq -c|sort -n >> /home/username/mailqueue
echo "=============================" >> /home/username/mailqueue
echo "No of emails sent through script" >> /home/username/mailqueue
echo "=============================" >> /home/username/mailqueue
grep "cwd=" /home/username/temp_eximlog|awk '{for(i=1;i<=10;i++){print $i}}'|sort|uniq -c|grep cwd|sort -n >> /home/username/mailqueue
echo "=============================" >> /home/username/mailqueue
echo "Number of hits from an IP" >> /home/username/mailqueue
echo "=============================" >> /home/username/mailqueue
tail -n1000 /home/username/temp_eximlog |grep SMTP|cut -d[ -f2|cut -d] -f1|sort -n |uniq -c >> /home/username/mailqueue
echo "=============================" >> /home/username/mailqueue
echo "IP and no of tries done the IP to send mail but rejected by the server"  >> /home/username/mailqueue
tail -3000 /home/username/temp_eximlog |grep 'rejected RCPT' |awk '{print$4}'|awk -F\[ '{print $2} '|awk -F\] '{print $1} '|sort | uniq -c | sort -k 1 -nr | head -n 5 >> /home/username/mailqueue
echo "=============================" >> /home/username/mailqueue
echo "Connections from a certain ip to the   SMTP server" >> /home/username/mailqueue
netstat -plan|grep :25|awk {'print $5'}|cut -d: -f 1|sort|uniq -c|sort -nk 1 >> /home/username/mailqueue
echo "=============================" >> /home/username/mailqueue
cat mailqueue | mail -s "Mail Stats" uday.gade@yahoo.com


Monday, September 16, 2013

mysqladmin commands

mysqladmin pr |grep -v Sleep To show only sleep processes
mysql> SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST ORDER BY TIME DESC; To show processes in ascending order.
=============================
mysqladmin flush-hosts Flush all cached hosts
mysqladmin status Gives a short status message from the server
mysqladmin processlist Show list of active threads in server

Mysql command to show processes in ascending order

SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST ORDER BY TIME DESC;

Sunday, September 15, 2013

Apache Restarted Issue: Due to Semaphores

Check semaphores list:
ipcs -s

Remove them using following command:

ipcs -s | grep nobody | awk . { print $2 } . | xargs ipcrm sem

Syntax:
ipcs -s | grep process-owner | awk . { print $2 } . | xargs ipcrm sem

Thursday, September 5, 2013

Mysql : Too many connections error

mysqladmin flush-hosts

Run this command to remove current mysql connections

Email login failure log filename

/usr/local/cpanel/logs/login_log

CPANEL EMAIL CREATION LOGS
/usr/local/cpanel/logs/access_log

(look for addpop and delpop and editquota words)

LFD log file path

/var/log/lfd.log

Tuesday, September 3, 2013

How to check linux cpanel server is physical or virtual

[~]# grep -H '' /var/cpanel/envtype
/var/cpanel/envtype:standard
-- This means this server is physical

Monday, September 2, 2013

Roundcube error for only one email ID

DATABASE ERROR: CONNECTION FAILED!
Unable to connect to the database!
Please contact your server-administrator.

Resolution :
fixed issue.

/home/username/etc/domain.com
total 888
drwxr-x--- 3 username mail 4096 Aug 6 02:54 ./
drwxr-x--- 5 username mail 4096 Jul 24 00:16 ../
rw------ 1 username username 39936 Aug 6 02:54 admin.rcube.db

Deleted this file admin.rcube.db
It then got recreated.

Some songs URLs

Some good songs
http://udaygade.wordpress.com/some-good-songs/

http://www.sysnet.ucsd.edu/~voelker/tmp/good-bad-ugly.mp3

http://www.sysnet.ucsd.edu/~voelker/tmp/

http://mp3lover.eu/sha/shaggy-sexy-lady-songs-pk-mp3
197 kbps
4.68 MB
Shaggy - Hey Sexy Lady.mp3

bees saal baad 1088 mere saamne tu sada
http://new.downloadming1.com/audio%20songs/bollywood%20mp3/Bees%20Saal%20Baad%20(1988)/03%20Mere%20Saaamne%20Tu%20Din%20Raat%20Rahe%20-%20%20Mohd%20Aziz,%20Sarika%20Kapoor%20-%20www.downloadming.com.mp3


http://www.saavn.com/s/#!/search/hindi/tu+iss+tarah

http://www.youtube.com/watch?v=5erZ_LXw5HE

tu mere saath saath

aaj kahin na ja

tere liye

dus kahaaniya

kaali kaali aankhon ka jaadu- ek thi daayan

katra katra ijajat

raat shabnami

main naraye mastana

http://mp3skull.com/mp3/majhiya_priyala_preet_kalena.html


ye jivlaga
http://mp3skull.com/mp3/ye_jivlaga.html

oru varth oru sollu
http://www.youtube.com/watch?v=fXDpNYxw9x4

tujhe yaad na meri aayi

sambhala hai maine

aye meri zindagi -- Saaya
http://www.saavn.com/s/#!/search/hindi/saaya

http://mp3skull.com/mp3/robby_feel.html

PHP relocation error 500 Internal server error

Solution : Run easyapache to rebuild php on server.

Horde Login Issue

Error:
PHP Warning: Unknown: open(/var/cpanel/userhomes/cpanelhorde/sessions/sess_6f4fe8e66b99d89b239eb0839e3393a7, O_RDWR) failed: Permission denied (13) in Unknown on line 0
PHP Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/var/cpanel/userhomes/cpanelhorde/sessions) in Unknown on line 0

Steps used to solve the error:

tail -f /usr/local/cpanel/logs/error_log
cd /var/cpanel/userhomes/cpanelhorde/sessions/
ls -la
cd ..
cd ..
ls -la
cd cpanelhorde/
ls -la
chown cpanelhorde.cpanelhorde * -R
tail -f /usr/local/cpanel/logs/error_log

My other blog

Wednesday, August 21, 2013

Plesk life cycle

RHCE Dump

Cpanel

Wildcard SSL

Zend Forums • View topic - Guard Loader vs. Zend Optimizer

http://forums.zend.com/viewtopic.php?f=57&t=20753

Adding HDD on PC

http://www.wikihow.com/Add-an-Extra-Hard-Drive-to-Your-Computer

Nginx

http://www.unixmen.com/install-nginx-with-php-and-mysql-in-centos-6-4-rhel-6-4/
http://www.cyberciti.biz/faq/rhel-fedora-install-configure-nginx-php5/
http://www.cyberciti.biz/faq/install-nginx-centos-rhel-6-server-rpm-using-yum-command/

CPANEL EMAIL CREATION Deletion LOGS

http://admin.webhostingdevelopment.com/viewtopic.php?f=96&t=86

scp command syntax

http://www.hypexr.org/linux_scp_help.php

RHCE preassessment test

www.mhprofessional.com/downloads/products/0071765654/0071765654_preassess.pdf

RHCE-6-Syllabus

http://www.ipsr.org/downloads/RHCE-6-Syllabus-SA-I.pdf

RHCE 5 Dumps

http://xa.yimg.com/kq/groups/17245782/1227992336/name/RHCE%20Dumps.pdf

Comandline and VI shortcuts

How to Find out if a Linux machine is Virtual or Physical (remotely)

Few linux admin questions

FTP access log syntax

Training Docs - Part II



Notes taken in live session :
·         Thegeekstuff.com
·         Boot process : power on – BIOS –Post-MBR-GRUB-init-runlevel
·         Oracle VM – VirtualBox Manager
·         RPM
·         File system and file structure
·         LILO /boot/lilo/lilo.conf or /etc/lilo.conf
·         Linux flavours
·         Types of architecture : 86, X86, etc.
·         Runlevels :
0.       Halt – to shutdown
1.       Single usesr = for system administration purpose
2.       Multiuser without NFS
3.       Multiuser with NFS
4.       User-defined
5.       X11 – GUI
6.       Reboot
Examples, User-defined runlevels : LIC and Railway information terminals
Command to check runlevel :  runlevel
·         whoami – to see your login username
·         arch – to check architecture
·         cat /etc/redhat-release – to see OS version in centos/fedora
debian – cat /etc/lsb-release
ubuntu—cat /etc/lsb-release
·         mount – to see file version
·         /etc/SUSE-release – for SUSE release
·         linux is case sensitive and windows is not.
·         /etc/inittab
id:3:initdefault
·         Windows swap memory is called as virtual memory
·         Swap partition is the portion of the hard drive that linux uses as virtual memory.
It should be double the size of RAM.
free –m
·         Psuedo file system
·         CentOS Community Enterprise OS
·         OS installation :
1.       Install or upgrade
2.       media test
3.       language – US-EN
4.       types of devices
5.       configure network : Hostname
6.       time zone
7.       root password
8.       type of installation  : create custom layout
9.       select a device :  click create button
device - size(Mb) - mountpont/rain/volume – type – front
10.   Install boot loader
11.   ………………Select Basic server
·         Assigning Server IP :
cat /etc/sysconfig/network-scripts/ifcfg-eth0
IPADDR =
NETMASK =
you can define gateway in this file, but standard location is as below
/etc/sysconfig/network --- to define network gateway and hostname
HOSTNAME =
GATEWAY =

/etc/resolve.conf  --- to assign nameservers
nameserver = 8.8.8.8
nameserver = 4.2.2.2

service network restart

setup ---- command to set network, etc.

setup >> network configuration >> device configuration >> eth0
·         HARD DISK STRUCTURE :
4(four) hard drives can be connected to a system
1.       Primary Master – sda
2.       Primary Slave – sdb
3.       Secondary Master – sdc
4.       Secondary slave – sdd
·         fdisk –l
·         difference between sda and had :
sda ----- SCSI and SATA
sda ------IDE

SCSI – small computer system Interface
SATA ---
IDE --- integrated development environment
·         Steps to attach secondary hard disk :
1.       DC will add hard disk
2.       fdisk –l  ------command to see how many harddisks are attached
3.       fdisk /dev/sdb ======== to identify HDD
n
p
1
enter
enter
w
4.       fdisk –l           It should show /dev/sdb1
5.       mkfs .ext4 /dev/sdb1 --------------to format HDD (make file system)
6.       mount /dev/sdb1 /mnt  (temporary mounting)
7.       umount /mnt (to unmount)
8.       another example, mkdir backup         and       then  mount /dev/sdb1 /backup
·         To devide a new hard disk in two parts :
fdisk –l
fdisk /dev/sdb
n
p
2
enter
enter
w
fdisk –l
.
.
.
.
·         To make permanent mounting :
vi /etc/mtab
vi /etc/fstab
mount command shows information as per mtab
·         fstab
·         How to change hostname ?
hostname abc.xyz.com
to make permanent hostname change, edit
/etc/sysconfig/network
and
add entry in
vi /etc/hosts

entry to be added :  117.239.185.135 abc.xyz.com

hostname –i
·         Cpanel installation :
on debian OS it is not possible

cpanel runs on following OS only
centos 4,5,6
redhat 4,5,6
free bsd 7.3 7.4 8.0 8.1 8.2
cloudlinux 5 6

generally speaking 50gb hdd and 2gb RAM is good for cpanel.
·         cat proc/cpuinfo |grep processor
·         cat /proc/meminfo
·         cd /home
wget –N …………………….latest
sh latest
·         server password and cpanel/whm password will always be same and cannot be different.


·         HOMEWORK
fstab
Pseudo file system
CentOS Community Enterprise OS

·         /etc/fstab

fstab is a configuration file that contains information of all the partitions and storage devices in your computer.
The fstab (/etc/fstab) (or file systems table) file is a system configuration file commonly found on Unix systems. It is part of the util-linux package. The fstab file typically lists all available disks and disk partitions, and indicates how they are to be initialized or otherwise integrated into the overall system's file system. fstab is still used for basic system configuration, notably of a system's main hard drive and startup file system, but for other uses has been superseded in recent years by automatic mounting.
The fstab file is most commonly used by the mount command, which reads the fstab file to determine which options should be used when mounting the specified device. It is the duty of the system administrator to properly create and maintain this file.
# device name --  mount point --    fs-type      -- options --  dump-freq -- pass-num
LABEL=/         /               ext4         defaults                                            1 1
/dev/sda6       swap            swap         defaults                                            0 0
none            /dev/pts        devpts       gid=5,mode=620                                      0 0
none            /proc           proc         defaults                                            0 0
none            /dev/shm        tmpfs        defaults                                            0 0

The columns are as follows:
  1. The device name or other means of locating the partition or data source.
  2. The mount point, where the data is to be attached to the filesystem.
  3. The filesystem type, or the algorithm used to interpret the filesystem.
  4. Options, including if the filesystem should be mounted at boot.
  5. dump-freq adjusts the archiving schedule for the partition (used by dump).
  6. pass-num Controls the order in which fsck checks the device/partition for errors at boot time. The root device should be 1. Other partitions should be either 2 (to check after root) or 0 (to disable checking for that partition altogether).
defaults Uses the default options that are rw, suid, dev, exec, auto, nouser, and async.
A value of zero in either of the last 2 columns disables the corresponding feature. For the whitespace character in paths the character code "\040" is used.
Refer : http://www.tuxfiles.org/linuxhelp/fstab.html
Pseudo file system


The /proc directory on GNU/Linux systems provides a file-system like interface to the kernel. This allows applications and users to fetch information from and set values in the kernel using normal file-system I/O operation.
The proc file system is sometimes referred to as a process information pseudo-file system. It does not contain ``real'' files but rather runtime system information (e.g. system memory, devices mounted, hardware configuration, etc). For this reason it can be regarded as a control and information center for the kernel. In fact, quite a lot of system utilities are simply calls to files in this directory. For example, the command lsmod, which lists the modules loaded by the kernel, is basically the same as 'cat /proc/modules' while lspci, which lists devices connected to the PCI bus of the system, is the same as 'cat /proc/pci'. By altering files located in this directory you can change kernel parameters while the system is running.
CentOS Community Enterprise OS
free, open source
uses code of Redhat
community support

Training docs - part I


Linux filesystem structures and understand the meaning of individual high-level directories.

http://static.thegeekstuff.com/wp-content/uploads/2010/11/filesystem-structure.png
1. / – Root
§  Every single file and directory starts from the root directory.
§  Only root user has write privilege under this directory.
§  Please note that /root is root user’s home directory, which is not same as /.
2. /bin – User Binaries
§  Contains binary executables.
§  Common linux commands you need to use in single-user modes are located under this directory.
§  Commands used by all the users of the system are located here.
§  For example: ps, ls, ping, grep, cp.
3. /sbin – System Binaries
§  Just like /bin, /sbin also contains binary executables.
§  But, the linux commands located under this directory are used typically by system aministrator, for system maintenance purpose.
§  For example: iptables, reboot, fdisk, ifconfig, swapon
4. /etc – Configuration Files
§  Contains configuration files required by all programs.
§  This also contains startup and shutdown shell scripts used to start/stop individual programs.
§  For example: /etc/resolv.conf, /etc/logrotate.conf
5. /dev – Device Files
§  Contains device files.
§  These include terminal devices, usb, or any device attached to the system.
§  For example: /dev/tty1, /dev/usbmon0
6. /proc – Process Information
§  Contains information about system process.
§  This is a pseudo filesystem contains information about running process. For example: /proc/{pid} directory contains information about the process with that particular pid.
§  This is a virtual filesystem with text information about system resources. For example: /proc/uptime
7. /var – Variable Files
§  var stands for variable files.
§  Content of the files that are expected to grow can be found under this directory.
§  This includes — system log files (/var/log); packages and database files (/var/lib); emails (/var/mail); print queues (/var/spool); lock files (/var/lock); temp files needed across reboots (/var/tmp);
8. /tmp – Temporary Files
§  Directory that contains temporary files created by system and users.
§  Files under this directory are deleted when system is rebooted.
9. /usr – User Programs
§  Contains binaries, libraries, documentation, and source-code for second level programs.
§  /usr/bin contains binary files for user programs. If you can’t find a user binary under /bin, look under /usr/bin. For example: at, awk, cc, less, scp
§  /usr/sbin contains binary files for system administrators. If you can’t find a system binary under /sbin, look under /usr/sbin. For example: atd, cron, sshd, useradd, userdel
§  /usr/lib contains libraries for /usr/bin and /usr/sbin
§  /usr/local contains users programs that you install from source. For example, when you install apache from source, it goes under /usr/local/apache2
10. /home – Home Directories
§  Home directories for all users to store their personal files.
§  For example: /home/john, /home/nikita
11. /boot – Boot Loader Files
§  Contains boot loader related files.
§  Kernel initrd, vmlinux, grub files are located under /boot
§  For example: initrd.img-2.6.32-24-generic, vmlinuz-2.6.32-24-generic
12. /lib – System Libraries
§  Contains library files that supports the binaries located under /bin and /sbin
§  Library filenames are either ld* or lib*.so.*
§  For example: ld-2.11.1.so, libncurses.so.5.7
13. /opt – Optional add-on Applications
§  opt stands for optional.
§  Contains add-on applications from individual vendors.
§  add-on applications should be installed under either /opt/ or /opt/ sub-directory.
14. /mnt – Mount Directory
§  Temporary mount directory where sysadmins can mount filesystems.
15. /media – Removable Media Devices
§  Temporary mount directory for removable devices.
§  For examples, /media/cdrom for CD-ROM; /media/floppy for floppy drives; /media/cdrecorder for CD writer
16. /srv – Service Data
§  srv stands for service.
§  Contains server specific services related data.
§  For example, /srv/cvs contains CVS related data.





#############################################




Linux supports numerous file system types
§  Ext2: It has the concepts of blocks, inodes and directories.

§  Ext3: It is ext2 filesystem enhanced with journalling capabilities. Journalling allows fast file system recovery.

§  Isofs (iso9660): Used by CDROM file system.

§  Sysfs: It is a ram-based filesystem initially based on ramfs. It is use to exporting kernel objects so that end user can use it easily.

§  Procfs: The proc file system acts as an interface to internal data structures in the kernel. It can be used to obtain information about the system and to change certain kernel parameters at runtime using sysctl command.


ext2, ext3 and ext4 are all filesystems created for Linux. This article explains the following:
§  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
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.
§  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.
§  You can convert a ext2 file system to ext3 file system directly (without backup/restore).
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”.
Use the method we discussed earlier to identify whether you have ext2 or ext3 or ext4 file system.



#######################################################



/etc/shadow file stores actual password in encrypted format for user's account with additional properties related to user password i.e. it stores secure user account information. All fields are separated by a colon (:) symbol. It contains one entry per line for each user listed in /etc/passwd file Generally, shadow file entry looks as follows (click to enlarge image):
/etc/shadow file fields

(Fig.01: /etc/shadow file fields)
1.  User name : It is your login name
2.  Password: It your encrypted password. The password should be minimum 6-8 characters long including special characters/digits
3.  Last password change (lastchanged): Days since Jan 1, 1970 that password was last changed
4.  Minimum: The minimum number of days required between password changes i.e. the number of days left before the user is allowed to change his/her password
5.  Maximum: The maximum number of days the password is valid (after that user is forced to change his/her password)
6.  Warn : The number of days before password is to expire that user is warned that his/her password must be changed
7.  Inactive : The number of days after password expires that account is disabled
8.  Expire : days since Jan 1, 1970 that account is disabled i.e. an absolute date specifying when the login may no longer be used
The last 6 fields provides password aging and account lockout features (you need to use chage command to setup password aging). According to man page of shadow - the password field must be filled. The encrypted password consists of 13 to 24 characters from the 64 character alphabet a through z, A through Z, 0 through 9, \. and /. Optionally it can start with a "$" character. This means the encrypted password was generated using another (not DES) algorithm. For example if it starts with "$1$" it means the MD5-based algorithm was used





A. /etc/passwd file stores essential information, which is required during login i.e. user account information.
/etc/passwd is a text file, that contains a list of the system's accounts, giving for each account some useful information like user ID, group ID, home directory, shell, etc. It should have general read permission as many utilities, like ls use it to map user IDs to user names, but write access only for the superuser (root).
Understanding fields in /etc/passwd
The /etc/passwd contains one entry per line for each user (or user account) of the system. All fields are separated by a colon (:) symbol. Total seven fields as follows.
Generally, passwd file entry looks as follows (click to enlarge image):
1.  Username: It is used when user logs in. It should be between 1 and 32 characters in length.
2.  Password: An x character indicates that encrypted password is stored in /etc/shadow file.
3.  User ID (UID): Each user must be assigned a user ID (UID). UID 0 (zero) is reserved for root and UIDs 1-99 are reserved for other predefined accounts. Further UID 100-999 are reserved by system for administrative and system accounts/groups.
4.  Group ID (GID): The primary group ID (stored in /etc/group file)
5.  User ID Info: The comment field. It allow you to add extra information about the users such as user's full name, phone number etc. This field use by finger command.
6.  Home directory: The absolute path to the directory the user will be in when they log in. If this directory does not exists then users directory becomes /
7.  Command/shell: The absolute path of a command or shell (/bin/bash). Typically, this is a shell. Please note that it does not have to be a shell.