Red
Hat Enterprise Linux Kernel Upgrade
Kernel Upgrade Introduction
________________________________________
In this KB, we will see how to upgrade the kernel on Red Hat Linux
Enterprise systems. We will show you how
to perform a automated upgrades of the kernel using the yum and rpm package
management tools.
Before continuing on, a word of caution. I recommend avoiding kernel updates unless
absolutely necessary. Generally
speaking, if it's not broke, don't try and fix it. So unless there is a vulnerability or lack of
hardware/driver support in the currently installed kernel on your system, I
would recommend against the installation of a new/updated kernel. Installing a new kernel could have wide
spread and unknown consequences to your system and/or might not be supported by
your hardware/installed software. Now
that I got that off my chest, I'll get off my soapbox so we can get to work!
Kernel Upgrade/Update on Red Hat Enterprise Linux
________________________________________
Red Hat use a combination of tools such as yum for package retrieval
and rpm for package management. If you system
is registered with the Red Hat Network (RHN), yum will automatically download
and resolve dependencies for rpm based installs. If you system is not registered with RHN, you
can still upgrade the kernel, but you will have to manually resolve any dependencies
(downloading and installing any dependent rpms.) Yum will connect to the RHN (Red Hat Network)
and scan the repository for updated packages (including your kernel.) If there are updates available, yum will
resolve their dependencies and mark the additional packages for
download/installation. Once yum has
downloaded all the package(s), it will begin installing the packages using rpm
(this will configure and register the package with the OS.)
1. Before we can use yum, we
must first register the server with the RHN (Red Hat Network).
Note: If you registered your OS at the time of installation, you can
skip this step
Begin the registration process
[root@RHEL01 ~]# rhn_register
2.
You'll be presented with a screen similar to the following, click Next
to continue:
Kernel Upgrade Introduction
________________________________________
In this KB, we will see how to upgrade the kernel on Red Hat Linux
Enterprise systems. We will show you how
to perform a automated upgrades of the kernel using the yum and rpm package
management tools.
Before continuing on, a word of caution. I recommend avoiding kernel updates unless
absolutely necessary. Generally
speaking, if it's not broke, don't try and fix it. So unless there is a vulnerability or lack of
hardware/driver support in the currently installed kernel on your system, I
would recommend against the installation of a new/updated kernel. Installing a new kernel could have wide
spread and unknown consequences to your system and/or might not be supported by
your hardware/installed software. Now
that I got that off my chest, I'll get off my soapbox so we can get to work!
Kernel Upgrade/Update on Red Hat Enterprise Linux
________________________________________
Red Hat use a combination of tools such as yum for package retrieval
and rpm for package management. If you
system is registered with the Red Hat Network (RHN), yum will automatically
download and resolve dependencies for rpm based installs. If you system is not registered with RHN, you
can still upgrade the kernel, but you will have to manually resolve any
dependencies (downloading and installing any dependent rpms.) Yum will connect to the RHN (Red Hat Network)
and scan the repository for updated packages (including your kernel.) If there are updates available, yum will
resolve their dependencies and mark the additional packages for
download/installation. Once yum has
downloaded all the package(s), it will begin installing the packages using rpm
(this will configure and register the package with the OS.)
1. Before we can use yum, we
must first register the server with the RHN (Red Hat Network).
Note: If you registered your OS at the time of installation, you can
skip this step
Begin the registration process
[root@RHEL01 ~]# rhn_register
2.
You'll be presented with a screen similar to the following, click Next
to continue:
Enter your login information for the Red Hat Network (RHN) and click
Next:
Enter a profile name for the server and click Next:
Leave the defaults selected and click Next:
Click Next on the Send Profile page:
Your system's information will be sent/registered with the Red Hat
Network (RHN):
Click OK on the subscription details page:
Click Finish to complete the registration with the RHN:
3. Check to see if there are
updates available for the system
Check for updates to the kernel package only:
[root@RHEL01 ~]# yum check-update kernel
Loaded plugins: rhnplugin
kernel.x86_64 2.6.18-128.1.14.el5 rhel-x86_64-server-5
root@ubuntu:~#
4. Note: If there are no
updates available, no output will be produced
Or
Check for all packages (including the kernel):
[root@RHEL01 ~]# yum check-update
Loading "installonlyn" plugin
Loading "rhnplugin" plugin
Setting up repositories
rhel-x86_64-server-5 100%
|=========================| 1.3 kB 00:00
Reading repository metadata in from local files
primary.xml.gz 100%
|=========================| 2.3 MB 00:01
################################################## 7019/7019
Deployment_Guide-en-US.noarch 5.2-11 rhel-x86_64-serv
NetworkManager.x86_64 1:0.7.0-4.el5_3
rhel-x86_64-serv
ORBit2.x86_64 2.14.3-5.el5 rhel-x86_64-serv
OUTPUT TRUNCATED
kernel.x86_64 2.6.18-128.1.14.el5 rhel-x86_64-serv
kernel-headers.x86_64 2.6.18-128.1.14.el5 rhel-x86_64-serv
OUTPUT TRUNCATED
[root@Linux01 rhn]#
5. Note: yum returns a list
of all available packages
6. A quick check of the
system reveals we are running on v2.6.18-8.el5 of the Linux kernel
[root@RHEL01 ~]# rpm -qi kernel
Name : kernel Relocations : (not
relocatable)
Version : 2.6.18 Vendor
: Red
Hat, Inc.
Release : 8.el5 Build
Date : Fri 26 Jan 2007 02:47:08 PM EST
Install Date : Wed 24 Jun 2009 8:50:56 AM EDT Build Host : ls20-bc1-14.build.redhat.com
Group : System Environment/Kernel Source
RPM : kernel-2.6.18-8.el5.src.rpm
Size : 75875879 License : GPLv2
Signature : DSA/SHA1, Fri 26 Jan 2007 09:12:24 PM
EST, Key ID 5326810137017186
Packager : Red Hat, Inc.
<http://bugzilla.redhat.com/bugzilla>
Summary : The Linux kernel (the core of the Linux
operating system)
Description :
The kernel package contains the Linux kernel (vmlinuz), the core of any
Linux operating system. The
kernel handles the basic functions
of the operating system: memory
allocation, process allocation, device
input and output, etc.
[root@RHEL01 ~
7.
[root@RHEL01 ~]# uname -a
Linux RHEL01 2.6.18-8.el5 #1 SMP Fri Jan 26 14:15:14 EST 2007 x86_64
x86_64 x86_64 GNU/Linux
[root@RHEL01 ~]#
8.
9. Install the new kernel
using yum
Update the kernel package only:
[root@RHEL01 ~]# yum update kernel
Loading "rhnplugin" plugin
Setting up Update Process
Resolving Dependencies
--> Running transaction check
---> Package kernel.x86_64 0:2.6.18-128.1.14.el5 set to be installed
--> Finished Dependency Resolution
.
Dependencies Resolved
==========================================================
Package Arch Version Repository Size
==========================================================
Installing: kernel x86_64 2.6.18-128.1.14.el5 rhel-x86_64-server-5 17 M
.
Transaction Summary
==========================================================
Install 1 Package(s)
Update 0 Package(s)
Remove 0 Package(s)
.
Total download size: 17 M
Is this ok [y/N]: y
10.
Or
Update all packages including the kernel:
[root@RHEL01 ~]# yum update
Loading "installonlyn" plugin
Loading "rhnplugin" plugin
Setting up Update Process
Setting up repositories
rhel-x86_64-server-5 100%
|=========================| 1.3 kB 00:00
Reading repository metadata in from local files
primary.xml.gz 100%
|=========================| 2.3 MB 00:01
################################################## 7019/7019
Resolving Dependencies
--> Populating transaction set with selected packages. Please wait.
---> Downloading header for redhat-lsb to pack into transaction set.
redhat-lsb-3.1-12.3.EL.x8 100%
|=========================| 12 kB 00:00
---> Package redhat-lsb.x86_64 0:3.1-12.3.EL set to be updated
OUTPUT TRUNCATED
.
Transaction Summary
==========================================================
Install 33 Package(s)
Update 270 Package(s)
Remove 0 Package(s)
.
Total download size: 255 M
Is this ok [y/N]: y
11. Note: There may also be
other available packages that need updating on the system (as seen above.) Yum should take care of the kernel as well as
any other packages and associated dependencies on the system.
After answering yes to the continue question, yum will pull all the new
packages and their dependencies from the RHN repository. It will then configure them, and update your
boot loader to use the new kernel (requires a reboot).
12. The new kernel is now
installed and ready for use. Reboot the
system to boot into the new kernel image
[root@RHEL01 ~]# init 6
13.
14. Once the system has come
back up, login and verify your running from the new kernel image
[root@RHEL01 ~]# uname -a
Linux REHL01 2.6.18-128.1.14.el5 #1 SMP Mon Jun 1 15:52:58 EDT 2009 x86_64
x86_64 x86_64 GNU/Linux
[root@RHEL01 ~]#
Knowing Linux booting process is an essential
part of every Linux user/administration which will give you a clear picture of
how Linux Operating system works. In this post we will see what happens when a
Linux OS boots i.e. after powering on the machine to the user login prompt.
Below image will give you clear idea what will happen in Linux booting process.
A quick view of booting sequence:
Power on
CPU jumps to BIOS
BIOS runs POST
Finds first bootable device
Load and execute MBR
Load OS
User prompt
This a rough idea what happens in Linux
booting. Below are the detailed stages in Linux Booting process.
Stages
of Booting:
1)System
startup(Hardware )
2)Boot loader Stage 1 (MBR loading)
3)Boot loader Stage 2 (GRUB loader)
4)Kernel
5)INIT
6)User prompt
2)Boot loader Stage 1 (MBR loading)
3)Boot loader Stage 2 (GRUB loader)
4)Kernel
5)INIT
6)User prompt
Stage 1: System startup
This is the first
stage of booting process. When you power on/Restart your machine the power is
supplied to SMPS (switched-mode power supply) which converts AC to
DC. The DC power is supplied to all the devices connected to that machine such
as Motherboard HDD's, CD/DVD-ROM, Mouse, keyboard etc. The most intelligent
device in the computer is Processor(CPU), when supplied with power will start
running its sequence operations stored in its memory. The first instruction it
will run is to pass control to BIOS(Basic
Input/Output System) to do POST(Power On
Self Test). Once the control goes to BIOS it will take care of two things
·
Run POST operation.
·
Selecting first Boot
device.
POST operation:
POST is a
processes of checking hardware availability. BIOS will have a list of all
devices which are present in previous system boot. In order to check if a
hardware is available for the present booting or not it will send an electric
plus to each and every device in the list that it already have. If an
electrical pulse is returned from that device it will come to a conclusion the
hardware is working fine and ready for use. If it does not receive a single
from a particular device it will treat that device as faulty or it was removed
from the system. If any new hardware is attached to the system it will do the
same operation to find if its available or not. The new list will be stored in
BIOS memory for next boot.
Selecting First Boot
Device:
Once the POST is
completed BIOS will have the list of devices available. BIOS memory will have
the next steps details like what is the first boot device it has to select etc.
It will select the first boot device and gives back the control to
Processor(CPU). Suppose if it does not find first boot device, it will check
for next boot device, if not third and so on. If BIOS do not find any boot
device it will alert user stating "No boot device found".
Stage 2: MBR loading
Once the BIOS gives
control back to CPU, it will try to load MBR of the first boot device(We will
consider it as HDD). MBR is a small part of Hard Disk with just a size of 512
Bytes, I repeat its just 512 Bytes. This MBR resides at the starting of HDD
or end of HDD depending on manufacturer.
What is MBR?
MBR(Master Boot recorder) is a location on disk which have details about
·
Primary boot loader code(This is of 446 Bytes)
·
Partition table information(64 Bytes)
·
Magic number(2 Bytes)
Which will be equal to
512B (446+64+2)B.
Primary Boot loader code: This code provides boot loader information and location details
of actual boot loader code on the hard disk. This is helpful for CPU to load
second stage of Boot loader.
Partition
table: MBR
contains 64 bytes of data which stores Partition table information such as
what is the start and end of each partition, size of partition, type of
partition(Whether it's a primary or extended etc). As we all know HDD support
only 4 partitions, this is because of the limitation of its information in MBR.
For a partition to represent in MBR, it requires 16 Bytes of space in it so at
most we will get 4 partitions.
Magic Number: The magic number service as validation
check for MBR. If MBR gets corrupted this magic number is used to retrieve it.
What to take backup of your MBR try this.
Once your CPU knows all these details, it
will try to analyse them and read the first portion of MBR to load Second stage
of Boot loader
Stage 3: Boot loader Stage 2 (GRUB loader)
Once the Bootloader stage 1 is completed
and able to find the actual bootloader location, Stage 1 bootloader start
second stage by loading Bootloader into memory. In this stage GRUB(Grand
Unified Bootloader) which is located in the first 30 kilobytes of hard disk
immediately following the MBR is loaded into RAM for reading its configuration
and displays the GRUB boot menu (where the user can manually specify the boot
parameters) to the user. GRUB loads the user-selected (or default) kernel into
memory and passes control on to the kernel. If user do not select the OS, after
a defined timeout GRUB will load the default kernel in the memory for starting
it.
Stage 4: Kernel
Once the control is given to kernel which
is the central part of all your OS and act as a mediator of hardware and
software components. Kernel once loaded into to RAM it always resides on RAM
until the machine is shutdown. Once the Kernel starts its operations the first
thing it do is executing INIT process.
Stage 5: INIT
This is the main stage of Booting Process
init(initialization) process is the root/parent process of all
the process which run under Linux/Unix. The first process it runs is a script
at /etc/rc.d/rc.sysinit which check all the system properties, hardware,
display, SElinux, load kernel modules, file system check, file system mounting
etc. Based on the appropriate run-level, scripts are executed to start/stop
various processes to run the system and make it functional. INIT process read
/etc/inittab which is an initialization table which defines starting of system
programs. INIT will start each run level one after the other and start
executing scripts corresponds to that runlevel.
The script information is stored in different
folders in /etc/ folder
/etc/rc0.d/
–Contain Start/Kill scripts which should be run in Runlevel 0
/etc/rc1.d/ –Contain Start/Kill scripts which should be run in Runlevel 1
/etc/rc2.d/ –Contain Start/Kill scripts which should be run in Runlevel 2
/etc/rc3.d/ –Contain Start/Kill scripts which should be run in Runlevel 3
/etc/rc4.d/ –Contain Start/Kill scripts which should be run in Runlevel 4
/etc/rc5.d/ –Contain Start/Kill scripts which should be run in Runlevel 5
/etc/rc6.d/ –Contain Start/Kill scripts which should be run in Runlevel 6
/etc/rc1.d/ –Contain Start/Kill scripts which should be run in Runlevel 1
/etc/rc2.d/ –Contain Start/Kill scripts which should be run in Runlevel 2
/etc/rc3.d/ –Contain Start/Kill scripts which should be run in Runlevel 3
/etc/rc4.d/ –Contain Start/Kill scripts which should be run in Runlevel 4
/etc/rc5.d/ –Contain Start/Kill scripts which should be run in Runlevel 5
/etc/rc6.d/ –Contain Start/Kill scripts which should be run in Runlevel 6
Once
the initialization process completes mandatory run level and reach to default
runlevel set in /etc/inittab, init process run one more file /etc/rc.local which are the last commands run in
initialization process or even booting process. Once everything is completed
the control is given back to the kernel
Stage 6: User prompt
This is actually not part of booting
process but thought of including it here for better understating. Once the
Kernel get the control it start multiple instances of "getty" which
waits for console logins which spawn one's user shell process and gives you
user prompt to login.
Runlevel Definition
A runlevel is
a preset operating state on a Unix-like operating system.
A system can
be booted into (i.e.,
started up into) any of several runlevels, each of which is represented by a
single digit integer. Each runlevel designates a different system
configuration and allows access to a different combination of processes (i.e.,instances of
executing programs).
The are differences
in the runlevels according to the operating system. Seven runlevels are
supported in the standard Linux kernel (i.e., core
of the operating system). They are:
0 - System halt; no activity, the system can be safely powered down. 1 - Single user; rarely used. 2 - Multiple users, no NFS (network filesystem); also used rarely. 3 - Multiple users, command line (i.e., all-text mode) interface; the standard runlevel for most Linux-based server hardware. 4 - User-definable 5 - Multiple users, GUI (graphical user interface); the standard runlevel for most Linux-based desktop systems. 6 - Reboot; used when restarting the system.
By default Linux
boots either to runlevel 3 or to runlevel 5. The former permits the system to
run all services except for a GUI. The latter allows all services including a
GUI.
In addition to the
standard runlevels, users can modify the preset runlevels or even create new
ones if desired. Runlevels 2 and 4 are usually used for user defined
runlevels.
The program
responsible for altering the runlevel is init, and it can be called
using thetelinit command.
For example, changing from runlevel 3 to runlevel 5, which allows the GUI to
be started, can be accomplished by the root (i.e., administrative) user by
issuing the following command:
telinit 5
Booting into a
different runlevel can help solve certain problems. For example, if a change
made in the X Window
System configuration on a machine that has been set up to
boot into a GUI has rendered the system unusable, it is possible to
temporarily boot into a console (i.e.,
all-text mode) runlevel (i.e., runlevels 3 or 1) in order to repair the error
and then reboot into the GUI. The X Window System is a widely used system for
managing GUIs on single computers and
on networks of
computers.
Likewise, if a
machine will not boot due to a damaged configuration file or will not allow logging in because
of a corrupted /etc/passwd file
(which stores user names and other data about users) or because of a
forgotten password, the problem can solved by first booting into single-user
mode (i.e. runlevel 1).
The runlevel command can
be used to find both the current runlevel and the previous runlevel by merely
typing the following and pressing the Enter key:
/sbin/runlevel
The runlevel executable file (i.e.,
the ready-to-run form of the program) is typically located in the /sbin directory, which
contains mostly administrative tools and which by default is not in the
user's PATH (i.e.,
the list of directories in which the system searches for programs). Thus, it
is usually necessary to type the full path of the
command as shown above rather than just the name of the command itself.
The default runlevel
for a system is specified in the /etc/inittab file, which will
contain an entry such as id:3:initdefault: if the system starts in
runlevel 3, orid:5:initdefault: if it starts in runlevel 5. This file
can be easily (and safely) read with a command such as cat, i.e.,
cat /etc/inittab
As an alternative to
telinit, the runlevel into which the system boots can be changed by modifying
/etc/inittab manually with a text editor. However, it
is generally easier and safer (i.e., less chance of accidental damage to the
file) to use telinit. It is always wise to make a backup copy of /etc/inittab
or any other configuration file before attempting to modify it manually.
The differences between Ext2 and Ext3 file systems
are as follows.
|
Some
FAQ’s:
1. What is Journaling?
Ans : In general, Journaling file systems avoid file system corruption by maintaining a journal. The journal is a special file that logs the changes destined for the file system in a circular buffer. At periodic intervals, the journal is committed to the file system. If a crash occurs, the journal can be used as acheckpoint to recover unsaved information and avoid corrupting of file system meta-data.
2.How many file systems supported by linux? and what are they?
Ans : Linux will supports : Btrfs, cifs, davfs, ext, ext2, ext3, ext4, exofs, hpfs, JFS minix, msdos, ncpfs, NiLFS(2), ntfs, nfs, proc, smbfs, iso9660, sysv, hpfs, affs, ufs, umsdos, vfat, xia, xfs, ZFS.
1. What is Journaling?
Ans : In general, Journaling file systems avoid file system corruption by maintaining a journal. The journal is a special file that logs the changes destined for the file system in a circular buffer. At periodic intervals, the journal is committed to the file system. If a crash occurs, the journal can be used as acheckpoint to recover unsaved information and avoid corrupting of file system meta-data.
2.How many file systems supported by linux? and what are they?
Ans : Linux will supports : Btrfs, cifs, davfs, ext, ext2, ext3, ext4, exofs, hpfs, JFS minix, msdos, ncpfs, NiLFS(2), ntfs, nfs, proc, smbfs, iso9660, sysv, hpfs, affs, ufs, umsdos, vfat, xia, xfs, ZFS.
Note : Please add some more file systems which you people know in the comment section. So that i will update the post with new file systems.
3.What is the maximum size of a partition we can create using ext2 and ext3?
Ans : 4TB partition can be created in each ext2 and ext3 file system respectively.
4.What
is the maximum size of a file we can create in ext2?
Ans : The maximum size what we can create is 2GB to 2TB. It depends on the block size we taken when we are formatting. If the block size is 1KB we can not create a file more than 2GB in ext2 file system.
Ans : The maximum size what we can create is 2GB to 2TB. It depends on the block size we taken when we are formatting. If the block size is 1KB we can not create a file more than 2GB in ext2 file system.
5.What
is “ext” in ext2 and ext3?
Ans : When linux first implemented the default file system is minixfs, in subsequent years it was replaced its successor file system called extended file-system. So the naming convention. So ext2 is second version of extended file system. Same explanation is given to ext3 and ext4.
Ans : When linux first implemented the default file system is minixfs, in subsequent years it was replaced its successor file system called extended file-system. So the naming convention. So ext2 is second version of extended file system. Same explanation is given to ext3 and ext4.
6.
Some points about ext4
a.It supports 64 bit storage limits, where as ext, ext2, ext3 are 32Bit storage limits and minix is 16Bit storage limit.
b.Have backward compatibility and performance is improved from lower version.
c.Extents are introduced (An extent is a range of contiguous physical blocks, improving large file performance and reducing fragmentation. A single extent inext4 can map up to 128MB of contiguous space with a 4KB block size).
a.It supports 64 bit storage limits, where as ext, ext2, ext3 are 32Bit storage limits and minix is 16Bit storage limit.
b.Have backward compatibility and performance is improved from lower version.
c.Extents are introduced (An extent is a range of contiguous physical blocks, improving large file performance and reducing fragmentation. A single extent inext4 can map up to 128MB of contiguous space with a 4KB block size).
What is disk quota?
Ans : Disk quota is nothing but 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.
Ans : Disk quota is nothing but 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.
So how we can
implement disk quota?
Disk quota can be implemented in two ways
Disk quota can be implemented in two ways
a. On INODE
b. On BLOCK
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 recognise where the file is located.
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 recognise 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.
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 xmls.txt
13662 xmls.txt
I think now you got
what is INODE? Lets move on to 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
messagesaying 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.
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
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.
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 surendra
#repquoata -a | grep surendra
surendra_anne -- 4 0 0 1 0 0
surendra_a -- 4 0 0 1 0 0
surendra_test -- 16 0 0 4 0 0
Step5
: Now
implementing disk quota for user phani on /home mount point(/dev/hda2)
#setquota -u surendra_anne 100 110 0 0 /dev/hda2
Step6
: Checking
quota is implemented or not login to user surendra_anne 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 can not 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 runlevel one.
To do this one, all the users should log out from the system so better do it in runlevel 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 your self in
creating Linux user disk quota on your own.
What are the file and file system size limitations for Red Hat Enterprise Linux?
Maximum (individual)
file size
|
|
|
|
|
|
Filesystem
|
RHEL 3
|
RHEL 4
|
RHEL 5
|
RHEL 6
|
RHEL 7
|
EXT2/3
|
2TB
|
2TB
|
2TB
|
2TB
|
-
|
EXT4 [2]
|
n/a
|
n/a
|
16TB (5.4 or later)
[2]
|
16TB
|
50TB
|
GFS1
|
2TB
|
16TB supported, 8EB
limit
|
16TB supported, 8EB
maximum
|
n/a
|
n/a
|
GFS2 [1]
|
n/a
|
n/a
|
25TB
|
100TB
|
100TB
|
XFS [3]
|
n/a
|
n/a
|
16TB
|
16TB
|
16TB
|
Maximum filesystem size
|
|
|
|
|
|
Filesystem
|
RHEL 3
|
RHEL 4
|
RHEL 5
|
RHEL 6
|
RHEL 7
|
EXT2/3
|
2TB
|
8TB
|
16TB (8TB in 5.0)
[4]
|
16TB
|
-
|
EXT4 [2]
|
n/a
|
n/a
|
16TB (5.4 or later)
[2]
|
16TB
|
50TB
|
GFS
|
2TB
|
16TB supported, 8EB
limit
|
16TB supported, 8EB
limit
|
n/a
|
n/a
|
GFS2 [1]
|
2TB
|
16TB
|
25TB [5]
|
100TB
|
100TB
|
XFS [3]
|
n/a
|
n/a
|
100TB
|
100TB
|
500TB
|
Units
|
|||||
Units are given in binary prefix.
|
|||||
TB = Terabyte = 2^40
|
|||||
EB = Exabyte = 2^60
|
Linux Commands to Monitor Memory Usage:
vmstat Monitor virtual memory
free Display amount of free and used memory in the system.
pmap Display/examine memory map and libraries (so). Usage: pmap pid
top Show top processes
sar -B Show statistics on page swapping.
time -v date Show system page size, page faults, etc of a process during execution. Note you must fully qualify the command as "/usr/bin/time" to avoid using the bash shell command "time".
cat /proc/sys/vm/freepages Display virtual memory "free pages".
One may increase/decrease this limit: echo 300 400 500 > /proc/sys/vm/freepages
cat /proc/meminfo Show memory size and usage.
vmstat Monitor virtual memory
free Display amount of free and used memory in the system.
pmap Display/examine memory map and libraries (so). Usage: pmap pid
top Show top processes
sar -B Show statistics on page swapping.
time -v date Show system page size, page faults, etc of a process during execution. Note you must fully qualify the command as "/usr/bin/time" to avoid using the bash shell command "time".
cat /proc/sys/vm/freepages Display virtual memory "free pages".
One may increase/decrease this limit: echo 300 400 500 > /proc/sys/vm/freepages
cat /proc/meminfo Show memory size and usage.
No comments:
Post a Comment