Search for notes by fellow students, in your own course and all over the country.
Browse our notes for titles which look like what you need, you can preview any of the notes via a sample of the contents. After you're happy these are the notes you're after simply pop them into your shopping cart.
Title: linux unit 1 mumbai university notes
Description: mumbai university notes mu.ac.in
Description: mumbai university notes mu.ac.in
Document Preview
Extracts from the notes are below, to see the PDF you'll receive please use the links above
Linux Administration
UNIT 1
Ch 1 : INTRODUCTION
An Introduction to UNIX, Linux, and GNU
...
Various organizations that have adopted it,
including some government departments and city administrations
...
Linux truly has become a viable operating system, especially in the server market
...
The computer programs that allocate the system resources and coordinate all the details of the
computer's internals is called the operating system or kernel
...
The shell is a command
line interpreter; it translates commands entered by the user and converts them into a language that is
understood by the kernel
...
There are various Unix variants available in the market
...
Linux is also a flavor of Unix which is freely available
...
A user can also run multiple programs at the same time; hence UNIX is called multitasking
...
The Unix operating system found its beginnings in MULTICS, which stands for Multiplexed
Operating and Computing System
...
Sweta Chheda
Page 1
2
...
4
...
6
...
In 1969 Bell Laboratories pulled out of the project
...
He liked the
potential MULTICS had, but felt it was too complex and that the same thing could be done
in simpler way
...
UNICS stood for
Uniplexed Operating and Computing System
...
Ken Thompson teamed up with Dennis Ritchie, who wrote the first C compiler
...
The following year a version of Unix known as the Fifth
Edition was first licensed to universities
...
These two branches are known
as SVR4 (System V) and BSD
...
While
there he and two graduate students, Bill Joy and Chuck Haley, wrote the first Berkely version
of Unix, which was distributed to students
...
The Berkeley version of Unix is known as BSD,
Berkeley Software Distribution
...
For several years SVR4 was the more conservative, commercial, and well supported
...
Probably the biggest cosmetic difference between
them is the way the ps command functions
...
Q) Architecture of UNIX OS:
Here is a basic block diagram of a UNIX system:
Prepared by Prof
...
It interacts with hardware and most of the
tasks like memory management, tash scheduling and file management
...
When you type in a command at your
terminal, the shell interprets the command and calls the program that you want
...
C Shell, Bourne Shell and Korn Shell are most famous shells
which are available with most of the Unix variants
...
cp, mv, cat and grep etc
...
There
are over 250 standard commands plus numerous others provided through 3rd party software
...
Files and Directories: All data in UNIX is organized into files
...
These directories are organized into a tree-like structure called the filesystem
...
ii) Larger, more complex systems are guaranteed to contain larger, more complex bugs, and
debugging is a chore that should be avoided
...
iv)
Prepared by Prof
...
ii) Programs with a single purpose are easier to improve as better algorithms or
interfaces are developed
...
3) Reusable Components:
i) This Make the core of application available as a library
...
iii) Examples include the dbm database library, which is a suite of reusable functions rather
than a single database management program
...
That is, they transform their input
and produce output
...
iii) This kind of reuse is enabled by reusable component feature
...
ii) This is good choice for application development
...
6)
Flexibility:
i) This means writing the program so that its network-aware and able to run across a
network as well as on a local machine
...
Try to be
as flexible as possible in your programming
...
iv) Never assume that you know everything that the user might want to do
...
You can obtain the sources for the kernel to compile and
install it on a machine and then obtain and install many other freely distributed
software programs to make a complete Linux installation
...
Most of the utilities come from the GNU Project of the Free
Software Foundation
...
Fortunately many people have put together ready-to-install distributions(often called
flavors), that contain not just the kernel but also many other programming tools and utilities
...
Prepared by Prof
...
Some well known commercially backed distributions are Fedora (Red Hat), openSUSE
(SUSE), Ubuntu (Canonical Ltd
...
Q) Distinguish between Windows and Linux/Unix
...
No case sensitive
...
Virus affection is more
...
2)Linux/Unix :
Linux treats everything as a files
Case sensitive
Properly design shell for each user
Virus affection is less
CPU + I/O + Memory utilization is less
...
Linux owes its existence to the cooperative efforts of a large number of people
...
2
...
but for Linux systems, these additional programs have been written by
many different programmers and have been freely contributed
...
The Linux community (together with others) supports the concept of free software, that is,
software that is free from restrictions, subject to the GNU General Public License (the
name GNU stands for the recursive GNU’s Not Unix)
...
Although there may be a cost involved in obtaining the software, it can thereafter be used
in any way desired and is usually distributed in source form
...
The Free Software Foundation was set up by Richard Stallman, the author of GNU Emacs,
one of the best-known text editors for UNIX and other systems
...
Stallman is a pioneer of the free software concept and started the GNU Project, an attempt
to create an operating system and development environment that would be compatible with
UNIX
...
The GNU Project has already provided the software community with many applications
that closely mimic those found on UNIX systems under the license of GNU
...
Sweta Chheda
Page 5
8
...
Many other packages have been developed and released using free software principles
and the GPL, including spreadsheets, source code control tools, compilers and
interpreters, Internet tools, graphical image manipulation tools such as the Gimp, and two
complete object-based environments: GNOME and KDE
...
There is now so much free software available that with the addition of the Linux kernel it
could be said that the goal of a creating GNU, a free UNIX-like system, has been
achieved with Linux
...
1)Components of Linux System
Linux Operating System has primarily three components
Kernel - Kernel is the core part of Linux
...
It is consists of various modules and it interacts directly with the underlying hardware
...
System Library - System libraries are special functions or programs using which application
programs or system utilities accesses Kernel's features
...
System Utility - System Utility programs are responsible to do specialized, individual level tasks
...
Sweta Chheda
Page 6
1
...
2
...
In fact, almost all programs written for UNIX can be compiled and run on Linux
...
Some commercial applications sold for commercial versions of UNIX can run unchanged
in binary form on Linux systems
...
Linux was developed by Linus Torvalds at the University of Helsinki, with the help of UNIX
programmers from across the Internet
...
It began as a hobby of Linus Torvalds who was inspired by Andy Tanenbaum‘s Minix, a
small UNIX like system, but has grown to become a complete system in its own right
...
The Linux was having copyright but it can be freely distributed
...
Versions of Linux are now available for a wide variety of computer systems using many
different types of CPUs
...
Even some handheld PDAs and Sony‘s Playstations 2 and 3 run on Linux
...
Q) What is kernel mode v/s user mode?
Kernel Mode vs User Mode
Kernel component code executes in a special privileged mode called kernel mode with full
access to all resources of the computer
...
Kernel runs each processes and provides system services to processes, provides
protected access to hardwares to processes
...
User
programs and other system programs works in User Mode which has no access to system
hardwares and kernel code
...
Ch 2 : DUTIES OF SYSTEM ADMINISTATOR
Q) Who is a system administrator ?
The Linux System Administrator
1
...
2
...
3
...
If a user decide to have a particular application then we
can say that user has taken mantle of System Administrator
...
Precaution from Virus Attacks : When System is connected with internet there is prone
of virus attacks, attacks can be Distributed Denial of Service (DDoS) or e-mail macro virus
etc
...
Sweta Chheda
Page 7
5
...
6
...
‖
7
...
8
...
e
...
Q) Explain the duties of System Administrator
...
System administrators may be members of an information technology department
...
Duties of a system administrator
The duties of a system administrator are wide-ranging, and vary widely from one organization to
another
...
Other duties
may include scripting or light programming, project management for systems-related projects
...
User administration (setup and maintaining account)
2
...
Verify that peripherals are working properly
4
...
Monitor system performance
6
...
Install software
8
...
Monitor network communication
10
...
Implement the policies for the use of the computer system and network
12
...
A system admin must have a strong grasp of computer security
(e
...
firewalls and intrusion detection systems)
...
Sweta Chheda
Page 8
Graphical Desktop requires X SERVER
...
Web access requires Web Server
Whenever a server is connected to machines outside your physical control, security issues
arise
...
Most of the imaginable servers are turned on by default
...
This duty falls to the system administrator
...
To be aware of potential security nightmare to enable the services that system is not using and does
not need
...
Q) Installing and Configuring Application Software
...
For multiuser, an application is to be installed higher up in the Linux File Hierachy(only
system administrator can perform)
The administrator can limit which users may use which applications by creating a
―group‖ for that application and enrolling individual users into that group
...
/opt : if they are likely to be upgraded separately from the Red Hat Linux distribution itself
...
/usr or /usr/src : if they are upgrades of packages installed as part of Red Hat Linux
...
Q) procedure of creating and maintaining User Accounts
...
In Linux machine an account must be created for each user and system administrator
creates account for each user
...
System administrator can give option to users to change their own password
...
System administrator can configure a setting to prompt user that they must change
password periodically
...
System Administrator can stop person from accessing account i
...
System Administrator also
may delete the account
...
System administrator can make restriction on web surf like user can surf web but has
access to particular sites
...
System administrator can stop certain websites
...
Sweta Chheda
Page 9
Q) Explain Backing up and Restoring Files in Linux
...
Backup required to secure data from computer failure, some people may harm
others property or system if system administrator not perfect to handle it
...
We back up important files so that in the event of a failure of hardware, security,
or administration, the system can be up and running again with minimal disruption
...
Backup can be taken in high capacity tape drive and can be stored in disks
...
It‘s it more sensible to back up user accounts and system configuration files from the
distribution CDs
...
5
...
6
...
e
...
7
...
8
...
9
...
Q) Explain Monitoring and Turning Performance in Linux
...
System Administrator brings improvement in system performance
...
System Administrator takes some performance decision at installation time while others
are added later
...
A good example is the use of the hdparm utility, to squeeze the best performance from your
equipment, monitor your system carefully and use Linux built-in configuration wisely
...
Proper monitoring allows you to detect a misbehaving application that might be consuming
more resources than it should or failing to exit completely on close
...
careful system monitoring and diagnostic practices give you an early heads-up when a
system component is showing early signs of failure, so that any potential downtime can
be minimized
...
Careful system monitoring plus wise use of the built-in configurability of Linux allows you
to squeeze the best possible performance from your existing equipment
...
Prepared by Prof
...
There is a common thread in Linux system administration, something that is a constant
presence in everything you do, it is the security of the computer and data integrity
...
The system administrator‘s task, first and foremost, is to make certain that no data on the
machine or network are likely to become corrupted, whether by hardware or power
failure, by misconfiguration or user error (to the extent that the latter can be avoided), or
by malicious or inadvertent intrusion from elsewhere
...
Prevention from serious attacks like DDoS, E-mail attacks and worms attacks
...
Firewalls as protection thereby enabling and disabling firewalls through network setup
...
Monitoring the Red Hat Linux security mailing list to make sure that all security advisories
are followed
...
If you are running Web, ftp, or mail servers, then make sure that passwords are not easily
guessed and not made available to unauthorized persons
...
Prevention of Intrusion
...
1
...
If there is a vulnerability in a system, they will find it
...
The Linux development community is quick to find potential exploits and to find ways of
slamming shut the door before crackers can enter by making available new, patched versions
of packages in which potential exploits have been found
...
First and best security tool is making sure that whenever a security advisory is issued,
you download and install the repaired package
...
As good as the bug trackers are, sometimes their job is reactive
...
5
...
And you‘ll be struck by how critical an issue
security is
...
Tools to monitor :
i
...
#top
iii
...
#watch
v
...
#iostat
vii
...
#mpstat
Ch 3: BOOTING AND SHUTTING DOWN
Q) What is Boot Loader?
A boot loader, also called a boot manager, is a small program that places the operating
system (OS) of a computer into memory
...
Prepared by Prof
...
If a computer is to be used with Linux, a special boot loader must be installed
...
An alternative boot loader, called GRUB (Grand Unified Boot loader), is used with Red Hat
Linux
...
The primary advantage of LILO is the fact that it allows for fast boot-up
...
LOADLIN is sometimes used as a backup boot loader for Linux in case LILO fails
...
Q) Explain Booting Sequence or Boot Process of Linux OS with the help of diagram
...
Have you ever
wondered what happens behind the scenes from the time you press the power button until the
Linux login prompt appears?
The following are the 6 high level stages of a typical Linux boot process
...
Sweta Chheda
Page 12
Q) BIOS
BIOS stands for Basic Input/Output System
Performs some system integrity checks
Searches, loads, and executes the boot loader program
...
You can press a key (typically F12
of F2, but it depends on your system) during the BIOS startup to change the boot sequence
...
So, in simple terms BIOS loads and executes the MBR boot loader
...
st
It is located in the 1 sector of the bootable disk
...
This has three components 1) primary boot loader info in 1
446 bytes 2) partition table info in next 64 bytes 3) mbr validation check in last 2 bytes
...
So, in simple terms MBR loads and executes the GRUB boot loader
...
Sweta Chheda
Page 13
S) GRUB (nov 12, april 13)
GRUB stands for Grand Unified Bootloader
...
GRUB displays a splash screen, waits for few seconds, if you don‘t enter anything, it loads
the default kernel image as specified in the grub configuration file
...
Grub configuration file is /boot/grub/grub
...
conf is a link to this)
...
So, in simple terms GRUB just loads and executes Kernel and initrd images
...
conf
Kernel executes the /sbin/init program
Since init was the 1st program to be executed by Linux Kernel, it has the process id (PID) of 1
...
initrd stands for Initial RAM Disk
...
It also contains necessary
drivers compiled inside, which helps it to access
the hard drive partitions, and other hardware
...
Init OR /sbin/init
/sbin/init is the very first process to be executed by kernel in RAM
...
d/rc
...
This
script starts system swap, checks the file
systems, and performs other system initialization
...
The default runlevel is set to 5
...
(Execute ‘grep initdefault /etc/inittab’ on your system to identify the default run level)
Next it reads /etc/rc
...
d/ functions to determine the procedure to use to set the default
system path, start and stop programs, find the process ID(PID) of running process and how to
log the success or failure of starting a program
...
d/rc, which is responsible for starting and stopping services
when the runlevel changes and determine the new runlevel
...
d directory are additional directories rc0
...
d, rc2
...
d, rc4
...
d,
and rc6
...
Prepared by Prof
...
Each of these directories contain scripts that are used to stop and start services for the runlevel
...
Run level 0 – /etc/rc
...
d/
When the Linux system is booting up, you might see various services getting started
...
OK‖
...
Run level 1 – /etc/rc
...
d/
Run level 2 – /etc/rc
...
d/
Run level 3 – /etc/rc
...
d/
Run level 4 – /etc/rc
...
d/
Run level 5 – /etc/rc
...
d/
Run level 6 – /etc/rc
...
d/
Please note that there are also symbolic links
available for these directory under /etc
directly
...
d is linked to /etc/rc
...
d
...
d/rc*
...
Programs starts with S are used during startup
...
Programs starts with K are used during shutdown
...
There are numbers right next to S and K in the program names
...
For example, S12syslog is to start the syslog deamon, which has the sequence number of
12
...
So,
syslog program will be started before sendmail
...
d/init
...
d/init
...
Eg: #etc/rc
...
d/httpd
...
By default the file /etc/inittab has runlevel 5 as default
...
Sweta Chheda
Page 15
Just change the number 5 to a number 3, so the line now looks like this:
id:3:initdefault:
Runlevel 1 lets you enter single-user mode
...
If you are having problem with your system, you would usually enter runlevel 1 by entering the
command during system boot, as shown below :
i
...
iii
...
v
...
Press the letter e
...
At the end of the line type init 1 and press Enter
...
Q) Runlevel Utilities:
There are many system utilities that helps to manage the system in different runlevels
...
shutdown : Brings the system to a powered -off state or can reboot the
system
...
halt : Powers down the system
...
reboot : Reboots the system
...
poweroff : Works the same as the halt command
...
chkconfig : Manages what runlevels services start and stop at
...
runlevel
: Displays the current and previous runlevels
...
init : Changes runlevels
...
So it‘s worth mentioning
them here
...
* clock – timezone information
* autofsck – automatic filesystem check during boot up
* network-scripts – folder contains interface configuration files ifcfg-lo, ifcfg-eth0 etc
...
Edit the files in /etc/sysconfig folder to make changes to your system
...
Sweta Chheda
Page 16
Q) Init and single user mode
This runlevel is used by sysadmins to perform routine maintenance
...
Only the root file system will be mounted in this runlevel and the system administrator is
provided with a shell
...
Also none of the deamons
will be running in this runlevel
...
You can simply exit from the
shell to boot it to the multiuser mode
...
GRUB same as above
...
So it is divided into two parts :an installer and a runtime module
...
The runtime module has the
info about all operating systems installed
...
LILO does not understand filesystems and boot images to be loaded and treats them as
raw disk offsets
Q) Explain GRUB
...
conf (or
/boot/grub/grub
...
This grub
...
About Grub
...
conf
Grub
...
There default file format
...
xpm
...
6
...
el5)
Prepared by Prof
...
6
...
el5 ro root=/dev/VolGroup00/LogVol00 rhgb quite
initrd /initrd-2
...
18-53
...
img
FIRST LINE: default=0 :This command tells the grub to boot the first listing beginning
with the title
SECOND LINE: timeout=5 : while the system boot it will wait up to 5 second user to select the
kernel
...
xpm
...
xpm
...
You
can create your own image
...
xpm
...
png –resize 640x480 –colors 14 splash
...
xpm
FOURTH LINE: Hiddenmenu : This command tells the grub not to display t he menu and to
boot the default kernel after the timeout expires
...
6
...
el5)
It will give the kernel label as the ―title Red Hat Enterprise Linux Server (2
...
18 - 53
...
2) kernel: This line tells the GRUB the location of the kernel as well as passes the parameter
to the kernel
...
ii
...
Quite : tells the system not to display detailed information about system booting
...
Q) Explanation of various boot options during booting with examples
Prepared by Prof
...
a:
Append the kernel argument before booting
...
To select the kernel to edit boot parameters press ‗ e‘
...
Sweta Chheda
Page 19
The entry to be edited is highlighted and ‗ e‘ is again pressed to edit at the grub prompt
...
To pass the argument to the kernel or to modify the kernel argument before booting
press ‗a‘
...
Sweta Chheda
Page 20
3
...
ii
...
conf file using the find command:
grub>find /grub/grub
...
Q) Service management –Enabling and disabling services:
On any system it is important to manage the running services
...
Prepared by Prof
...
For ex: in the /etc/rc
...
d directory (which contain s to runlevel 3) :
# ls /etc/rc
...
d/
The K stands for kill and S stands for Start
...
R) chkconfig command for service management
...
Sweta Chheda
Page 22
To ease the management of services at each runlevel, you can use the chkconfig command
...
ii
...
--list[name] shows the status of the services at each runlevels Eg:
#chkconfig –list sshd
--level
...
Eg:
#chkconfig sshd on
b)Using service command for service management:
Syntex: service <--status-all | service_name CMD>
Eg: #service sshd status
#service sshd start
#service sshd stop
Q) Differentiate between GRUB vs LILO
...
GRUB has two stages(because its too
overcomplicated to work as well, err |
means as easily as LILO)
...
LILO must be written again every time you
change the configuration file
GRUB does not
Prepared by Prof
...
The shutdown procedure for GNOME GUI desktop is as follows:
1)Choose Actions ? Logout from the top panel menu
...
2) Click the shutdown radio button
...
If not GUI then the command to shut down is /sbin/shutdown
...
Following things will happen after shutdown command is executed
...
ii) The shutdown program signals the init program to change to a different runlevel,
i
...
runlevel 0 is used to shutdown the system thereby calling the rc scripts of the
directory /etc/rc0
...
SHUTDOWN Command : The shutdown command has options to alert users on the system when
it is going down and to set up a shutdown at a particular time
...
A boot sequence is the set of operations the computer performs when it is switched on that
load an operating system
...
Sweta Chheda
Page 24
iii)
iv)
v)
vi)
Look for a boot sector
Boot sector
First sector of the disk
Load boot sector into memory
Ch 4 THE FILE SYSTEM
Q) FILE SYSTEM STRUCTURE
...
For administrators, programmers, users, and installed software, knowing how and where
the files are stored on the system is critical for proper system operation
...
Fortunately, Red Hat has Chosen to follow the standards outlined in the File system
Hierarchy Standard (FHS)
...
The FHS provides specific requirements for the placement of files in the directory structure
...
Basically two categories
of file information exist:
shareable or un shareable, and
variable or static
...
Variable files contain Information that can change at any time on their own, without anyone actually
Changing the file
...
A static file contains information that does not change unless a user changes it
...
If you have a /usr partition that fills up in Linux, you can create another file system called
/usr/local and move your /usr/local data from /usr to the new file system definition
...
This trick wouldn‘t work on a Windows machine, because Windows maps its file locations to
static device disk definitions
...
Linux‘s file system management is another good reason to use Linux on your production
servers instead of Windows
...
Sweta Chheda
Page 25
Q) ACCORDING TO THE FHS, THE ‘/’ DIRECTORY MUST CONTAIN OR HAVE LINKS
TO THE FOLLOWING DIRECTORIES: (NOV’12)
The ‘/’ directory
The ‗/’ directory is called the root directory and is typically at the top of the file system
structure
...
Figure shows a file system with the / directory mounted as the only partition, with all
other directories mounted beneath it
...
According to the FHS, the / directory must contain, or have links to, the
following directories:
_ bin — This directory contains command files for use by the system administrator or other users
...
_ boot — On Red Hat systems, this is the directory containing the kernel, the
core of the operating system
...
_ dev — This directory contains files with information about devices, either hardware or
software devices, on the system
...
Sweta Chheda
Page 26
_ etc — This directory and its subdirectories contain most of the system configuration files
...
Networking related files are
in the subdirectory sysconfig
...
_ home — This directory contains the directories of users on the system
...
_initrd--- This directory is used as a mount point when the system is booting
...
_ lib — The shared system files and kernel modules are contained in this directory and
its subdirectories
...
_ mnt — This directory is the location of the mount point for temporary file systems, such as
a floppy or CD
...
_ proc — Information about system processes is included in this directory
...
Don‘t confuse this with the / directory, which
has the same name
...
_selinux--- This directory is similar to the /proc directory in that it contains information about the
selinux stored in the memory of the running kernel
...
_sys--- This directory is the mount point for a virtual file system of type sysfs that is used to
hold information about the system and devices
...
_ usr — This directory is often mounted on its own partition
...
Subdirectories can be used for applications, typically under /usr/local
...
Q)what is in a File system?
Again file system divided into two categories:
User data - stores actual data contained in files
Metadata - stores file system structural information such as superblock, inodes, directories
Q)Basic Commands in Linux
...
It lists information about files on
the system
...
You
can use several additional options with ls to show you all sorts of detailed aspects of a file as
well
...
A common
usage of ls is ls-la, which lists files in a longer format, and lists all files, including hidden
files
...
Sweta Chheda
Page 27
cp : cp is Unix‘s copy command
...
To copy filename-a to filename-b, type: cp filename-a filename-b
...
To remove a file, type rm filename
...
If moving files within a file system, mv operates more like a
rename than a move, because just the logical name and logical location are changed
...
To move filename-a to filename-b, type mv filename-a filename-b
...
Maintaining
proper file ownership helps ensure that only the people who own the file have access to it,
since world accessible permissions can be severely limited without inhibiting the use of
the file to its rightful owner
...
chgrp : chgrp changes only the group ownership of a file or directory
...
chmod : This command changes file access permissions, handy when you want to limit
who can and cannot read, write or execute your files
...
chmod also determines if the program text should be saved on the swap device and
whether or not the command should be run under the user ID of the owner or under the group
ID of the group owner
...
One way
is the numeric method, which sets the user, group and world permissions at once
...
So if you set a file‘s
permissions to 444, you are setting it to be only readable to user, group, and world owners
...
So to make a file writeable
(4), readable (2), and executable (1) by user, and not accessible in any way to anybody else,
you set it to permissions number 700
...
To change a file‘s permissions to 700,
type chmod 700 filename
...
The
letters used to change owner permissions are u for user, g for group, and o for other
...
The +
and – signs are used to indicate if the permission is being added or removed from the file
...
Q) Standard and Non-standard Linux File System
...
A consequence of this friendliness to other operating
systems is that Linux can read and write to several different file systems that originated with other
operating systems much different from Linux
...
One reason that Linux supports so many file systems
Prepared by Prof
...
The VFS layer is a data abstraction
layer between the kernel and the programs in user space that issues file system commands
...
They are compiled into the kernel by
default
...
a) ext2 : (april’13)
ext2 has become the standard file system for Linux
...
Since then there have been a few new features added
...
ext2 was designed to make it easier for new features to be added, so that it can constantly
evolve into a better file system
...
ext2 also has the added bonus of being designed to be POSIX compliant
...
In case user processes fill up a file system, ext2 normally reserves about 5 percent of
disk blocks for exclusive use by root so that root can easily recover from that situation
...
2
...
Also features journaling and backward compatibility with ext2
...
You can upgrade an ext2 file system to an ext3 file system without losing any of your data
...
Under ext2, when a file system is uncleanly mounted, the whole file system must be
checked
...
ext3 keeps a record of uncommitted file transactions and applies only those transactions
when the system is brought back up
...
This capability can come in handy if you need to revert to an older kernel that is not aware
of ext3
...
ext3‘s
journaling feature involves a small performance hit to maintain the file system transaction
journal
...
c) Reiserfs :
It is Journaling fs
...
Special for dir containing thousand of files
...
d) systemV :
Prepared by Prof
...
ufs :
ufs is used in Solaris and early BSD operating systems
...
FAT :
Windows file system
...
Can handle very large file system
...
FAT32 can handleup to TB in size
...
IBM JFS(Journaling file system)
Linux support for JFS is written bye IBM
...
a) FreeVxFS :
Veritas filesystem
Features are access control list, journaling, online backup
Versions :
v1 : original VxFS
v2: Supports for fileset and dynamic inode allocation
v3: latest support quotes and large files
b) GFS :
Features : Enables multiple server to have read/write access to a single filesystem
3) Memory and Virtual File System
These file systems do not exist on disk in the same way that traditional file systems do
...
a) proc
proc is a virtual file system that acts as an interface to the kernel‘s internal
data structures
...
Even the process listing command, ps, gets its information from the proc file system
...
b) cramfs :
Prepared by Prof
...
The largest file size is 16MB, and the largest file system size is 256MB
...
tmpfs exists solely in memory, so what you put in temp doesn’t persist between reboots
...
Kernel on the disk has this file system
...
Partitions determine how your storage space is carved out of use later by the system and
its users
...
You are allowed to make only three primary partitions for operating system use and the
fourth is dedicated to hosting the extended partition
...
To obtain partition
information about your disks, command fdisk –l is used
...
e
...
e
...
e
...
e
...
ext3 /dev/sda5 (sda5 is newly created partition)
Mount the partition (check in Mounting topic)
5) Mounting :
Mounting makes content of partition accessible in the directory
...
Every mounting information must have the following entries:
I
...
Mounting point : eg - /boot
III
...
Sweta Chheda
Page 31
IV
...
VI
...
e
...
Sweta Chheda
Page 32
LVM enables flexible partitions
...
For example, if your system logs have grown immensely, and you‘ve run out of room on
your /var partition, increasing a partition size without LVM is not possible
...
Then you‘d use the LVM file system resizing tool to increase the file system size to match
the new partition size
...
The basic syntax for using the LVM command is
: lvm
Eg : # lvdisplay /dev/tirup/lvtirup
For creating logical partition :
i) Partition the hard disk
i
...
fdisk –cu/dev/sda
command : n
first sector
last sector :
ii) Toggle(change) the id:
i
...
fdisk –cu/dev/sda
command : t
id : 8e
iii) Save the changes to the disk
i
...
fdisk –cu/dev/sda
command : w
iv) Inform kernel about the
partition i
...
partx –a/dev/sda
v) create physical volume :
i
...
pvcreate /dev/sda5 (assuming sda5 is newly created partition)
Prepared by Prof
...
e
...
e
...
e
...
ext3 /dev/tirup/tirup1 (assuming tirup1 is newly created logical volume)
xi) Mount the partition in /etc/fstab
7) Listing Physical volume and Logical Volume :
To get a listing of the physical volumes on the system enter the command as shown below at
the terminal prompt :
# lvm pvdisplay
To get a list of the logical volumes on your system, enter the command as shown below at
the terminal prompt :
# lvm lvdisplay
To get a list of the volume groups on your system, enter the command as shown below at the
terminal prompt :
# lvm vgdisplay
Q) RAID (nov’12, april’13)
From the lecture notes
...
H/W RAID is invisible
to the operating system
i) raidstart : This command will start an existing RAID device
...
iii) raidreconf : This command is used to add disks to an existing array to convert an array
to a new type
...
A partition is a contiguous set of blocks on a drive that are treated as an independent disk
...
/boot partition : contains kernel images and grub configuration and commands
...
g
...
Sweta Chheda
Page 34
SWAP partition : swap partition are used to support virtual memory
...
The size of your swap partition should be equal to twice your computer‘s RAM
...
The configuration files for network interfaces are located in the
/etc/sysconfig/network-scripts/ directory
...
Although the number and type of interface files can differ from system to system, there are
three categories of files that exist in this directory:
Interface configuration files
Interface control scripts
Network function files
The files in each of these categories work together to enable various network devices
...
Understanding the role these files play in setting up the network stack can be helpful when
customizing a Red Hat Enterprise Linux system
...
It can also be used to resolve hostnames on small networks with no DNS server
...
0
...
1) as localhost
...
/etc/resolv
...
Unless configured
to do otherwise, the network initialization scripts populate this file
...
For
more information about this file and the directives it accepts,
/etc/sysconfig/network-scripts/ifcfg-interface-name
For each network interface, there is a corresponding interface configuration script
...
Title: linux unit 1 mumbai university notes
Description: mumbai university notes mu.ac.in
Description: mumbai university notes mu.ac.in