Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 76

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
Installation and initial Configuration-Ubuntu
Server
• If you do a default install of Ubuntu Server you will end up with the following:
• Dynamic network address via DHCP
• A file system of the form:
• / (root) 🡪 All of disk minus 2xRAM
• <swap> 🡪 2xRAM
• Minimum software installation
Installation and initial Configuration-Ubuntu
Server 22.04 LTS
• Ubuntu 22.04 LTS Minimal Server Installation
• Requirements
• The Ubuntu 22.04 server ISO image is available here: https://releases.ubuntu.com/22.04/ubuntu-22.04-live-server-amd64.isoThe Ubuntu 22.04 server ISO image is available here:
https://releases.ubuntu.com/22.04/ubuntu-22.04-live-server-amd64.iso (For 64Bit Intel and AMD CPU's). Take a look here for other Ubuntu downloads:
https://releases.ubuntu.com/22.04/
• A fast internet connection is recommended as the package updates get downloaded from Ubuntu servers during installation.

• Installation
Installation and initial Configuration-Ubuntu
Server 22.04 LTS
• Language Selection
Installation and initial Configuration-Ubuntu
Server 22.04 LTS
Installation and initial Configuration-Ubuntu
Server 22.04 LTS
• Keyboard Layout
Installation and initial Configuration-Ubuntu
Server 22.04 LTS
• Standard Ubuntu server setup or a minimal setup. For this case, choose a minimal setup to and install only
software that I really need at a later stage. This is especially useful when running Ubuntu on a small virtual
server.
Installation and initial Configuration-Ubuntu
Server 22.04 LTS
• Network configuration – automatic IP address using DHCP server or manual network setup
Installation and initial Configuration-Ubuntu
Server 22.04 LTS
• Ubuntu mirror server updates and installation files shall be downloaded – keep the default
Installation and initial Configuration-Ubuntu
Server 22.04 LTS
• Disk partition – Default partition or Custom Layout
Installation and initial Configuration-Ubuntu
Server 22.04 LTS
• Storage Configuration – Custom Layout
Installation and initial Configuration-Ubuntu
Server 22.04 LTS
• Disk partition confirmation
Installation and initial Configuration-Ubuntu
Server 22.04 LTS
• Server name and administrator username and password
Installation and initial Configuration-Ubuntu
Server 22.04 LTS
• Installing OpenSSH
• Server administration over the network using SSH
Installation and initial Configuration-Ubuntu
Server 22.04 LTS
Installation and initial Configuration-Ubuntu
Server 22.04 LTS
• The Ubuntu installer now proceeds with the installation based on the selected settings
Installation and initial Configuration-Ubuntu
Server 22.04 LTS
• Select "Reboot" to boot the server into the fresh installed Ubuntu 22.04 system.
Installation and initial Configuration-Ubuntu
Server 22.04 LTS
• Select "Reboot" to boot the server into the fresh installed Ubuntu 22.04 system.
• Get root Privileges
• Login using your created administrator account and run
• sudo –s
• Enable the root login by running
• sudo passwd root
• Install the SSH Server (Optional)
• If you did not select to install the OpenSSH server during the system installation
• sudo apt -y install ssh openssh-server
• Install a shell-based editor (Optional)
• sudo apt -y install nano vim-nox
• Configure the Network
• Install common network tools.
• sudo apt install net-tools
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
BIOS
• BIOS stands for Basic Input/Output System - a special type of firmware used in the booting process the first piece of
software that is run when a computer is powered on. The BIOS is operating system independent. Its primary purpose is to
test the underlying hardware components and to load a boot loader or operating system.
• The BIOS performs a POST (Power-On Self Test). The POST performs some basic checks of various hardware components
such as the CPU, memory, and storage devices. Only if the POST succeeds will the BIOS attempt to load the boot loader.

• The BIOS contains a list of boot devices such as hard disks, a DVD drive, USB devices, and others depending on the
hardware being used. The BIOS searches that list for a bootable device in the order specified. You can change this order by
interrupting the boot sequence and entering into the configuration for the BIOS. The key combination used to do this will
vary from one hardware manufacturer to another.

• Once a bootable device has been found, the BIOS will run the boot loader. Typically the GRUB boot loader will be used, but
you may run into older Linux systems that use the LILO boot loader. LILO stands for LInux LOader, while GRUB stands for
Grand Unified Bootloader. In any case, the primary purpose of the boot loader is to start the operating system. You will
typically see a message or series of messages from the boot loader which will allow you to interrupt the boot process and
interact with the boot loader. If there are multiple operating systems installed, you can tell the boot loader which
operating system to run. You can also instruct the boot loader to pass different boot options to the operating system
The Initial RAM Disk and Kernel
• The Initial RAM Disk
• The initial RAM disk, abbreviated as “initrd,” is a temporary file system that’s loaded into memory when the system boots.
• The file system can contain helpers that perform hardware detection and load the necessary modules, sometimes called drivers, to
get the actual file system mounted.
• For example, if the root file filesystem is stored on an LVM (Logical Volume Manager) volume, the initrd image will contain the kernel
modules required to mount that logical volume as the root file system. Once the initrd mounts the actual root file system its job is
done and the operating system continues loading from the real root file system.
• Kernel and Initial RAM Disk Location
• The Linux kernel, the initial RAM disk, and other files needed to boot the operating system are stored in /boot. Here is a listing of
the /boot directory for an Ubuntu system.
• $ ls -1F /boot
• The Linux kernel is typically named vmlinux or vmlinuz. If the kernel is compressed its name is in the vmlinuz format.
• The Kernel Ring Buffer
• The kernel ring buffer contains messages related to the Linux kernel. A ring buffer is a data structure that is always the same size.
Once the buffer is completely full, old messages are discarded when new messages arrive. To see the contents of the kernel ring
buffer, use the dmesg command.
• On most Linux distributions these messages are also stored on disk in the /var/log/dmesg file.
• Between the dmesg command and the /var/log/dmesg log file, you will be able to see the messages the kernel is generating, even
during the earliest stages of the boot process when those messages can quickly fly by your screen
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 and Targets
• Linux uses runlevels to determine what processes and services to start.
• Each distribution can be configured differently, but, in general:
• runlevel 0 is used to power off a system
• runlevel 1 is single-user mode,
• runlevels 2-5 are for normal system operations
• runlevel 6 is used to reboot a system
• Historically, runlevels were controlled by the init program. The init configuration was stored in /etc/inittab. To change the default runlevel
using init, you would edit the /etc/inittab file and set the runlevel number on the initdefault line. Here is an example of setting runlevel 3 to
be the default runlevel.
• id:3:initdefault:
• To manual set default run level at boot time, open /etc/inittab and look for this line : id:5:initdefault:
• However, init alternatives such as systemd and upstart are quickly taking the place of init with systemd currently being the most widely
adopted replacement.
• Instead of runlevels, systemd has the concepts of targets. These targets are roughly equivalent to runlevels. To see a list of available targets,
look in /lib/systemd/system. You’ll notice the runlevel targets are actually symlinks to the real targets being used. For example,
runlevel5.target is a symlink to graphical.target.
• # cd /lib/systemd/system
• # ls -l runlevel*target
• To change the default runlevel, or target, with systemd, use the systemctl command followed by set-default and finally the desired target.
Optionally, you can manually create a symlink to the desired target from the /etc/systemd/system/default.target file
Run Levels and Targerts
• Changing runlevel or Target
• With the init system, you can change runlevels using the telinit command. Simply supply the runlevel
you want to change to as an argument to the telinit command
• # telinit 5 or init 5
• To change the target, the runlevel equivalent for systemd, use the systemctl command followed by
isolate and finally the desired target. Here is how to change to the graphical target.
• systemctl isolate graphical.target
Rebooting a System
• Even though there is a runlevel/target if you’re using systemd, for rebooting you can also use the reboot or shutdown
commands.
• Here’s how to reboot with init.
• # telinit 6 or init 6

• To reboot using systemd use the systemctl command.

• # systemctl isolate reboot.target

• To reboot using the reboot command simply execute reboot.

• # reboot

• The format of the shutdown command is as follows.

• shutdown [options] time [message]

• The option to tell shutdown to perform a reboot is -r. You can specify the time to shutdown using the “HH:MM”
format. You can also use +N where N represents the number of minutes to wait before performing the action. Finally,
you can use the now keyword to start immediately. Optionally, you may specify a message that will be broadcast to
all users logged into the system.
• # shutdown -r now
Powering Off a System
• To power off a system, use runlevel 0, the poweroff target, or the poweroff command.

• Here is how to issue a power-off with init.


• # telinit 0 or init 0

• Here is how to power off a system with systemctl.


• # systemctl isolate poweroff.target

• Finally, you can use the poweroff command.


• # poweroff
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