topic 1 - intro to linux

Upload: anonymous-gk9mhwnr

Post on 15-Feb-2018

227 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/23/2019 Topic 1 - Intro to Linux

    1/24

    Introduction to Linux

  • 7/23/2019 Topic 1 - Intro to Linux

    2/24

    t oduct o to u

    nstructors info

    Instructor : NGUYEN PHUONG QUAN

    Mobi : 0972.259.260

    Email : [email protected]

    Com : SHB

  • 7/23/2019 Topic 1 - Intro to Linux

    3/24

    Linux Professional Institute Certification

    Junior Level Administration (LPIC-1) Work at the command line.

    Perform basic maintenance tasks.

    Install and configure a workstation

    Advanced Level Administration (LPIC-2) Administer a small to medium-sized site containing

    Microsoft and Linux servers.

    Supervise assistants.

    Advise upper manangement.

    Senior Level Administration (LPIC-3)

  • 7/23/2019 Topic 1 - Intro to Linux

    4/24

    Histoy of LINUX, UNIX

    1983: GNU

    1985: GPL

    1991: Linux

    1994: Redhat

    2001: Linux 2.4Linus Torvald Tux

  • 7/23/2019 Topic 1 - Intro to Linux

    5/24

    LINUX VS UNIX

    Linux Unix

  • 7/23/2019 Topic 1 - Intro to Linux

    6/24

    Linux Installation

    2. Linux Boot Process

    1. Linux Installation

  • 7/23/2019 Topic 1 - Intro to Linux

    7/24

    Linux Installation

  • 7/23/2019 Topic 1 - Intro to Linux

    8/24

    File System Overview

    Linux filesystem is a single tree with the /directory as its root directory.

    You create the single tree view of the

    filesystem by mounting the filesystems ondifferent devices at a point in the tree called

    a mount point

    Files or subdirectories that were already inmountpoint are no longer visible when new

    filesystem is mounted there

  • 7/23/2019 Topic 1 - Intro to Linux

    9/24

    Filesystem Hierarchy Standard

  • 7/23/2019 Topic 1 - Intro to Linux

    10/24

    Partitions

    Three types of partition on hard

    drives:primary,logical, andextended

    Thepartition table is located in themaster boot

    record (MBR) of a disk

    When more than 4 partitions are required, one oftheprimarypartitions must become an extended

    partition

    Linux numbers primary or extended partitions as 1through 4

    If logical partitions are defined, they are

    numbered starting at 5

  • 7/23/2019 Topic 1 - Intro to Linux

    11/24

    Recommended Partition Scheme

    Mountpoint Size Description

    / 4GB or

    more

    Contains all directories not

    present on other filesystems

    swap 2 x RAM size used to support virtual memory

    /boot 100MB Contains the Linux kernel and

    boot files

    /home 200MB per

    user

    Default location for user home

    directories

    /var 2GB or

    more

    Contains log files and spools

    /tmp As much as

    possible

    Holds temporary files created by

    programs

  • 7/23/2019 Topic 1 - Intro to Linux

    12/24

    Linux Installation Process

    1. Boot from an installation source

    2. Select installation mode

    3. Select language and keyboard layout

    4. Partition the hard disk

    5. Select boot loader options

    6. Configure network interfaces

    7. Select time zone

    8. Set roots password

    9. Customize software packages to be installed

    10. Start the installation

  • 7/23/2019 Topic 1 - Intro to Linux

    13/24

    Linux Boot Process

  • 7/23/2019 Topic 1 - Intro to Linux

    14/24

    Boot Loader PrinciplesLinux

    1. Boot process begins with the BIOS2. BIOS load the MBR (primary boot loadercode)

    3. Primary boot loadereither:

    A. Loads the boot sector from bootable primary partition

    (secondary boot loader), which continues the process byloading an OS kernel. DOS and Windows use this.

    B. Load the OS kernel directly (bypass the secondary bootloader). Linux supports this.

  • 7/23/2019 Topic 1 - Intro to Linux

    15/24

    Linux boot loader

    LILO (LInuxLOader) or GRUB (GRandUnifiedBootloader)

    Can be installed in MBR or boot sector of primarybootable partition.

    Trouble comes if your system is dual-boot (Windows+ Linux) Install LILO/GRUB in MBR: can be wiped out if you re-installing

    Windows

    Install LILO/GRUB in boot sector: remain intact, although Windowsmight configure the system to bypass it.

    This partition must be a primary partion

    You must you FDISK to re-mark the Linux partition as the boot partitoin

  • 7/23/2019 Topic 1 - Intro to Linux

    16/24

    LILO vs GRUB

    LILO GRUB

    Configuration file /etc/lilo.conf /boot/grub/grub.confor

    /boot/grub/menu.lst

    Support booting from a

    network

    No Yes

    Command to install lilo grub-install

    Require re-install after

    changing configuration file

    Yes No

  • 7/23/2019 Topic 1 - Intro to Linux

    17/24

    Example of grub.conf

  • 7/23/2019 Topic 1 - Intro to Linux

    18/24

    Example of lilo.conf

  • 7/23/2019 Topic 1 - Intro to Linux

    19/24

    Linux boot process

    System booting process:

    1. System is power on, CPU runs the BIOS

    2. BIOS load the primary boot loader in MBR

    3. Primary boot loader load secondary loader in boot sector

    4. Boot loader load the Linux kernel

    5. Linux kernel initializing devices, mounting root partitionand run /sbin/init

    6. /sbin/init read /etc/inittab to determine what otherprogram to run based on default runlevel

    Extracting information about the boot process:dmesg | lessless /var/log/messages

  • 7/23/2019 Topic 1 - Intro to Linux

    20/24

    Runlevel

  • 7/23/2019 Topic 1 - Intro to Linux

    21/24

    The System Startup Scripts

    Runlevel specific scripts are stored in /etc/rc.d/rc?.dor /etc/init.d/rc?.d

    All scriptss name are begin with S or K Example: S10network, K35smb

    Scripts are actually symbolic links to main scripts in/etc/rc.d or /etc/init.d/

    When entering a runlevel, rc:

    pass start parameter to S* scripts

    pass stop parameter to K* scripts

  • 7/23/2019 Topic 1 - Intro to Linux

    22/24

    Managing Runlevel

    View default runlevel

    grep :initdefault: /etc/inittabView current runlevel:runlevel

    Change to another runlevel:

    telinit runlevelList the services and their applicable runlevels:chkconfig --list [servicename]

    Modify the runlevels in which a services run

    chkconfig --level runlevels servicename {on|off|reset} Example:chkconfig --level 345 nfs-common on

    Text-based menu driven tools:ntsysv

  • 7/23/2019 Topic 1 - Intro to Linux

    23/24

    Exercise

    1. Login as root in graphical mode

    2. Learn your current runlevel with runlevel

    3. If your system reports its in runlevel 5, type telinit 3 to switchto runlevel 3. See whats difference?

    4. Return to your orginal runlevel with telinit 5

    5. Edit /etc/inittab and change the default runlevel to 3

    6. Reboot the computer by typing reboot now or shutdown -rnow

    7. Login as root again and type runlevel to verify that yourerunning in the runlevel you specified in step 5

    8. Edit /etc/inittab to restore it to its original state

    9. Type telinit 6. This enters runlevel 6, which reboot the system.

  • 7/23/2019 Topic 1 - Intro to Linux

    24/24

    Q A

    Thank You