Professional Documents
Culture Documents
Units:
unit-1 About the founder of Linux.
unit-2 Linux VS Windows.
unit-3 Linux Flavors.
unit-4 Introduction to Redhat Linux.
unit-5 Kernel.
unit-6 Types of shells
unit-7 Dos Vs Linux.
unit-8 Redhat Linux Installation
unit-9 Hardware Requirements
unit-10 Installation Methods
Unit -1
About the founder of LINUX
•Linus Benedict Torvalds (born
December 28, 1969) began the
development of Linux, an operating
system kernel, and today acts as the
project coordinator.
• By the release of the first version of the Linux kernel, the GNU
project had produced all the necessary components of this
system except the kernel.
• C shell (csh)
– Added many features such as command, history
and job control
Continue…
Shells
command
prompt for bash
shell
command
prompt for c-
shell (csh)
Shells
command prompt
for enhanced C
shell (tcsh)
Shells
command
prompt for
bourne shell
(sh)
Shells
command
prompt for korne
shell (ksh)
DOS Vs Linux
DOS LINUX Command Action
Command
RENAME or
mv Rename/move a file
MOVE
.\ ./ Current directory
free
MEM Show free memory on system
top
SCANDISK
fsck Check and repair hard drive file system
DEFRAG C:
IPCONFIG (NT)
ifconfig Display/configure network interface
WINIPCFG (Win 95...)
IPCONFIG (NT)
ifconfig Display/configure network interface
WINIPCFG (Win 95...)
NFS Image.
Kick Start
FTP
HTTP
Red Hat Installation through CD
to share files.
system.
Press Enter, to
install in
Graphical mode.
Red Hat Installation
Type linux
text, to install
in Text mode.
Red Hat Installation
Hardware
detection
process
Select the
Installation
language.
Redhat Installations
Select the
appropriate
type of
installation.
Redhat Installations
Select the
appropriate
NFS type
installation.
Redhat Installations
Select this
option to assign
an dynamic ip
address.
Redhat Installations
Enter the
appropriate ip
address
Redhat Installations
Enter the
information of
server ip address
and directory.
Redhat Installations
The Anaconda-
Red Hat
Installer begins
the Installation.
Redhat Installations
Hardware
detection
process
Redhat Installations
Redhat Installations
Click here to
create new
partition in the
free space
Creating Partition for /boot directory
Enter the
mount points
here.(swap)
Click here to
change the
default boot
GRUB and LILO
loader
are the Red Hat
Linux boot loaders.
GRUB is the Default
Loader of Red Hat
Linux 8.0
The default boot
operating system
can be changed or
added here
Redhat Installations
No firewall option
allows all network
services to your
machine
No firewall option
allows all network
services to your
machine
Redhat Installations
Activate your
SELINUX options Enable firewall
option allows
specific network
services to your
machine
Redhat Installations
Redhat Installations
Choose the
default language
for the system.
Redhat Installations
Time zone is
selected here.
Redhat Installations
Enter the
password for the
root (Super User)
Redhat Installations
Its reading
package
information's.
Redhat Installations
Select customize
This is used to select
options to customize
the default package.
the package selections
Package Selection
The Packages to be
installed are selected
here. Even the office
(Like MS-Office
in windows)
Packages are
available inbuilt
in Red Hat
installation CD
Package Selection
Checking and
installing the
packages.
Beginning of Installation
The installation
image is copied
to the hard drive.
Installing Packages
Initializing the
installation
process
Installing Packages
Installation of Installation of
packages under tzdata packages
progress
Installing Packages
Installation of
packages under
progress
Installing Packages
Installation of
packages under
progress
Installation of
packages under
progress
Installing Packages
Installation of
packages under
progress
Installing Packages
Installation of
packages under
progress
Installing Packages
Performing the
post install
configuration.
Reboot the System
Welcome
The Red Hat to
setup agent Red Hat Linux
will proceed Setup agent
some
More basic
configurations
Before the system
is ready
to use.
License agreement
Setting date and time
Graphics configuration
Click here to
The update agent register with the
registers the Red Hat network
machine with
Red Hat network
So that the latest
Software packages
Get updated
Click here to
automatically
skip registration
System user creation.
Create non
administrative user to
access the system.
Sound Card Configuration
• /etc/inittab:
• File which contains the information on how init
should setup the system in every run level, as well
as the run level to use a default.
Run levels
init 4 : Unused.
Get in to the
inittab file, the
init configuration
file.
Run level configuration file
The default
run level can
be changed
here.
CONSOLES
• Graphical login
• Graphical console comes through CTRL-ALT-F7
X Window System
protocol.
• X is OS Independent.
Environments.
Linux.
www.gnome.org.
GNOME Interface
• The GNOME Interface consists of a Panel and a Desktop.
manager.
non-windowing console.
Start X
To get in to X
window from run
level-3
Start X
Desktop Selection
Select failsafe
in case of any To get in to the
graphical previously used
failure desktop
To get the
To get in to default
GNOME desktop.
To get in to
desktop. KDE desktop.
KDE MODE
If you click yes the
KDE desktop is set
as default desktop
for future sessions
(or) login
To change the
desktop environment.
Switchdesk
Thus we switched
into GNOME
desktop
Linux File System Directories
Directory Function
CD cd Change directory
RENAME or
mv Rename/move a file
MOVE
.\ ./ Current directory
free
MEM Show free memory on system
top
SCANDISK
fsck Check and repair hard drive file system
DEFRAG C:
IPCONFIG (NT)
ifconfig Display/configure network interface
WINIPCFG (Win 95...)
IPCONFIG (NT)
ifconfig Display/configure network interface
WINIPCFG (Win 95...)
Enter the
user name
PWD
• PWD
The absolute
path of the
root directory
is displayed.
ls
ls :
Syntax:
ls [options]
Options:
It defines the
No ofname
Owner
The links to the
name,
of thethe
group
permissions
directory
user who created
which has the
assigned to the
Time stamp the directory.
permissions over
Size of theFile
filesor owners, groups andthe
directory
or directories files or directories
other users
names.
ls -a
mkdir :
Make directory (or) To create a directory
Syntax :
mkdir <dirname>
mkdir
cd -
- To your previous working directory
cd /
- To the / (slash) directory
cd
This command
will take you to
the directory .
cd ~
Previous slide
we have seen cd
along with any
directory name.
This command
cd ~ <enter>
will take to your
home directory
cd ..
Confirmed
through the pwd
command
cd –
Here the current
directory is newdir
when we enter cd -, it
takes to
Again cdthe
- ispreviously
given as
worked
shown. Nowdirectory.
it will take
to the previously
worked directory i.e.,
cd - (newdir)
command will take
you to the previous
working directory
cat
cat
– it is the command to create and view files
Syntax:
• cat [options] [filename]
As mentioned in
the previous
slide. cat is used
to create a file
Enter
cat <filename>
to view the
content of file.
cat
To append the
text in a file,
Cat >> (symbol)
and file name.
cat
The screen
shows the
appended file
cat
The -s option
trims multiple
adjacent blank
lines into single
blank line
cat
The –b option
numbers the
each text line
of the output
cat
Here the
empty file is
created
touch
Multiple files
are created
using touch
command
Copy Command
There is a file
named ‘a’ in
the directory
test .
Copy Command
Directories new
and old are
listed with their
contents.
Copy Command
-r option copy
the entire
directory tree
‘old’
Copy Command
Thus the
contents of
old directory
is copied to
new
directory.
Copy Command
Command l l
shows the
permission of
the file
Copy Command
Using chmod,
permission of
the file is
changed
Copy Command
Now, we
copy the file
one to the
directory old
Copy Command
See the
comparison
of the file one
shown above
in the new
and old
directory
Copy Command
Syntax:
mv <source> <destination>
Example
A file is
available in
the name of
one in the
directory old
Move Command
Here we see
that using mv
command the
file is moved
from old to new
directory.
Move Command
Now check into the
old directory where
the file one is
moved. Hence the
directory is empty
Move Command
Here a file is
created test
in the old
directory
Move Command
This example
shows how to
rename a file
test to tested
Move Command
Using the l l
command, the
above screen
shows the
renamed file
rm and rmdir command
rm : This command is used to remove files
Syntax:
rm <filename>
Example :
rm file1
This screen
shows the
contents of the
new directory
The above rm
command is
used to remove
the file k
rm command
Here a directory is
created named donic
which is removed through
the command rmdir
rmdir command
The above
screen shows
that directory
donic is
removed
rmdir command
In the above
screen we see
that directory
tomy is unable
to remove
rm command
Using rm with
option – r, the
directory along
with contents can
be removed
rm -r command
Now the
above screen
shows that
the directory
is removed
rm command
The above
screen shows
the contents of
directory jerry
rm -ri command
Syntax :
file <filename>
Example:
file f1 (f1 is a file. File will show the format)
file /dev/fd0 (The output shows that the fd0 is a
block special file)
File format
The file along with
file name (ss) shows
the file format
File format
This shows
the format
of the file
cat as
executable
file
more
l l command
shows the
contents at
once.
more
l l lists the
content
quickly, which
makes the
viewer to see
only last page
more
More is used
to lists the
contents one
screen at a
time
more
More is been
prompted
after listing
one by one
more
Here it is
the same
process
listing more
contents,
shown as
above
more
Here it is
the same
process
listing more
contents,
shown as
above
more
Now the
more
command is
over and
we are in
the end of
the page
vi & vim editor
Vi is known as the visual editor.
•Command mode
•Insert mode
•Esc mode
vi Modes
Command mode:
Operations such as cut, copy, paste, delete,
undo, redo etc., are done in this mode.
Insert mode:
Type in new text
Ex-mode :
Extended commands for saving, exiting, search-
and-replace can executed here
Working with vi editor
exam is a
file created
or opened
with the vi
editor.
Command Mode
Press ‘i’ to
get into
the insert
mode
Insert Mode
This is the
insert mode
Insert Mode
After typing
the data’s hit
escape to get
into command
mode
Ex- Mode
Press
:wq to
write and
quit
Ex- Mode
Press q!
to quit
without
saving
the data
Yank
In the previous
slide, we saw how
to yank the text.
After yanking we
see the message
as below
Text put
To cut a line
after curser
position hit 1cc.
cut and put
Now hit p to
paste the data.
Search
Syntax:
find <directory> [conditions] [action]
Condition:
-name <file name> - to search a particular file
-user <user name> - lists the files owned by
user.
-perm <mode> - search a file depending
on permission.
Find command
This command
searches the
password file from
/ directory.
Find command
The above
screen shows
the execution of
command
Locate command
Locate:
Syntax:
locate [pattern]
Locate command
To search file
named test1
from database.
Locate command
man :
Display helpful information about
commands.
Syntax:
man [option] command
Option:
–k - search by command description rather than
command name.
Man command
It displays manual
pages for ls
command.
Man command
The manual page
of ls command is
displayed here.
Enter q to exit
from manual page.
useradd command
useradd :
To create a new user account and login
directory for that new account.
Useradd will create new entries in system files.
Syntax
useradd [options] [user]
Options
-c Comment field.
-d Home directory
-e Account expiration date.
useradd command
User named
abdulkalam is
created.
To set password
for abdulkalam.
useradd command
Enter the
password.
User home directory
- /etc/passwd
- /etc/group
- /etc/shadow
Passwd file
To view
password
configuration file.
Passwd file
First
Group
User xid.
represents
field
id.
encrypted User
User login
home
represent
password is shell.
directory.
username.
available in
shadow file.
Shadow file
To view
shadow file.
Shadow file
Encrypted
password for
the user
abdulkalam.
Groups file
To view
group file
Groups file
Group id for
the user
abdulkalam.
User login
Abdulkalam
logging in .
User login
User
home dir
or login dir
userdel command
User account can
be deleted through
userdel command
Creating groups
New group is created by hand-editing the file /etc/group or by using
groupadd command.
Syntax:
groupadd groupname
Using usermod
command the user
abdulkalam is
added to group
India
Groups file
To view
group file
Groups file
The id number
assigned to the group
india is 501
Groupdel
command deletes
window group.
Group Administration
Create a directory
named product
and group named
sales.
Group Administration
Open the
group file.
Group Administration
The permission
for the product
directory is
changed.
Group Administration
After
Thegiving
chownthe
chown command
command
the owner
change is or
the file
changedowner.
directory from
root to suresh.
Changing owner
– Syntax:
chage [option] username
Option
-l lists the current password expiration.
-m set the min. days to change the password.
-M set the max. days to change the password.
-E specific expiration date for user account.
-I set inactive period (in days)
-W warning period, number of days before
expiration.
User administration
The password
The –M
expires field
command withis
updated
100 sets by
as +100
the
days fromdays.
maximum user
creation date.
User administration
Allowable
account inactivity
period after
which password
will expire.
User administration
The -W option
shows the
warning
message before
expiration.
User administration
The -E option is
for specific
expiration date
for an account.
Set userID
It allows an executable file to run under the user or group
security context with the permission of its owner.
(or)
Syntax
su - [user] -c command
Switch user
It executes root
privileged command
from the ordinary user
account.
Multi user login
Like unix operating system where multi user login can
be done, in same sense the Linux operating system
supports multi user login.
Joe, is the
user who log
in the second
terminal
Multi user
harry, is the
user who log
in the third
terminal
Multi user
wilson, is the
user who log
in the fourth
terminal
Multi user
W is the command
to list the users
logged in
Advanced Uses of VI and VIM
File Repositioning
Press G, Cursor go to last line of a file.
screen.
Advanced Reading and Saving
It is also possible to read a other file content in your
current files.
The following command help you :
– Go to exmode in a vi editor
– Syntax : r <filename>
– Example :r /root/file1
Syntax:
ex mode:1,$s/searchname/replacename/g
s - String of character
It searches and
replaces the localhost
as www.example.com.
ex mode : search and replace
To display the
output of another
file named test in
the current file.
Advanced Reading and Saving
File contents.
Set number
To assign numbers
to all line in vi
editor.
Set all
The output of ls
command is
redirected to the
Herenamed
file the file
ex.is
overwritten by the
output of ls
command.
Redirecting Input and Output
The output of ls
command is
redirected to the
file named ex1.
Redirecting Input and Output
Example: ls -l | more
file1.
For example:
If there is any
If there is no
error messages
error the output
while execution
will be redirected
the error message
to the ex2 file.
will be redirected
to the file ex1.
tee Command
tee is useful to save the output at various stages from
a long sequence of pipes.
Example:
awk ‘/bash/ { print }’ /etc/passwd
awk command
1 - compress
2 - GNU gzip
3 - bzip2.
Compression command
compress:
uncompress:
The actual
size of file is
This
107 bytes.
compresses
the file a.
The compressed
file is indicated by
the .z extension.
This Thus the file
uncompress size is
the file a. compressed to
39 bytes.
Compression with gzip
gzip utility compresses file .
gunzip decompresses them.
To compress a file, enter the command gzip and the
filename.this replace the file with compressed
version of it,with the extension .gz.
To decompresses a gzip file use command gunzip.
Syntax:
gzip filename (compression)
gunzip filename.gz (decompression)
Compression with gzip
The actual
size of file is
gzip command
107 bytes.
compresses the
file a.
The compressed
file is indicated by
the .gz extension.
Thus the file
This size is
uncompress compressed to
the file a. 38 bytes.
Compression with bzip2
It compresses files using the burrows-wheeler block-
sorting text compression algorithm and huffman
coding.
You compresses files using the bzip2 command and
decompresses with bunzip2.
The bzip2 command create a file with the extension
.bz2
Syntax:
bzip2 filename (compression)
bunzip2 filename.bz2 (decompression)
Compression with bzip2
The actual
size of file is
bzip2
107 command
bytes.
compresses the
file a.
The compressed
file is indicated by
the .bz2 extension.
This Thus the file
uncompress size is
the file a . compressed to
51 bytes.
Creating Archives
Tar:
Options:
It create
backup for the
files a,b,c,d,e
and f in
backup.tar.
The backup
files are
indicated by
.tar extension.
tar command
tf options
display all the
file in backup .
tvf options
displays along
with the user
and group
names.
tar command
If incase we
miss the file
then we can
extract those
file back using
xvf options .
Printer-configuration
Printer-configuration
Command to
configure the
Printer
Click New
option to
add printer
Printer-configuration
Click Forward
option to add
printer queue
Printer-configuration
Choose
locally-connected
option for local
printer
Printer-configuration
Choose
forward option to
proceed to next step.
Printer-configuration
Choose apply
option for
What you have
selected
Printer-configuration
lpq is a command to
view the queue in printer
Printer-configuration
lpq is a command to
view the queue in printer
Printer-configuration
lpq is a command to
view the number of
queue in printer
Introduction to process
It shows the
process ancestry
for all process
running on the
system.
ps –a command
Display all
processes
excluding
processes not
controlled by
this terminal..
ps –l command
It list the
processes along
with the owners
id.
ps –x command
Display all
processes
including
processes
controlled by
this terminal.
ps –u command
It list the
processes along
with the user
name.
kill process
• Kill command is used to send a particular process to
get clear.
and id
– For example:
– Second method is
• Syntax :
»Give the execute permission the script file
through chmod command
»Run the file by ./<file name>
Bash Shell Scripting
Get in to
the vi editor
to create
script file
Bash Shell Scripting
It denotes we
are using
bash shell
scripts
This script
executes the
system hostname
and date
Executing script - First Method
Bash
example
(file name)
to execute
the script
Output is
shown in the
terminal
Executing script - Second Method
No execute
permission
for a file in
default
Permission
is set to the
file, as
executable
Second Method
./ example
(file name)
to execute
the file
Arithmetic Calculation
Example
script file for
calculation
Arithmetic Calculation
Using read
statement we
read the value
Using expr
for A and B
we can
add values
The values are
entered for input
The output is
displayed
Partitions
0X 5 - Extended
0 X 82 - Linux swap
0 X 83 - Linux
0 X fd - Linux RAID
0 X 8e - Linux LVM
Partitioning
In Linux, partitions can be created by either of the
following three utilities
– fdisk
– sfdisk
– GNU parted
fdisk
fdisk
- Fixed Disk
- Menu driven programs to create and
delete partitions
To create partition
in the device hdb
Partitioning with fdisk
Type h or help to
shows list of
available commands
in fdisk
Partitioning with fdisk
Type p to display
the available
partitions
Partitioning with fdisk
Instead of restarting to
update the partition
table just enter the
command partprobe.
Partitioning with fdisk
Thus a new
partition named
hdb6 is created
Red Hat Linux Filesystems
ext2 : Older standard Linux file system supporting for filenames and
large file sizes.
ext3 : Standard Red Hat Linux file system, used for all hard disk
volumes under Red Hat Linux by default.
Syntax:
Current partitions
are displayed here
Creation of file system
Hdb6,7and 8 are
newly created
partitions.
Creation of file system
It creates ext2
file system for
the device hdb6.
To view the file system type
Dumpe2fs : this command is used to view which file
system we are using.
Syntax :
dumpe2fs <partitions>
Example:
dumpe2fs /dev/hda1
To view the file system type
It displays the
file system
information's.
Sparse_super
represents the
ext2 file system.
Mke2fs command
Mke2fs : This command is used to create file system.
Syntax :
mke2fs [options] device
Example:
mke2fs /dev/hda1 (it will create ext2 filesystem for
hda1 partition)
mke2fs –j /dev/hda1 (it will create ext3 filesystem
for hda1 partition)
Creation of file system
It creates ext2
file systems for
device hdb7.
View the file system type
Sparse_super
represents the
ext2 file system.
Converting ext2 to ext3 file system
has_journal
represents the ext3
file system thus the
ext2 is converted to
ext3
Mount command
Syntax :
tune2fs –j <partitions>
Example:
tune2fs -j /dev/hda1
View the file system type.
free command
display
information
about free and
used memory
on the system.
vmstat
Report virtual
memory statistics
top
Displays top
CPU processes
top
It displays the
listing of most
CPU-intensive
tasks on the
Daemon Process
standalone daemon
Transient daemon
Daemon Process
--list options
used to list the
service.
checkconfig command
--list option
lists xinetd
services also.
checkconfig command
--list
--deloptions
--add Now
options
option shows
--list
used
deletes
sendmail
to add service
alloptions
linksa service,
used
for isto
the
not
listthere.
creating
service thelinks
inhttpd
allin
defaults
runlevel service.
runlevels.
directories.
Standard Boot loader
• There are two standard boot loader are used in
Linux
• GRUB
• Grand unified boot loader
• LILO
• Linux loader
GRUB
• GRUB Grand Unified Boot Loader
Copy the
lilo –v lilo.conf.anaconda
installs lilo to lilo.conf (lilo
boot loader. configuration file).
Lilo installation
• /boot/grub/grub.conf
• grub-install /dev/hda
• grubby –bootloader-probe
Remove
The optionsthis options
rhgb quiet
towill
boot through
start text
xserver
whilemode.
booting.
Grub Configuration
Now system is
booting in text mode .
GRUB Configuration
Now system is
booting in text mode .
GRUB Configuration
Now system is
booting in text mode .
GRUB Configuration
Now system is
booting in text mode .
GRUB Configuration
Now system is
booting in text mode .
GRUB Configuration
Now system is
booting in text mode .
GRUB Configuration
Now system is
booting in text mode .
GRUB Configuration
Now system is
booting in
graphical mode.
In EL-4 redhat-config-
* tools are renamed as
system-config-*.
GRUB installation
Now the
boot loader
is lilo.
Open the
configuration
file.
GRUB installation
Here we can
see the
appended
password.
GRUB installation
Type p to enter
Here yougrub
canpassword
see the if
you prompting
grub loader want to go to
for thesingle
OS touser
boot.mode.
GRUB installation
Enter the
password
here.
GRUB installation
Enter 1 to get in
to run level 1.
GRUB installation
Press b to
boot.
Red Hat Packet Manager
(rpm)
Using rpm command
• rpm command is used to manage and install software
packages.
rpm –q a
command for
querying a
particular package
Using rpm command
rpm –q checks
whether the above
package is installed.
rpm –e command
will remove the
http package.
Using rpm command
Go to
Redhat
directory.
Using rpm command
Go to
RPMS
directory.
Using rpm command
rpm –qpl
shows the
list of files in
a package
before
installation.
Using rpm command
rpm –ivh is
to install a
package.
Using rpm command
rpm -Uvh, to
upgrade a package.
Using rpm command
rpm –qi
shows the
information
about the
package after
installation.
Using rpm command
ifconfig :
-shows the ip address of the active interfaces with hardware
address.
-it can show ip address of a particular interface by taking the interface
name as argument
example:
ifconfig eth0
ip a :
- simply shows the ip address of all interface.
Ifconfig command
Displays
information on
all currently
active interfaces.
Ifconfig command
Here it displays
the information
of eth0 interface.
ip a command
Syntax:
ifup <interfacename>
Ifdown:
-ifdown command is used to deactivate the interface
Syntax:
ifdown <interfacename>
ifup / ifdown command
It deactivate the
the interface
eth0.
ifup / ifdown command
It activates the
interface eth0.
ifup / ifdown command
Ifconfig:
- to assign temporary ip address to the interface.
Syntax:
ifconfig <interfacename> <ipaddress> subnetmask
<subnetmaskaddress> broadcast <broadcastaddress>
Ip a a :
- to assign additional ip address temporarily
Syntax:
ip a a <ip/subnetmaskaddress> dev <interfacename>
Assigning ip address
To assign permanent
ip address using
netconfig command.
Assigning ip address
To assign ip
address
automatically
from dhcp server.
Assigning ip address
To assign ip
address manually.
Assigning ip address
Using ifconfig
command ip
address can be
assigned.
ip a command
shows the
assigned ip
address.
Assigning ip address
When network
service is restarted,
the ipaddress
As said earlier, assigned through
ifconfig is used to ifconfig to the
assign ip address device is removed.
temporarily.
Assigning ip address
To update ip
address the
network service
is restarted.
ip a command
shows the
assigned ip
address.
Assigning ip address
ip address can
be assigned
temporary using
ip a a command.
Assigning ip address
Ip address can be
removed using
ip a d
command, once
network service
is restarted it get
removed.
Router configuration
It checks whether
www.example.com
is up and connected
to the network.
ping command
It checks whether
192.168.0.253 machine
is up and connected to
the network.
ping command
-b option used
to ping a
broadcast
address.
ping command
-c options stops
sending packets
after the
specified count.
LVM Structure
• LVM structure
• Physical volume:
Type p to check
Create partition
how many
using fdisk
partitions available
command
in hard disk
LVM Configuration
Here 4 partition
is created with
equal sizes of
100mb through
n option.
LVM Configuration
Newly created
partition is
listed below as
hdb6,7,8 & 9.
To know the
partition id, use
the option l.
LVM Configuration
Here 8e represent
lvm partition id.
LVM Configuration
Now
partition id is
changed to
8e(LVM)
LVM Configuration
Previous versions of
redhat needed to
restart system after
creating partition. In
current version to
avoid restart we use
partprobe.
LVM Configuration
Physical volume is
Pvdisplay command
created
thefor lvm of
show details
partition(hda6.7.8&9)
physical volume
LVM Configuration
pvdisplay command
displays the physical
volume size.
LVM Configuration
Vgcreate
vgdisplay commandcreates
groupthe
displays as test0 for
lvm partition
information about hdb6
volume group test0.
LVM Configuration
lvcreate creates a
logical volume and we
assign name as data in
the test0 group
lvdisplay,
displays the
information
about logical
volume.
LVM Configuration
Make2fs, creates
an ext3 file
system for data.
(logical volume)
LVM Configuration
See the
content of
fstab file.
LVM Configuration
The above
command shows
the increased
space of logical
volume data.
LVM Configuration
Remove the
mounted entry of
logiacl volume
(data) in fstab file
LVM Configuration
After removing
logical volume
save and exit the
file.
LVM Configuration
After
We candeactivated
remove the
volume
Remove the logical
group will
group be is
first removed
we must
volume name data
usinglvremove
decativate vgremove
the volume
using
groupcommand.
using vgchange
command.
command.
RAID
• RAID means Redundant Arrays of Independent
Disk.
• RAID is a method of storing data across several
disks to provide greater performance and
redundancy.
• In effect, you can have several hard disks treated
as just as one hard disk by your operating system.
Types of RAID
• RAID can be implemented on a
• Hardware level
or
• Software level
Hardware RAID
PC card.
RAID disk.
Software RAID Levels
RAID levels Capabilities Description
rpm -q command
checks, whether the
mdadm installed
RAID
The partition is
created using
fdisk command.
The
Nowpartition
the screenis lists
created using
the partitions.
fdisk command.
Raid Configuration
4 Partitions is
created using n
option with equal
size of 100 mb
Raid Configuration
To set the
partition type use
t options.
Raid Configuration
Previous versions of
redhat needed to
restart system after
creating partition. In
current version to
avoid restart we use
partprobe.
Raid Configuration
Watch command
shows the online
status of raid
devices.
Raid Configuration
Here we see
status of each raid
disk.
Raid Configuration
mdadm –detail
command show the
detail information
about the raid
devices.
Raid Configuration
Now go to /data
directory and
create the file
name is file1 using
df command showdd command.
free & used space
for the raid devices
& partitions.
Raid Configuration
Mdadm –query
command show the
information about
particular raid device
& partitions.
Raid Configuration
Raid Configuration
Mdadm – manage
command set fault or
fail particular
Cat /proc/mdstat
partitions (/dev/hda9).
command show disk
the disk is failed.
Raid Configuration
Watch command
shows the online
status of raid
devices.
Raid Configuration
quotacheck
quotaon
quotaoff
edquota
repquota
Quota tools
Quotacheck:
It scans the file system for the current disk usage and update the
aquota.user file.
Quotaon:
It turns on the quota.
Quotaoff
It turns off the quota.
Edquota:
It is used to set disk quotas for a user.
Repquota:
It displays summary of disk quotas and and the quota usage .
Implementing quota
To implement disk quota for an user, set the user quota for the home
The following slides will guide you how to implement disk quota for
particular user.
Implementing quota
Open the
fstab file.
Implementing quota
Replace this
defaults as
usrquota.
Implementing quota
Now usrquota
is assigned to
the /home
directory.
Implementing quota
Here Remount
you can see
thethat
the/home
user quota is not
directory
updatedtofor the /home
update.
directory.
Create quota
database file named
It aquota.user
checks the to hold
thequota
validity of quota
information
database of the for all
users.
/home directory.
Implementing quota
Turn on the
quota.
Implementing quota
Let us set
disk quota for
the user jack.
Implementing quota
To assign the
quota for the
user jack.
Implementing quota
The
This soft maximum
limit will memory
Blocks To set soft
To set Inode
hard represents space for a user.
just issue alimit
warning if This will
represents diskthefor
deny
the
user to access, if
limit fornumber heand
inode. of files exceeds soft limit.
inode .
space inheKB.
exceeds the quota limit.
directories can be
accessed by the user.
Implementing quota
It displays
summary of
disk usage.
Options:
Syntax:
umount <mountpoint>
mounting CD-ROM
To mount the
CDROM on the
mounting
point
/mnt/cdrom
mounting CD-ROM
Unmount the
CDROM
after access
Unmounting cd-ROM
To eject the
CD from the
CD Drive.
Mount /unmount floppy
To mount the
floppy on the
mounting
point
Unmount the /mnt/floppy.
floppy after
access.
Mounting Hard drive partitions
Example :
mount –t ext3 /dev/hda4 /mnt/data
Mounting Hard drive partitions
MountTocommand
mount the hard disk
partition
lists the mounted (hda3 of ext3
file system) in /data
device.
directory.
Mounting NFS
Mounting NFS (network file sharing) :
showmount –e remote_server
– When the host and share name are known, the following command is used
to connected the network file system to the local file system tree
Showmount command
displays the shared
directory on
192.168.0.253
machines. .
Mounting NFS
We mount the el
directory from remote
machine into our /mnt
directory .
Mounting NFS
Mount command
shows information's
about mounted
devices.
Mounting NFS
Open the
fstab file.
Auto mount
It represents
ItItItrepresents
represents
represents
thefiledevices.
It represents
systems.
thethemount
different dump
options
points.the fsck.
forfrequency.
mounting the
file system.
Autofs
Autofs service mounts the file system automatically
when the user access the mounting point.
/etc/auto.master
/etc/auto.misc
Autofs configurations files
/etc/auto.master:
/etc/auto.misc:
Open the
auto.master
file.
Autofs configurations files
Mounting
information's
should be
entered here.
Autofs configurations files
This
Map Itspecifies
represents
file having
when
to the mounting
information's
unmounted about
the
theauto point. tofile
file mounted
systems be
mounted.
system.
Autofs configurations files
Open the
auto.misc
file.
Autofs configurations files
Mounting device
information's are
entered here.
Autofs configurations files
Option :
-e : edit the crontab file.
-l : lists the content of the crontab.
-r : remove the content in crontab.
Scheduling Task: cron
Now open
the file.
Scheduling Task: cron
If any
values is
not
represented,
we can
mention *
First
This field
Secondfield
files
Command
represents
field
indicates
indicates,
can be
minutes(0
indicates
the
day day
month of
of the The above command
given in
-59).
hours(0-
monththefield
(1-12) (1- gets executed at 13
this
23)
week(0-6)
31) hours, 34 minutes as
daily basis at same time.
Scheduling Task: cron
The service is
Chkconfig command
restarted using
enables the crond
service crond
services in runlevel
restart.
345 in next boot time.
Scheduling Task: cron
Automatically
“hello” message
gets displayed in
terminal.
Scheduling Task: cron
The permission is
denied to the normal
user joe when the
user attempts to the
file.
Now open
the file.
Scheduling Task: cron
Crontab –l command
used to display content
of crontab file.
Scheduling Task: cron
Automatically
“hello joe “message
gets displayed in
terminal2.
DNS
• DNS - Domain naming system.
• DNS configuration.
caching-nameserver
/var/named/named.local
Daemons - named
Port number - 53
DNS Configuration
Install bind-utils
Install
which bind, this
provides
package
many includes
utilities like
web page
host, digmanuals
and
and documentation
nslookup
Install caching-
name server which
provides a working
named.conf
configuration file
DNS Configuration
Open the
configuration
file named.conf.
DNS Configuration
Enter the
Enter the IP
reverse
fileaddress
name. in
reverse
order.
DNS Configuration
Open the
forward file.
DNS Configuration
Open the
example.rev
file.
DNS Configuration
DNS Configuration
Replace localhost to
server1.example.com
using as below.
DNS Configuration
Open the
resolve.conf
file.
DNS Configuration
Now named
service is
restarted.
DNS Configuration
Nslookup is a dns
diagnostic tool used to
Using
query nslookup
a dns server. you can
identifies nameserver for
Using nslookup you can
particular doamin.
identifies address for
Using nslookup
particular you can
FQDN.
identifies FQDN for
particular IP address.
DNS Configuration
Mention the
nameserver ipaddress
and domain name here.
DNS Configuration
Open the
forward file.
DNS Configuration
Open the
reverse file.
DNS Configuration
Now named
service is
restarted.
DNS Configuration
Open the
configuration
file named.conf.
DNS Configuration
Packages - httpd
Daemons - httpd
Portnumber - 80
Web server configuration
Now package
httpd query theis
package
installeditusing
show
rpmpackage
command.is
installed.
Web server configuration
InHere
virtual host the
field we
specify e-mail
Here
enter specify
ipaddress the
or base
fully
Here
address
Now specify
saveof the
and the
quit
directory
qualified from
domain which
thehostname
administrator
the for your
httpd.conf thefile.
html files
address. will be
server.
websaved..
server.
Web server configuration
After typing
Let ussave
create
and quit html
the file.
file .
Web server configuration
To allow
Directives thatonly
canabe
particular
overriddenuserbytothe
access
Setting up
entries in ansite
our web we can
.htaccess
/var/www/html/
add directory access
file. session
control directive
inside .
virtualhost
session.
Web server configuration
httpd password is
stored in htpasswd
file.
Web server configuration
Here
Twowe place two
domains are
domains
used ininthe
a single ip
name of
address
exampleandandwe can
test.com
inplace number of
a single ip address
domains using single
192.168.0.20.
IP address.
Name-based virtual hosts
An ip address is
mentioned in the
virtualhost field.
Name-based virtual hosts
The server
fully qualified
domain name is
described here.
Name-based virtual hosts
A Directory is created
in the specified path as
above here copy
test.com webpage..
Name-based virtual hosts
Httpd service is
restarted.
Name-based virtual hosts
Squid
Packages - Squid
Daemons - Squid
Install the
squid package.
Open the squid
configuration file.
Squid Configuration
3128 is the
http port.
Squid Configuration
Select
preferences to set
the proxy server.
Squid Configuration
To make use of encrypted communications, a client must request the https protocol.
Certificate - conf/ssl.crt/server.crt
Query is made to
check whether the
mod_ssl package is
installed. if not,
install the packages
Apache Encrypted Web Server
To generate the
certificate signature
request.
Apache Encrypted Web Server
The self signed certificate
can be installed using the
command
make testcert.
Apache Encrypted Web Server
Click here to
view the
certificate.
Apache Encrypted Web Server
It listens for any mail messages received from other hosts and
address to user on the network host it serves.
Query is made to
check whether the
sendmail package is
installed. if not, install
the packages.
Sendmail Configuration
Installing packages
using rpm command.
Sendmail Configuration
Sendmail
configuration file.
Sendmail Configuration
commenting
The word dnl isthis linein
added
voids
the to send mail
beginning to line
of this the
other systems
to comment.
Sendmail Configuration
M4 is a macro language
that can help to configure
the sendmail.cf file, using
sendmail.mc
Sendmail Configuration
Open the
Virtusertable file, for
mapping user virtual
domain addresses.
Sendmail Configuration
The virutusertable
configuration helps to
define the domain name
along with fully
qualified domain name.
Sendmail Configuration
Open a local-
host-file.