Friday 2 November 2012

Difference between Soft Mount & Hard Mount


The directory /nfs   should be created in your node/server. The nfs mount can be mount as a “soft mount” or as a “hard mount” these mount option define the how the nfs client should be handle nfs crash/failure. We will see the difference between hard mount and soft mount.

Soft mount:- suppose you have mount the nfs by using “soft mount’ when a program request a file from nfs server. Nfs demon will try to retrieve the data from the nfs server. If doesn’t get any response from nfs server due to some failure or crash on nfs server. Then nfs client report an error to the process on the client machine requesting the file access the Advantage “fast responsiveness”   it doesn’t wait to the nfs server to respond. The Main Disadvantage of this method is data corruption or loss of data so this is not the recommended option to use.

 [root@sadeek ~]# showmount -e 172.28.50.109
Export list for 192.168.0.105:
/nfs *
Soft mounting (Temporary Mounting):-
[root@sadeek ~]# mount   172.28.50.109:/nfs/  /mnt/


Hard mounting:-if you have mounted the nfs by “hard mount”.  It will repeatly try to connect to the server. Once the server is back online the program will continue to execute undisturbed the state where it was during the crash. We can use the mount option “intr’ which allows nfs request to interrupt if the server goes down or cannot be access able.


Hard Mount (Permanent mounting):-
[root@sadeek~]# mount  -o rw,hard,intr  172.28.50.109/nfs  /mnt
[root@sadeek ~]# vim  /etc/fstab
172.28.50.109:/nfs       /mnt                         nfs    Defaults    0 0
:wq!
We can check nfs share  with the help of below mention command.
[root@sushee ~]# mount –a

Wednesday 31 October 2012

Monday 6 August 2012

Linux System Monitoring Tools

Need to monitor Linux server performance? Try these built-in command and a few add-on tools. Most Linux distributions are equipped with tons of monitoring. These tools provide metrics which can be used to get information about system activities. You can use these tools to find the possible causes of a performance problem. The commands discussed below are some of the most basic commands when it comes to system analysis and debugging server issues such as:
  1. Finding out bottlenecks.
  2. Disk (storage) bottlenecks.
  3. CPU and memory bottlenecks.
  4. Network bottlenecks

1: top - Process Activity Command

The top program provides a dynamic real-time view of a running system i.e. actual process activity. By default, it displays the most CPU-intensive tasks running on the server and updates the list every five seconds
.
Fig.01: Linux top command

Commonly Used Hot Keys

The top command provides several useful hot keys:
Hot KeyUsage
tDisplays summary information off and on.
mDisplays memory information off and on.
ASorts the display by top consumers of various system resources. Useful for quick identification of performance-hungry tasks on a system.
fEnters an interactive configuration screen for top. Helpful for setting up top for a specific task.
oEnables you to interactively select the ordering within top.
rIssues renice command.
kIssues kill command.
zTurn on or off color/mono

2: vmstat - System Activity, Hardware and System Information

The command vmstat reports information about processes, memory, paging, block IO, traps, and cpu activity.
# vmstat 3

Sample Outputs:
procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu------
 r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st
 0  0      0 2540988 522188 5130400    0    0     2    32    4    2  4  1 96  0  0
 1  0      0 2540988 522188 5130400    0    0     0   720 1199  665  1  0 99  0  0
 0  0      0 2540956 522188 5130400    0    0     0     0 1151 1569  4  1 95  0  0
 0  0      0 2540956 522188 5130500    0    0     0     6 1117  439  1  0 99  0  0
 0  0      0 2540940 522188 5130512    0    0     0   536 1189  932  1  0 98  0  0
 0  0      0 2538444 522188 5130588    0    0     0     0 1187 1417  4  1 96  0  0
 0  0      0 2490060 522188 5130640    0    0     0    18 1253 1123  5  1 94  0  0

Display Memory Utilization Slabinfo

# vmstat -m


Get Information About Active / Inactive Memory Pages

# vmstat -a


3: w - Find Out Who Is Logged on And What They Are Doing
w command displays information about the users currently on the machine, and their processes.
# w username
# w vivek

Sample Outputs:

 17:58:47 up 5 days, 20:28,  2 users,  load average: 0.36, 0.26, 0.24
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU WHAT
root     pts/0    10.1.3.145       14:55    5.00s  0.04s  0.02s vim /etc/resolv.conf
root     pts/1    10.1.3.145       17:43    0.00s  0.03s  0.00s w

4: uptime - Tell How Long The System Has Been Running

The uptime command can be used to see how long the server has been running. The current time, how long the system has been running, how many users are currently logged on, and the system load averages for the past 1, 5, and 15 minutes.
# uptime
Output:

 18:02:41 up 41 days, 23:42,  1 user,  load average: 0.00, 0.00, 0.00
1 can be considered as optimal load value. The load can change from system to system. For a single CPU system 1 - 3 and SMP systems 6-10 load value might be acceptable.

5: ps - Displays The Processes

ps command will report a snapshot of the current processes. To select all processes use the -A or -e option:
# ps -A
Sample Outputs:

  PID TTY          TIME CMD
    1 ?        00:00:02 init
    2 ?        00:00:02 migration/0
    3 ?        00:00:01 ksoftirqd/0
    4 ?        00:00:00 watchdog/0
    5 ?        00:00:00 migration/1
    6 ?        00:00:15 ksoftirqd/1

To See Threads After Processes

# ps -AlLm

Print All Process On The Server

# ps ax
# ps axu

Print A Process Tree

# ps -ejH
# ps axjf
# pstree

See Every Process Running As User Vivek

# ps -U sadeek -u sadeek u

Display Only The Process IDs of Lighttpd

# ps -C lighttpd -o pid=
OR
# pgrep lighttpd
OR
# pgrep -u sadeek php-cgi

Display The Name of PID 55977

# ps -p 55977 -o comm=

Find Out The Top 10 Memory Consuming Process

# ps -auxf | sort -nr -k 4 | head -10

Find Out top 10 CPU Consuming Process

# ps -auxf | sort -nr -k 3 | head -10

6: free - Memory Usage

The command free displays the total amount of free and used physical and swap memory in the system, as well as the buffers used by the kernel.
# free Sample Output:

            total       used       free     shared    buffers     cached
Mem:      12302896    9739664    2563232          0     523124    5154740
-/+ buffers/cache:    4061800    8241096
Swap:      1052248          0    1052248

7: iostat - Average CPU Load, Disk Activity

The command iostat report Central Processing Unit (CPU) statistics and input/output statistics for devices, partitions and network filesystems (NFS).
# iostat Sample Outputs:

Linux 2.6.18-128.1.14.el5 (www03.nixcraft.in)  06/26/2009
avg-cpu:  %user   %nice %system %iowait  %steal   %idle
           3.50    0.09    0.51    0.03    0.00   95.86
Device:            tps   Blk_read/s   Blk_wrtn/s   Blk_read   Blk_wrtn
sda              22.04        31.88       512.03   16193351  260102868
sda1              0.00         0.00         0.00       2166        180
sda2             22.04        31.87       512.03   16189010  260102688
sda3              0.00         0.00         0.00       1615      
  

8: sar - Collect and Report System Activity

The sar command is used to collect, report, and save system activity information. To see network counter, enter:

# sar -n DEV | more
To display the network counters from the 24th:

# sar -n DEV -f /var/log/sa/sa24 | more
You can also display real time usage using sar:

# sar 4 5
Sample Outputs:

 
Linux 2.6.18-128.1.14.el5 ) 06/26/2009 06:45:12 PM
 CPU %user %nice %system %iowait %steal %idle
06:45:16 PM all 2.00 0.00 0.22 0.00 0.00 97.78
06:45:20 PM all 2.07 0.00 0.38 0.03 0.00 97.52
06:45:24 PM all 0.94 0.00 0.28 0.00 0.00 98.78
06:45:28 PM all 1.56 0.00 0.22 0.00 0.00 98.22
06:45:32 PM all 3.53 0.00 0.25 0.03 0.00 96.19
Average: all 2.02 0.00 0.27 0.01 0.00 97.70

9: mpstat - Multiprocessor Usage

The mpstat command displays activities for each available processor, processor 0 being the first one. mpstat -P ALL to display average CPU utilization per processor:


# mpstat -P ALL


Sample Output:

Linux 2.6.18-128.1.14.el5 (www03.nixcraft.in)   06/26/2009
06:48:11 PM  CPU   %user   %nice    %sys %iowait    %irq   %soft  %steal   %idle    intr/s
06:48:11 PM  all    3.50    0.09    0.34    0.03    0.01    0.17    0.00   95.86   1218.04
06:48:11 PM    0    3.44    0.08    0.31    0.02    0.00    0.12    0.00   96.04   1000.31
06:48:11 PM    1    3.10    0.08    0.32    0.09    0.02    0.11    0.00   96.28     34.93
06:48:11 PM    2    4.16    0.11    0.36    0.02    0.00    0.11    0.00   95.25      0.00
06:48:11 PM    3    3.77    0.11    0.38    0.03    0.01    0.24    0.00   95.46     44.80
06:48:11 PM    4    2.96    0.07    0.29    0.04    0.02    0.10    0.00   96.52     25.91
06:48:11 PM    5    3.26    0.08    0.28    0.03    0.01    0.10    0.00   96.23     14.98
06:48:11 PM    6    4.00    0.10    0.34    0.01    0.00    0.13    0.00   95.42      3.75
06:48:11 PM    7    3.30    0.11    0.39    0.03    0.01    0.46    0.00   95.69 


 10: iptraf - Real-time Network Statistics

The iptraf command is interactive colorful IP LAN monitor. It is an ncurses-based IP LAN monitor that generates various network statistics including TCP info, UDP counts, ICMP and OSPF information, Ethernet load info, node stats, IP checksum errors, and others. It can provide the following info in easy to read format:
  • Network traffic statistics by TCP connection
  • IP traffic statistics by network interface
  • Network traffic statistics by protocol
  • Network traffic statistics by TCP/UDP port and by packet size
  • Network traffic statistics by Layer2 address


Fig.02: General interface statistics: IP traffic statistics by network interface
 General interface statistics: IP traffic statistics by network interface
Fig.03 Network traffic statistics by TCP connection

11: tcpdump - Detailed Network Traffic Analysis

The tcpdump is simple command that dump traffic on a network. However, you need good understanding of TCP/IP protocol to utilize this tool. For.e.g to display traffic info about DNS, enter:

# tcpdump -i eth1 'udp port 53'


To display all IPv4 HTTP packets to and from port 80, i.e. print only packets that contain data, not, for example, SYN and FIN packets and ACK-only packets, enter:


# tcpdump 'tcp port 80 and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)'
To display all FTP session to 202.54.1.5, enter:


# tcpdump -i eth1 'dst 202.54.1.5 and (port 21 or 20'
To display all HTTP session to 192.168.1.5:


# tcpdump -ni eth0 'dst 192.168.1.5 and tcp and port http'
Use wireshark to view detailed information about files, enter:


# tcpdump -n -i eth1 -s 0 -w output.txt src or dst port 80

12: /Proc file system - Various Kernel Statistics

/proc file system provides detailed information about various hardware devices and other Linux kernel information. See Linux kernel /proc documentations for further details. Common /proc examples:

# cat /proc/cpuinfo
# cat /proc/meminfo
# cat /proc/zoneinfo
# cat /proc/mounts

13: Nagios - Server And Network Monitoring

Nagios is a popular open source computer system and network monitoring application software. You can easily monitor all your hosts, network equipment and services. It can send alert when things go wrong and again when they get better. FAN is "Fully Automated Nagios". FAN goals are to provide a Nagios installation including most tools provided by the Nagios Community. FAN provides a CDRom image in the standard ISO format, making it easy to easilly install a Nagios server. Added to this, a wide bunch of tools are including to the distribution, in order to improve the user experience around Nagios.

A few more tools:


  • nmap - scan your server for open ports.
  • lsof - list open files, network connections and much more.
  • ntop web based tool - ntop is the best tool to see network usage in a way similar to what top command does for processes i.e. it is network traffic monitoring software. You can see network status, protocol wise distribution of traffic for UDP, TCP, DNS, HTTP and other protocols.
  • Conky - Another good monitoring tool for the X Window System. It is highly configurable and is able to monitor many system variables including the status of the CPU, memory, swap space, disk storage, temperatures, processes, network interfaces, battery power, system messages, e-mail inboxes etc.
  • GKrellM - It can be used to monitor the status of CPUs, main memory, hard disks, network interfaces, local and remote mailboxes, and many other things.
  • vnstat - vnStat is a console-based network traffic monitor. It keeps a log of hourly, daily and monthly network traffic for the selected interface(s).
  • htop - htop is an enhanced version of top, the interactive process viewer, which can display the list of processes in a tree form.
  • mtr - mtr combines the functionality of the traceroute and ping programs in a single network diagnostic tool.

Friday 6 July 2012

Diff between ext2 & ext3, ext4

Extended n file system
ext2 :
- Introduced with kernel 1.0 in 1993
- Flexible can handle upto 4TB
- super block feature increase file system performance
- ext2 reserve 5% of disk space for root
- ext2 is popular on USB and other solid-state devices.
  This is because it does not have a journaling function.
  so it generally makes fewer reads and writes to the drive,
  effectively extending the life of the device .
-  NO journalalizm

ext3 :
- Provide all the feature of ext 2 + journaling and backward compatibility .
- can upgrade ext2 to ext3 without loss of data.
- journaling feature speed up the system to recover the state after power-failure
  or improper mount unmount etc.
- Example: In ext2 in an improper unmount or in-between power-off etc.. so in time
  of receiver it checks whole file system .
  But in ext3 it keeps record of uncommitted file transactions and checks applied
  on on them so system will come back up in faster and quicker .
-

ext4:
- Introduced with kernel 2.6.28
- Ext4 is a deeper improvement over Ext3
- support  larger filesystem, faster checking, nanosecond timestamps,
  and verification of the journal through checksums.
- It’s backward and forward compatible with versions 2 and 3, so we can
  mount a ext2 or ext3 filesystem as ext4 .
- The main benefits that ext4 has over ext3 are:
  - faster time-stamping
  - faster file system checking
  - journaling check-sums
  - extents (basically automatic space allocation to avoid fragmentation)

What is Journalism in linux file syatem ?
A journaling is a file system,  that keeps track of the changes that will be made in
a journal (usually a circular log in a dedicated area of the file system) before committing them to
the main file system. In the event of a system crash or power failure, such file systems are quicker
to bring back online and less likely to become corrupted.

Tuesday 26 June 2012

Linux Interview Question

I know for a beginner how tough to find which types of question an interviewer will ask to ?? ...
 
These are the some Question for Reference... 
 
1.     Diff between RHEL 4 & 5 & 6
2.     About boot proces
3.     Types of DNS?
4.     how dns works?
5.     what is squid?
6.     port number of data ftp, ftp, telnet, smtp, sql
7.     what is sendmail hows it's works
8.     How to block downloading in squid
9.     How you handle Load on server?
10. Fields in crontab?
11. Any backup tools you know?
12. How to update your server?
13. rpm commands to update, erase, install etc...
14. Use squid to do authentication of users on browser?
15. Use of NFS and samba?
16. Diff NfS & Samba?
17. What is SeLinux?
18. Default cache size in Squid?
19. I want to assign NISdomainname via DHCP is it possible how?
20. How to setup networking IP doaminname etc...
21. What is & Difference between find and grep
22. About Raid tool used & level diff
23. I want to do remote login how?
24. Use of NIS?
25. Use of Log files?
26.Size of MBR, fields in MBR, PT size in MBR  Dir /abcd have 744 perm to user but file /abcd/file1 has 777 permission can a normal
27. user edit file1, if no why?
28. What happen if a deleted /boot/lilo.conf and restarted the system and
29. What if deleted /boot/grub/grub.conf and restart the system ???
30. what called #! /bin/bash
31. There a parameter in vsftpd conf file without which vsftpd server will not work
32. Diff GRUP & LILO techinical DIFF ...
33. Can we authenticate only users login on vsftpd by LDAP how
34. Port number SAMBA, DHCPD, SQUID, DNS, POP, POP, NTP on secure level, IMAP on secure level,  sendmail on secure level, Postfix..
35. Diff TCP/UDP
36. What are 7 Layers TCP/IP eg of each
37. Fields in DNS
38. USe of ip_farwording
39. where is config file of sshd service.
40. what is tunnel
41. What is mutt
42. fields in top command meanings
43. What is the use of swap partition
44. can we encrease swap partition size how
45. syntax of for loop in bash
46. awk stand for
47. can we change vsftpd default directory location
48. Can we change Default Directory in apache
49. Can we use index.php insted of index.html as default page in apache how .
50. visudo command will open file?
51. Diff RHEL & CentOS & Fedora
52. Diff LILO GRUB
53. Advantages of GRUB
54. What is iptables, Firewall, netfilter ..?
55. How to block the specific port.
56.

 Tables in iptables
57. what is cluster & virtualizaton just basic, what you understand by term..
58. what is domain and hostname concept.
59. can a system have multiple hostname/domainname how?
60. How many virtual ips you can assign to a single interface.
61. What is netmask/ broadcast IP ?
62. What is inode in Linux
63. What is Raid5, advantage of Raid5 over Raid4 over Raid1 over Raid0
64. Can we safely delete /usr/shares  Impacts ?
65. Use of loge levels ?
66. What is suid, guid and sticky bit
67. Can you open multiple vi on same terminal at a time
68. What is sed command, any advantage
69. Use of KILL and KILL command
70. Use KILL command to reload a service eg: HTTPD
71. What s vlan
72. How to find number of users on your system
73. Find port use by a process
74. Find file's opened by a process
75. what is fork and prefork
76. What is sticky bit, suid, guid, when to use which
77. Ramdisk when and how to use?
78. Diff Samba and NFS
79. What is tcpdump, when and how to use.
80. print whole file other than cat
81. What is hub, switch and router
82. What is segmentation fault
83. What is diff between Single user mode and Emergency mode
84. How to downgrade an rpm .
85. How to rebuild rpm db
86. List files in rpm
87. reinitialize file permission of an installed rpm
88. Active and Passive FTP
89. What is getopts how it's work
91. Diff Shell Login and Intractive Login

91. DNS,
92. What is SOA,A, PTR,Cname,NS record
93. What is MX record
94. nslookup, check which entry first
95. use of nsswitch.conf
Njoy...
 

Friday 8 June 2012

Linux Crontab

Linux Cron utility is an effective way to schedule a routine background job at a specific time and/or day on an on-going basis.


 Linux Crontab Format
MIN HOUR DOM MON DOW CMD

Table: Crontab Fields and Allowed Ranges (Linux Crontab Syntax)
FieldDescriptionAllowed Value
MINMinute field0 to 59
HOURHour field0 to 23
DOMDay of Month1-31
MONMonth field1-12
DOWDay Of Week0-6
CMDCommandAny command to be executed.



Scheduling a Job For a Specific Time Every Day

The basic usage of cron is to execute a job in a specific time as shown below. This will execute the Full backup shell script (full-backup) on 10th June 08:30 AM.

Please note that the time field uses 24 hours format. So, for 8 AM use 8, and for 8 PM use 20.
30 08 10 06 * /home/Sadeek/full-backup
  • 30 – 30th Minute
  • 08 – 08 AM
  • 10 – 10th Day
  • 06 – 6th Month (June)
  • * – Every day of the week

Schedule a Job For More Than One Instance (Twice a Day)

The following script take a incremental backup twice a day every day.

This example executes the specified incremental backup shell script (incremental-backup) at 11:00 and 16:00 on every day. The comma separated value in a field specifies that the command needs to be executed in all the mentioned time.
00 11,16 * * * /home/sadeek/bin/incremental-backup
  • 00 – 0th Minute (Top of the hour)
  • 11,16 – 11 AM and 4 PM
  • * – Every day
  • * – Every month
  • * – Every day of the week

    Schedule a Job for Specific Range of Time (Only on Weekdays)

    If you wanted a job to be scheduled for every hour with in a specific range of time then use the following.

    Cron Job everyday during working hours

    This example checks the status of the database everyday (including weekends) during the working hours 9 a.m – 6 p.m
    00 09-18 * * * /home/sadeek/bin/check-db-status
    • 00 – 0th Minute (Top of the hour)
    • 09-18 – 9 am, 10 am,11 am, 12 am, 1 pm, 2 pm, 3 pm, 4 pm, 5 pm, 6 pm
    • * – Every day
    • * – Every month
    • * – Every day of the week

    How to View Crontab Entries ?

     sadeek@localhost$ crontab -l 

    @yearly /home/sadeek/annual-maintenance 

    */10 * * * * /home/sadeek/check-disk-space

      [Note: This displays crontab of the current logged in user]

    View Root Crontab entries
     root@localhost# crontab -l
    no crontab for root

    Crontab HowTo View Other Linux User’s Crontabs entries

    To view crontab entries of other Linux users, login to root and use -u {username} -l as shown below.
    root@localhost# crontab -u sadeek -l
    @monthly /home/sadeek/monthly-backup
    00 09-18 * * * /home/sadeek/check-db-status

    Edit Root Crontab entries

    Login as root user (su – root) and do crontab -e as shown below.
    root@localhost# crontab -e

    Edit Other Linux User’s Crontab File entries

    To edit crontab entries of other Linux users, login to root and use -u {username} -e as shown below.
    root@localhost# crontab -u sadeek -e
    @monthly /home/sadeek/fedora/bin/monthly-backup
    00 09-18 * * * /home/sadeek/centos/bin/check-db-status
    ~
    ~
    ~
    "/tmp/crontab.XXXXyjWkHw" 2L, 83C

     

    Monday 26 March 2012

    Features in RHEL6

    1. ext4 file system is introduced.
    2. xen is removed and kernel virtualization machine (KVM) is introduced.
    3. neat command is removed.
    4. portmap service is removed.
    5. iscsi is introduced, which supports for SAN.
    6. rpmbuild is available, which is used to create our own rpms.
    7. File encyption is added.
    8. palimpsest is available for disk management.
    9. Virtual machine will run only on 64bit processors.
    10. postfix service is recommended instead of sendmail service

    Friday 23 March 2012

    Linux Disk Quota Implementation

    Linux User Disk Quota Implementation
    What is disk quota?
    Ans : Disk quota is  restricting the disk-space usage to the users. We have to remember one  thing when we are dealing with disk quota i.e. Disk Quota can be applied only on disks/partitions not on files and folders.

    how we can implement disk quota?
    Disk quota can be implemented in two ways

    a. On INODE
    b. On BLOCK

    What is an INODE?
    Ans : In Linux every object is consider as file, every file will be having an inode number associated and this is very much easy for computer to recognize where the file is located.

    Inode stands for Index Node, and is the focus of all file activities in the UNIX file-system.
    Each file has one inode that defines the file’s type (regular, directory, device etc), the location on disk, The size of the file, Access permissions, Access times.
    Note that the file’s name is not stored in the inode.

    So how to know what is your file Inode number?
    Ans : Its just simple execute ls -i on your file.
    ls -i test.txt
    13662 test.txt
     
    I think now you got what is INODE? Lets move on to BLOCK.
    BLOCK A block usually represents one least size on a disk, usually one block equal to 1kb. Some terms in Disk quota.

    Soft limit: This is the disk limit where the user gets just a warning message saying that your disk quota is going to expire. This is just a warning, no restriction on data creation will occur at this point.

    Hard limit : This is the disk limit where user gets error message, I repeat user gets error message stating that unable to create data.

    Implementing QUOTA :
    Step1 : Select/prepare the partition for quota, most of the time disk quota is implemented for restricting users not to create unwanted data on servers, so we will implement disk quota on /home mount point.

    #vi /etc/fstab
    Edit the /home mount point as follows
    Before editing
    /dev/hda2 /home ext3 defaults 0 0
    
    after editing
    /dev/hda2 /home ext3 defaults,usrquota 0 0
     
    Step2 : Remounting the partition(this is done because the mount table should be updated to kernel). Other wise you can reboot the system too for updating of mount table, which is not preferred for live servers.

    #mount -o remount,rw /home
    Here -o specifies options, with remounting /home partition with read and write options.
     
    Step3 : Creating quota database
     
    #quotacheck -cu /home
    The option -c for creating disk quota DB and u for user
    Check for user database is created or not when you give ls /home you have to see auota.user file in /home directory,which contains user database.
    Step4 : Switching on quota
    #quotaon /home
    Now get the report for default quota values for user sadeek
    #repquoata -a | grep sadeek
    sadeek_mohd --    4       0               1     0     0
    sadeek_m --       4       0       0       1     0     0
    sadeek_test --   16       0       0       4     0     0
    
    
    Step5 : Now implementing disk quota for user sadeek_moh on /home mount point(/dev/hda2)
    #setquota -u sadeek_mohd 100 110 0 0 /dev/hda2
     
    Step6 : Checking quota is implemented or not login to user sadeek_mohd and execute this command
    #repquota -a
    or
    #quota
    Step7 : Keep creating data, once 100MB is reached user will get an warning message saying, and when he reaches 110MB he cannot create any more data.
    Hint : To create a data file you can use seq command as below
    #seq 1 10000 > test.txt
    this command will create a file with 10000 lines with numbers in it.
    Removing quota :
    To do this one, all the users should log out from the system so better do it in run level one.
    Step8 : Stop the disk quota
     
    #quotaoff /home

    Step9 : Removing quota database which is located /home
    #rm /home/aquota.user

    Step10 : Edit fstab file and remove usrdata from /home line
    #vi /etc/fstab

    Before editing
    /dev/hda2 /home ext3 defaults,usrquota 0 0

    After editing
    /dev/hda2 /home ext3 defaults 0 0
    Step11 : Remount the /home partition
    
    
    #mount -o remount,rw /home
    That’s it you are done with Disk Quota Implementation in Linux. Now test yourself in creating Linux user disk quota on your own.