0% found this document useful (0 votes)
8 views26 pages

Lecture5 System Installation

System Installation QTBTHT
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
Download as pptx, pdf, or txt
0% found this document useful (0 votes)
8 views26 pages

Lecture5 System Installation

System Installation QTBTHT
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1/ 26

System installation

1
Installation of
• Linux
Why need to install?
– Copy Linux onto the hard disk
– Properly place the boot program, the Linux kernel, and
startup scripts so that the computer can boot up from
the hard disk
• Select an installation method
– CD-ROM
– NFS
– Floppy
• Partition your hard disk
– Backup your files before partitioning
– Use fdisk or cfdisk

2
Obtaining Linux
• distributions
Media
– Floppy disks
– CD-ROM
– Internet: e.g. http://www.debian.org/
– NFS
• Major Linux distribution
– Ubuntu
– Red Hat
– Debian
– Fedora
– S.u.S.E.
3
Preparation for
• installation
Linux kernel: more than 2MB now
– http://www.kernel.org/pub/linux/kernel
– To get the kernel source, use wget:
– wget http://www.kernel.org/pub/linux/kernel/v2.6/
linux-2.6.24.tar.bz2
– Patches between versions
• What you need know before installation
– Name, internet address, swap space, partitions, subnet
mask, time zone, local domain, name server

4
Installation


Planning;
steps
Gathering system hardware information;
• Backing up your old system (optional, but strongly
recommended);
• Preparing Linux partitions;
• Deciding on a boot loader (for dual boot systems);
• Booting a Linux kernel from CD or network;
• Running related software through scripts;
• Installing the kernel on hard disk;
• Choosing and installing software packages;
• Making final configuration adjustments; and
• Rebooting into a running system.
• Note: The post-configuration is necessary
5
Planning
• System planning worksheet
• General
– Processor
• Type: 386 486 Pentium I, II, III...
• Speed (optional): 500Mhz, 800MHz
• Mfg: Intel AMD Cyrix
– Motherboard:
• Make: unknown
• Chip Set: triton II
– Mouse:
• Mfg: Logitec
• Type: bus PS/2 serial port
• If serial: COM1 (ttyS0) COM2 (ttyS1)
• If USB mouse, check USB guide

6
Planning (cont.)
– Hard disk drive(s):
• Type: IDE, SCSI, ...
• Size (list each drive):
• If SCSI Controller: Make: Model:
• Example: Make: BusLogic Model: 948
– Boot:
• Linux DOS/Windows OS/2 Other
• Disk: Partition: Size: Boot:...
– CD-ROM: IDE/ATAPI SCSI
• Mfg: Model:

7
Planning (cont.)
• X-Windows:
– Video Card: Mfg: Model:
– RAM: 1Mb 2Mb 4Mb 8Mb 16Mb
– Monitor:
• Mfg: Model: Max scan rate: resolutions
• Networking:
– Modem: Mfg: Model:
– Serial port: COM1 COM2 COM3 COM4
– (ttyS0) (ttyS1) (ttyS2) (ttyS3)
– Computer hostname:
• Example: medussa
– If you have a NIC

8
Planning (cont.)
– NIC Type:
• ethernet token ring FDDI other
– NIC Mfg: Model:
– Network domain name: (Example: mountains.net)
– If use static IP address, you should fill the following:
• IP Address: (E.g.: 192.168.1.2)
• Network address: (E.g.: 192.168.1.0)
• Netmask: (E.g.: 255.255.255.0)
• Broadcast address: (E.g.: 192.168.1.255)
• Gateway(s): (E.g.: none or 192.168.1.1)
• DNS(s): (E.g.: 192.168.1.2)

9
BIOS or EFI
• BIOS (Basic I/O System) or EFI (Extensible
Firmware Interface)
– A program that is written in ROM
– Provides the lowest level interface to peripheral devices
and controls the first step of the boot procedure
– BIOS tests the system, looks for and checks peripherals
and then looks for a device (floppy, hard disk, or CD-
ROM) to use to boot the system
– Master Boot Record (MBR) is the sector that the BIOS
reads in and starts when a hard disk is used to boot.

10
Disk layout

11
Disk Partitioning
• A hard disk can be divided into several partitions. Each
partition functions as if it were a separate hard disk.
• If you have one hard disk, and want to have, say, two
operating systems on it, you can divide the disk into two
partitions. Each operating system uses its partition as it
wishes and doesn't touch the other one. This way the two
operating systems can co-exist peacefully on the same hard
disk. Without partitions one would have to buy a hard disk
for each operating system.
• Linux allows 4 primary partitions and up to 64 logical
partitions

12
Disk Partitioning (cont.)
• Why partition a disk?
– Easy maintenance of file systems (backup)
– Easy for system upgrade
• Can avoid formatting other filesystems when a distribution is
to be upgraded
– Bootable partition must be within the first 1024
cylinders
• Due to limitations in old BIOS, now this is not an
issue.
• How to partition?
– Depends on the ultimate purpose for the
system
• Some investigation on space requirements for each filesystem
is strongly recommended
13
Disk Partitioning (cont.)
• The partitioning scheme
– is not built into the hardware, or even into the BIOS. It is only a
convention that many operating systems follow.
– As a safety precaution, it is a good idea to write down the partition
table on a piece of paper, so that if it ever corrupts you don't have
to lose all your files.
• Partition types
– Linux (ext2, ext3), swap, DOS FAT
• Partitioning a hard disk
– fdisk, cfdisk
• Magic number in MBR
– 0xAA55
– Used by BIOS to distinguish a bootable disk and a non-bootable
disk

14
Disk Partitioning (cont.)
• Simple scheme
– one linux partition, one swap partition
• Recommended scheme: more partitions for different file
systems under linux
– /: 100-150MB, root partition for /bin, /dev, /etc, /lib, /sbin,…
– /boot: 20-50MB, boot partition, including linux kernels
– /swap: double the memory space, but could be smaller, partition
for virtual memory
– /usr: depends on software packages, 1GB-5GB, including X
windows
– /var: 500MB - 1GB
– /home: as large as possible

15
Boot procedure (hard

disk)
Boot from hard disk
– OS dependent load program is installed on MBR
• Boot for multiple OSs
– OS independent load programs such as LILO (Linux
Loader) or GRUB (GRand Unified Bootloader) is
installed on MBR
– OS dependent load program is installed on the boot
sector of the partition of the OS
– MAC bootloader is at /System/Library/
CoreServices/boot.efi and loaded directly by EFI

16
Boot procedure (floppy)
• Floppy organization
– Consists of boot sector
and data area
– The bottom right
picture is the layout of
the boot section
• Boot from floppy
– The BIOS loads the
program code and
executes it
– That program loads
OS
17
Boot up phases
• BIOS
– Boot sequence
• Bootloader
– GRUB or LILO
• Kernel
– initrd (initial ram disk) for initial root directory
• Upstart scripts under /etc/init
– Re-mount root directory
18
How Linux started?
• When Linux kernel is loaded into memory
and initialised, the init program is executed
• init is the first process in Linux
– Runs some start-up scripts to start up services
according to the run-level
– Runs getty program that prompts login waiting
for users to login

19
Linux run
• levels
Linux run levels
– 0 - halt
– 1 - single user mode
– 2 - unused
– 3 - multiuser mode (default mode)
– 4 - X11 with GUI
– 5 - unused
– 6 - reboot
• Each level has a set of scripts for configuration

20
Processes for start-
up

COSC301 Lecture 7: System … 21


More details for start-
• up boots,
When Linux
– The kernel mounts the root file system
– The first program that the system executes is init (the first process)
• It is responsible for starting the system startup scripts under /etc/rc.d
• Modifies system run-level from initial bootup state to single user
mode, then to its standard multiuser state.
• Spawns getty ( which will invoke a login program)
– /etc/inittab: read by init. Modify the file to change the default run
level
– Mount the file systems
• File systems listed in /etc/fstab are mounted by command mount -a
at boot
• To mount more file systems, you should either modify /etc/fstab, or
manually mount them.

22
What if the system can’t boot?
• If you made a mistake, e.g. the kernel
image is corrupted
• If you accidentally removed the /etc/passwd
but rebooted, what will happen? How to
fix?
– Use a live CD to boot the system
– Mount the filesystem to be fixed
– Recover the file
23
– Reboot without the live CD.
How to secure your machine?
• BIOS/EFI password
• Boot sequence
• Protect the single user mode with a root
password
• Protect the machine in a secure room!

24
Post installation
• Start a logbook
• Backup your system: a boot and
rescue floppy
• Edit login messages:/etc/issue and
/etc/motd
• User privilege and access control
• Software installation
• Harden security
25
Summary
• Linux boot process
– BIOS starts first after power on
– Bootloader (e.g. grub) is loaded into RAM from the
boot sector of the booting device
– Linux kernel is loaded into RAM
– After kernel initialization, the first process init is
created
– Init process read inittab to start the startup scripts via
command shell like bash
– Filesystems are mounted, software servers/daemons
starts, and network interfaces are brought up.
– Finally GUI (e.g. startx) is started or login shell (e.g.
getty) is prompted for users to login.
26

You might also like