COMP 201 OpenSource L2 SampleInstallation1
COMP 201 OpenSource L2 SampleInstallation1
SYSTEM ADMINISTRATION
DANIEL OBUOBI
SAMPLE INSTALLATION DEMO
Linux Distributions,
Installation, Partitioning
September 2008
2
What constitutes “Linux”?
• “Linux” is a “Kernel”.
– Core of an operating system, a kernel manages the
machine’s hardware resources (including the processor
and the memory), and provides and controls the way any
other software component can access these resources.
The kernel runs with a higher privilege than other
programs (so-called user-mode programs). The power and
robustness of an OS's kernel play a major role in shaping
overall system design and reliability.
www.symbian.com/technology/glossary.html
3
What constitutes a “Distribution”?
• Kernel is not enough, need programs to use it.
• Distribution is a collection of everything
needed to run a Linux Kernel and do useful
things with it:
– Installation and Configuration Utilities
– Software Packages
– Linux Kernel
4
What Distributions are there?
• Large number (linux.org lists more than 100 English-
based distributions)
• Some common ones:
– Fedora Core
– RedHat Enterprise
– SuSE Linux
– Mandrake
– Debian
– Slackware
5
Availability of Distributions
• Purchasing CD/DVDROM’s
– Most (if not all) distributions will offer a purchasable
CDROM/DVDROM set.
– Most expensive way of purchasing a Linux OS
– Often includes a level of support or access to support
• Downloading off Internet
– GPL requires that source code be available
– Can take a while to download (some distro’s have 5-6 CD images or a
DVD image to download)
• Third Party CD’s
– Due to licensing via GPL, third parties can also sell cheap versions of
the CD’s.
6
General steps in installations
• Boot off Install CD
• Partition and format Hard Disks
• Select packages to install
• Networking Configuration
• Time zones, Basic User configuration
• Peripheral setup (if any)
• LILO and booting options
• Boot the newly installed host and configure
applications
7
Hardware Required
• Linux has fairly modest installation requirements
– Can be installed on any Intel Pentium based system, but
may not work overly fast
• Most current distributions require a couple of GB for
the system installation (can be trimmed down if
necessary by not installing unnecessary packages)
– Eg. RedHat recommends 2GB or more but will install into
400Mb.
• Most requirements centre around what you will use
the installation for.
8
Booting the Linux Kernel
• Mostly, booting a Linux install involves booting
a CD. Most modern PC’s can handle this so
long as they have a CD/DVDROM drive
installed.
• Other methods:
– Booting off a network (requires support from
network interface – most will do this)
– Booting off floppy disks (required when CD boot
doesn’t work or is unavailable)
9
Partitioning the Hard Disk
• Partitions:
– / (The “Root” filesystem)
• (Can also create /boot as an optional addition)
• Houses kernel, boot scripts, system configuration, etc.
• Often about 1-200 meg in size
– /usr
• Houses User utilities
• Often 2-3 GB required.
– /var
• Houses temporary (“Variable”) files, logs, runtime stuff.
• Allocate 1-2GB (more if can be spared)
10
Partitioning the Hard Disk (2)
– /opt
• Houses optional packages
• Some Linux installations don’t make use of it at all.
• Slackware and SuSE use it for Gnome and KDE packages
• 1-2 gig min, if the Distribution requires it.
– /home
• Houses user data
• Size should be dependant on storage needs of users and how many users
on the system.
• Other Filesystems
– /tmp – Stores temporary data
– /proc – Created by the system, interface to memory and kernel.
11
Filesystem Choice
• Linux supports a lot of different filesystems:
– “Normal” filesystems
• Write data directly to disk and handle allocation
• Often require lengthy repair processes in the event of a system
crash.
• Primary example: ext and ext2
– Logging filesystems
• Borrows from database technology, Providing a “journal” of most
recent data written to the filesystem.
• Journal is used to speed up recovery when filesystem is corrupted.
• Has more work to do compared to non-journalled filesystems.
• Examples: Ext3, ReiserFS, XFS, JFS.
12
Ext2/3
• One of the original Linux Filesystem formats.
• Ext2 has been the default filesystem on most
Linux installations
• Ext3 adds journaling support to the Ext2
filesystem.
• Considered a low-performance filesystem by
comparison to others
13
ReiserFS
• One of the first journaling filesystems to appear on
Linux
• Journals meta-data (inodes)
– Patches exist to do full journaling, but is considered
unstable.
• Version 4 of the filesystem is soon to be released –
will support theoretical max. up to 17Tb files on IA32
systems, near 260 for 64 bit systems (~1 exabyte).
• See http://www.namesys.com/ for more info.
14
XFS and JFS
• XFS (http://oss.sgi.com/projects/xfs)
– XFS is developed by SGI and is ported to Linux from IRIX.
– Extremely fast filesystem using journaling and BTrees to
handle large scale filesystems (theoretical max. of 263 bytes
file size ~8 exabytes)
• JFS (http://oss.software.ibm.com/jfs)
– Developed by IBM
– Extent-based filesystem with theoretical max. filesystem
size of 4 petabytes (~250 bytes) when using a 4Kb Block size
for the filesystem.
15
LVM
• Subsystem within Linux to provide greater flexibility with
filesystems.
• Partitions on disks are fixed in size, this allows partitions to
grow and (where the filesystem allows it) shrink as needed.
– ReiserFS and Ext2/3 support filesystem shrinking.
– All common Unix filesystems can grow.
• LVM’s can span multiple disks as a disk concatenation.
• Some Linux installations (SuSE, RedHat, etc.) can use LVM’s for
system partitions at the time of install
16
RAID
• Redundant Array of Independent Disks
• A means of using multiple disks to improve performance and stability.
• Works on the underlying idea that individual disks are likely to break down
• 8 levels of RAID: (Only 4 are commonly used)
– Non-redundant Striping (RAID 0) (Least expensive–not really RAID)
– Mirroring of data (RAID 1)
– Hamming Code ECC (RAID 2) (not commercially viable)
– Parallel transfer with parity (RAID 3) (very resource intensive)
– Independent Data disks with shared Parity disk (RAID 4) (poor write performance)
– Independent Data disks with distributed parity (RAID 5)
– Independent Data disks with dual distributed parity (RAID 6) (poor performance
compared to RAID 5)
– Optimized Asynchrony (RAID 7) (proprietary system – Requires UPS)
• For more details, read http://www.acnc.com/04_00.html
17
Non-Redundant Striping
(RAID 0)
• RAID 0 simply places splits the data across
multiple disks
• By itself it provides no redundancy. Requires
backups to recover from a failure.
• All “stripes” must be of equal size.
• Can provide an improvement in read and write
performance
18
Mirroring (RAID 1)
• Put simply, this method of RAID makes a
mirrored copy of the data
• Provides a full copy, so fully redundant across
disks.
• Reading is faster, as there are multiple copies
of the data
• Writing is slower, as there are multiple copies
that need to be written.
19
Combining RAID 0 and 1 for
full redundancy
• RAID 1 provides full redundancy, but combining it
with striping speeds the process up.
• Requires twice the number of disks as striping (min. 4
disks)
• Gives full redundancy (So long as one copy of data is
unaffected, data is OK.)
• Why not mirror then stripe?
– Can only afford a single drive failure
– Has same overhead as mirroring
– As good as RAID 5 but with nearly twice the disks.
20
Parity (RAID 5)
• Uses an XOR parity check to allow reconstruction of
data.
• Parity is split across all disks so that any disk can fail
and the data on it can be reconstructed.
• Provides good throughput with a single disk
redundancy.
• RAID 6 varient uses 2 separate parity checks.
21
Introduction to Packages
• What is a package?
– A package is a single application put into a neat group that
can be installed and uninstalled by a package manager.
• Why is this good?
– Easier to get software you need installed
• Why is this bad?
– You have no control over compile-time options, only
runtime. (Most distributions try to make the compile time
options as flexible as possible, but this can have an effect
on performance)
22
Package Selection
• Depends on what the host will be doing
– Mail servers?
– Web Servers?
– X Windows? KDE? Gnome?
• Make sure you have allocated enough space in /usr
(and possibly /opt) to handle whatever packages you
are going to install with some overhead (Ideally disk
space usage should be no more than say 60% on any
partitions after install, depending on how much
space you allocated)
23
The Intel Arch. Boot process
• Machine switched on, load BIOS
• Depending on BIOS configuration, attempt to locate
boot record (aka. Master Boot Record) from Floppy
disk, CDROM or hard disk.
• MBR has bootstrapping code to load Operating
System (in this case – a Linux Kernel)
• Linux boot process takes over from this point.
24
Places to load Linux from
(i386)
• Master Boot Record – located on primary master disk
– Custom boot process (Eg. LILO or GRUB) installed on MBR
• Boot floppy or CDROM
– Often slower to load
• Floppy with boot sector only, linking to kernel on
other media.
– Handy to have as a recovery disk.
25
LILO, GRUB, etc.
• After installing packages, you will need to make the
system bootable.
• Linux provides two boot managers for this purpose:
– LILO (Linux Loader)
– GRUB (Grand Unified Bootloader)
• Both are capable of booting Linux.
• Grub is possibly more useful if booting other
operating systems (dual boot systems)
26
Basic Network Config
• Generally, networking configuration is
optional at time of install, unless you are
doing a remote installation.
• Often installers will allow you to either specify
an IP address for each interface, or read IP
address information off DHCP
• DHCP, IP addresses, etc. will be covered later
(networking sections of the course)
27
Timezones, UTC, etc.
• You will need to set a timezone for your host.
– Be as descriptive and accurate about the location as possible.
– Eg. Setting to Australia/Melbourne instead of Australia/Victoria, as
there may be small differences you may not know about.
• Setting clock to UTC or local time?
– UTC time will allow multiple timezones to be easily handled within the
Linux OS.
– Users can see the time for their specific timezone
• Considerations for using UTC or local time
– Is the host dual boot? (Running Linux and what else?)
– Can all hosts handle the CMOS clock at UTC? If so, do that.
28
First topics:
• Unix birds-eye overview
• Partitioning
• Linux installation
Kernel
The "core" of the operating system
Device drivers
communicate with your hardware
block devices, character devices, network devices,
pseudo devices
Filesystems
organise block devices into files and directories
data structure that allows data on a disk to be
organised and accessed by the user
Memory management
Timeslicing (multiprocessing)
Networking stacks - esp. TCP/IP
Enforces security model
Shell
• Command line interface for executing programs
– DOS/Windows equivalent: command.com or
command.exe
• Choice of similar but slightly different shells
– sh: the "Bourne Shell". Standardised in POSIX ($ prompt)
– csh: the "C Shell". Not standard but includes command
history (% prompt )
– bash: the "Bourne-Again Shell". Combines POSIX
standard with command history. But distributed under
GPL (more restrictive than BSD licence)
Shell
– tcsh: "Tea Sea Shell", often used in the Linux
environment and contains useful attributes such
as 'up-arrow' and 'down-arrow' recall of previous
command entries, and the use of the TAB key to
complete commands
Value Meaning
file is executable (only for programs and shell scripts - not useful for
x data files). Execute permission on a directory means you can list the
files in that directory
in the place where 'x' would normally go is called the set-UID or set-groupID
s
flag.
Key differences to Windows
• Unix commands and filenames are CASE-SENSITIVE
• Path separator: / for Unix, \ for Windows
• Windows exposes a separate filesystem tree for each
device
– A:\foo.txt, C:\bar.txt, E:\baz.txt
– device letters may change, and limited to 26
• Unix has a single 'virtual filesystem' tree (tree
structure with a top directory called the root and
noted " / ")
– /bar.txt, /mnt/floppy/foo.txt, /cdrom/baz.txt
– administrator choses where each FS is attached
– Don't need to know disk layout/ partitioning scheme e.g. C:\, D:\
Standard filesystem layout
/bin essential binaries
/boot kernel and modules
/dev device access nodes
/etc configuration data
/etc/defaults configuration defaults
/etc/rc.d startup scripts
/home/username user's data storage
/lib essential libraries
/sbin essential sysadmin tools
/stand recovery tools
/tmp temporary files
/usr progs/applications
/var data files (logs, E-mail
messages, status files)
Standard filesystem layout (cont)
/usr
/usr/bin binaries
/usr/lib libraries
/usr/libexec daemons
/usr/sbin sysadmin binaries
/usr/share documents
/usr/src source code
/usr/local/... 3rd party applications
/usr/X11R6/... graphical applications
/var
/var/log log files
/var/mail mailboxes
/var/run process status
/var/spool queue data files
/var/tmp temporary files
Standard filesystem layout (cont)
Src:
ei.cs.vt.edu