Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 62

Introduction

Instructor: Jimmy T Mbelwa, PhD.


Installation and initial Configuration
• Selecting a language
• Choosing automatic or manual partitioning
• Type of software to install
• Choosing which drive to boot from
• Adjusting the time settings
• Configuring the hardware aspect of the system
• Creating the root password (for the Administrator), and user accounts
• Hardware configuration
Installation and initial Configuration-RedHat
• Download LINUX
• To install Red Hat, you will need to download the ISO images (CD Images) of
the installation CD-ROMs from http://fedora.redhat.com
• Download the i386 images for 32 Intel Processors, PPC images for for Apple
Macintosh and x86_64 for for 64 bit AMD Processors
• Burn the iso CD images on CDs and use these CDs
as Installation CDs (typically 4)
Installation and initial Configuration-RedHat
Installation and initial Configuration-RedHat
Installation and initial Configuration-RedHat
Installation and initial Configuration-RedHat
Installation and initial Configuration-RedHat
Installation and initial Configuration-RedHat
Installation and initial Configuration-RedHat
Installation and initial Configuration-RedHat
• What is partition?
• Partitioning is a means to divide a single hard drive into many logical drives.
• A partition is a contiguous set of blocks on a drive that are treated as an
independent disk.
• A partition table is an index that relates sections of the hard drive to
partitions.
• Why multiple partitions?
• If you have multiple disk partitions mounted on different directories of the
Linux file system and you are upgrading an existing installation, you do not
have to format any partitions in which you want to preserve existing data. For
example, if you have all user directories on a separate disk partition mounted
on the /home directory, you do not have to format that partition.
Installation and initial Configuration-RedHat
• Partition fields:
• Device: This field displays the partition's device name.
• Start: This field shows the sector on your hard drive where the partition begins.
• End: This field shows the sector on your hard drive where the partition ends.
• Size: This field shows the partition's size (in MB).
• Type: This field shows the partition's type (for example, ext2, ext3, or vfat).
• Mount Point: A mount point is the location within the directory hierarchy at which a volume exists; the volume is
"mounted" at this location. This field indicates where the partition will be mounted.
• Filesystem type:
• ext2 — An ext2 filesystem supports standard Unix file types (regular files, directories, symbolic links, etc). It provides
the ability to assign long file names, up to 255 characters. Versions prior to Red Hat Linux 7.2 used ext2 filesystems
by default.
• ext3 — The ext3 filesystem is based on the ext2 filesystem and has one main advantage — journaling. Using a
journaling filesystem reduces time spent recovering a filesystem after a crash as there is no need to fsck the
filesystem.
• swap — Swap partitions are used to support virtual memory. In other words, data is written to a swap partition
when there is not enough RAM to store the data your system is processing.
• vfat — The VFAT filesystem is a Linux filesystem that is compatible with Windows 95/NT long filenames on the FAT
filesystem.
Installation and initial Configuration-RedHat
• Recommended Partitioning Scheme
• /boot partition – contains kernel images and grub configuration and commands
• / partition
• /var partition
• /home partition
• Any other partition based on application (e.g /usr/local for squid)
• swap partition — swap partitions are used to support virtual memory. In other words, data is written to a swap partition when there
is not enough RAM to store the data your system is processing. The size of your swap partition should be equal to twice your
computer's RAM.
• Disk partition:
• IDE Disk Partitions
/dev/hda (Primary Master Disk)
/dev/hda1 (First Primary Partition)
/dev/hda2 (Second Primary Partition)
/dev/hdb (Primary Slave Partition)
/dev/hdb1
/dev/hdc (Secondary Master/Slave Partition)
/dev/hdc1
• SCSI Disk Partitions
/dev/sda1, /dev/sda2
/dev/sdb1, /dev/sdb2
Installation and initial Configuration-RedHat
• Boot Loader
• In order for the BIOS to load an OS it looks for instructions on the first sector
of a hard drive.
• On the first sector of the hard drive resides the master boot record (MBR),
and is where a boot loader is initialized.
• Depending on the boot loader, additional files may be stored and read from a
partition on the hard drive.
• After this step the boot loader begins to start the operating system, and is not
used again until the next boot.
Installation and initial Configuration-RedHat
Installation and initial Configuration-RedHat
Installation and initial Configuration-RedHat
Installation and initial Configuration-RedHat
Installation and initial Configuration-RedHat
Installation and initial Configuration-RedHat
Installation and initial Configuration-RedHat
Installation and initial Configuration-RedHat
Installation and initial Configuration-RedHat
Installation and initial Configuration-RedHat
Installation and initial Configuration-RedHat
Installation and initial Configuration-RedHat
Installation and initial Configuration-RedHat
Installation and initial Configuration-RedHat
Installation and initial Configuration-RedHat
Installation and initial Configuration-RedHat
Installation and initial Configuration-RedHat
Installation and initial Configuration-RedHat
Installation and initial Configuration-RedHat
Installation and initial Configuration-RedHat
Installation and initial Configuration-RedHat
Installation and initial Configuration-RedHat
Installation and initial Configuration-RedHat
Installation and initial Configuration-RedHat
Installation and initial Configuration-RedHat
Installation and initial Configuration-RedHat
Installation and initial Configuration-RedHat
Installation and initial Configuration-RedHat
Essentials Administrative Tools
System Administrative Tools
• The fundamental tools of system administration include:
• careful and systematic work habits
• a selection of basic software tools.
• Editors (e.g. vi, vim)
• filters,
• file system navigation-
• windowed environments
• power tools- command shell features, graphical desktop tools,
programmable filters, and scripting languages
Linux start-up and shutdown
Standard Boot Process (LILO)
• System load the Linux bootstrap from default boot device, LILO, which
resides in Master Boot Record of hard drive
• The bootstrap program has ability to boot Linux to single-user or
multi-user mode
• After the bootstrap has loaded the kernel ( stored in the /boot or /
partition ) into memory, it relinquishes control to this system
• The Linux system initializes physical devices, virtual memory
controller, and its internal control tables for processes, files, ..
• The init process is started and it starts all other user processes
• Before handing control over init, the kernel will create any other
kernel threads
Boot Problems
• Sometimes, lilo will not able to boot the system, it prints the letters
LILO on screen. The problems: disk corrupted, the information on disk
geometry is incorrect, or since the new kernel image is installed
• Troubleshooting: boot the system from bootable CD or floppy and try
to repair disk problems or correct the /etc/lilo.conf
Manual Boot
• There are times when lilo has loaded the kernel but the kernel does
NOT work properly because some of hardware can not be found,…It’s
possible to pass configuration to the kernel through lilo at lilo
command line when booting:
Manual Boot
• List of some important boot prompt arguments :
root=/dev/hda1 Tell the kernel which device to be mounted as
root file system
ramdisk_size=2MB Define maximum of ramdisk (up to 4MB )
single This actually is a parameter passed to init,
causes the system to boot in single-user mode
mem=192MB Tell the kernel amount of memory ( RAM size )
aha1542=0x334 Set the I/O port address for SCSI Interface Card
hdc=cdrom Specifies the third disk device is a CD-ROM
Instead of typing them at each reboot, these
arguments can be included into the lilo.conf :
append=“hdc=cdrom”
Manual Boot
• More information about boot prompt and arguments can be found
at:
http://www.tldp.org/HOWTO/BootPrompt-HOWTO.html
• Refers to man 5 lilo.conf for a detailed information about arguments
Startup Flow Control

• It used to run Linux system at level 3


Run Levels
• Runlevel 0 /etc/rc.d/rc0.d Shutdown mode. Tasks: killing all processes and
unmounting file systems
• Runlevel 1 /etc/rc.d/rc1.d Single-user mode, generally used by system
administrator when doing maintenance/recovery of the system
• Runlevel 2 /etc/rc.d/rc2.d Multi-user mode, some network services are not
started : NFS, …
• Runlevel 3 /etc/rc.d/rc3.d Multi-user mode, all network services are started
• Runlevel 4 /etc/rc.d/rc4.d User defined run level
• Runlevel 5 /etc/rc.d/rc5.d Multi-user X11 mode. All services that are started in
run level 3 are generally started
• Runlevel 6 /etc/rc.d/rc6.d Reboot runlevel.
• Runlevel s/S /etc/rc.d/rcS.d Single-user mode.
• Runlevel a/b/c Pseudo states. (rarely used)
Run Levels Using
• Use /sbin/runlevel to get current run level
• How to start X window ?
 RedHat and TurboLinux : # init 5
 Debian : # init 2
 SuSE and Caldera: # init 3
 Slackware : # init 4

• Reboot : # init 6
• Shutdown : # init 0
• To manual set default run level at boot time, open /etc/inittab and look for this
line : id:5:initdefault:
The init Control File: /etc/inittab
• The init process uses /etc/inittab as its control file :
• This is a text file, can be edited by the system admin
• init must be told about changes to /etc/inittab by: # init q
• One line per process to run at define run levels
• Lines starting with ‘#’ are comments
• Processes run from /etc/inittab are daemons
• Init read /etc/inittab every time the run level is changed
Structure of /etc/inittab
• Each line has 4 fields seperated by colons:
id:level:action:command
• id Unique identifier for line (up to 4 alphanumeric characters)
• level Run level(s) to activate processs
• action Keyword for how to run process
• command Full path name and parameters of command to be executed
Structure of /etc/inittab
• The main inittab action keywords are:
• Off Do not run this command. Used to retain an entry but to disable it.
• Wait Run command and wait for completion
• Once Run command but do not wait. Daemons processes are often started
this way
• Respawn Run command; If process exists, then rerun it. Used for commands
that have to start again after completion, like getty and ttymon
• Sysinit Run command at first init
• Boot Run command at boot time but do not wait
• Bootwait Like boot but wait for completion
• Initdefault Defines default boot level
/etc/inittab
# more /etc/inittab

...

id:3:initdefault:

#System initialization

si::sysinit:/etc/rc.d/rc.sysinit

l0:0:wait:/etc/rc.d/rc 0

l1:1:wait:/etc/rc.d/rc 1

l2:2:wait:/etc/rc.d/rc 2

l3:3:wait:/etc/rc.d/rc 3

l4:4:wait:/etc/rc.d/rc 4

l5:5:wait:/etc/rc.d/rc 5

l6:6:wait:/etc/rc.d/rc 6
Run Command Scripts
• The run commands scripts are kept under /etc/rc.d/ and are initiated by init with
directions from /etc/inittab
• The script called rc itself runs startup programs in sub-directories under /etc/rc.d/
• rc 0 looks in /etc/rc.d/rc0.d for runlevel 0
• rc 1 looks in /etc/rc.d/rc1.d for runlevel 1
• rc 2 looks in /etc/rc.d/rc2.d for runlevel 2
• etc …
• These startup programs are symbolic links to the actual scripts in the /etc/init.d/
• The startup link names are formatted: first character is S (started) or K (killed or
stopped), the next two digits identify the order that scripts are executed by rc
program
Changing Run Levels
• Use init command to change between run levels. Syntax :
init <runlevel>
• Examples :
# init 0 Shutdown system
# init 6 Reboot system
# init 3 Change to runlevel 3, multi-user text mode
# init 5 Change to runlevel 5, multi-user X11 mode
ShutDown
• Use shutdown commansd. It differs from “init 0” when allowing to
specify time to exit, warn users what happens, …
• Make sure that you follow the proper shutdown procedure. Do NOT
simply shut off the power
# shutdown Default system shutdown (run level 1)
# shutdown –r now Reboot the system now (run level 6)
# shutdown –h 2:00 Halt the system at 2:00AM (run level 0)
Maintenance Mode
• When the system doesn’t work because problems. The simplest and
best solution is to shut down the system to maintenance mode (run
level 1) or reboot the system to single-user mode (run level S) and try
to fix problems

You might also like