Linux Basics - Technische Universität München · Debian? Red Hat? Fedora? Gentoo? Arch Linux? cat...

Post on 16-Oct-2019

6 views 0 download

Transcript of Linux Basics - Technische Universität München · Debian? Red Hat? Fedora? Gentoo? Arch Linux? cat...

Linux Basics

Linux Basics

Michael Faath, Martin Lowinski

TumFUG

10. November 2011

1 of 33 Michael Faath, Martin Lowinski Linux Basics

Linux Basics

Outline

1 Linux history

2 Linux distributions

3 Linux insight

2 of 33 Michael Faath, Martin Lowinski Linux Basics

Linux Basics

Skill-Level

• Ever used linux?

• Installed Linux?

• What is a distribution?

• XUbuntu? Debian? Red Hat? Fedora? Gentoo? Arch Linux?

• cat my movie collection | grep Hackers

• chmod 777 *

• ./configure && make && make install

• make && make modules install

• sed -i ’s/teh/the/g’ thesis.tex

• LPIC?

3 of 33 Michael Faath, Martin Lowinski Linux Basics

Linux Basics

Skill-Level

• What do you want to know?

4 of 33 Michael Faath, Martin Lowinski Linux Basics

Linux Basics

Linux history

Outline

1 Linux history

2 Linux distributions

3 Linux insight

5 of 33 Michael Faath, Martin Lowinski Linux Basics

Linux Basics

Linux history

Unix / GNU

UNIX / GNU

• 1960s-1970: UNIX

• 1983: Richard Stallman started GNU(Free UNIX-like OS)

• 1987: MINIX by Andrew S.Tanenbaum

• 1991: GNU nearly complete // Kernelmissing

6 of 33 Michael Faath, Martin Lowinski Linux Basics

Linux Basics

Linux history

Linux

Linux

• MINIX only for 16Bit-Systems

• Linus Torvalds programmed a terminalemulator to access the UNIX-Server ofhis university

• wanted to take advantage of his newPC with an 80386 processor

• therefore OS independant

• used GNU C compiler on MINIX

7 of 33 Michael Faath, Martin Lowinski Linux Basics

Linux Basics

Linux history

Linux

Torvalds on comp.os.minix

Hello everybody out there using minix -

I’m doing a (free) operating system (just a hobby, won’t be big andprofessional like gnu) for 386(486) AT clones. Th is has been brewing sinceapril, and is starting to get ready. I’d like any feedback on things peoplelike/dislike in minix, as my OS resembles it somewhat (same physical layout ofthe file-system (due to practical reasons) among othe r things).I’ve currently ported bash(1.08) and gcc(1.40), and things seem to work. Thisimplies that I’ll get something practic al within a few months, and I’d like toknow what features most people would want. Any suggestions are welcome, butI won’t promise I’ll implement them :-)

Linus (torvalds@kruuna.helsinki.fi)

PS. Yes it’s free of any minix code, and it has a multi-threaded fs. It is NOT

portable (uses 386 task switching etc), and it probably never will support

anything other than AT-harddisks, as that’s all I have :-(.

8 of 33 Michael Faath, Martin Lowinski Linux Basics

Linux Basics

Linux history

Linux

Open Source

• Free as in freedom, not as in free-beer

• Sourcecode available

• Free to copy

• Free to change / redistribute

• Free Software Foundation and Open Source Initiative (OSI)

• Licenses: GPL, BSD, Apache, Beerware

9 of 33 Michael Faath, Martin Lowinski Linux Basics

Linux Basics

Linux history

Linux

Unix timeline

10 of 33 Michael Faath, Martin Lowinski Linux Basics

Linux Basics

Linux distributions

Outline

1 Linux history

2 Linux distributions

3 Linux insight

11 of 33 Michael Faath, Martin Lowinski Linux Basics

Linux Basics

Linux distributions

What’s a distribution?

What’s a distribution?

Important

Linux is just the kernel, nothing more.

12 of 33 Michael Faath, Martin Lowinski Linux Basics

Linux Basics

Linux distributions

What’s a distribution?

What’s a distribution?

Distributionz. B. Debian, Red Hat, SUSE, Mandriva

Proprietäre Programme(z. B. Adobe Reader, Grafikkartentreiber)

Freie Programme(z. B. KDE, OpenOffice, Apache)

Linux-KernelD

istr

ibu

tio

nse

igen

eP

rog

ram

me

(z. B

. zu

r Konfigura

tion,

Inst

alla

tion w

ie Y

ast

, m

cc) Hand-

bücher

Support(per Telefon,E-Mail o. ä.)

To build a distribution you need... (in general)

• the linux kernel,

• some GNU stuff,

• a package management system

• and applications

13 of 33 Michael Faath, Martin Lowinski Linux Basics

Linux Basics

Linux distributions

What’s a distribution?

Overview

14 of 33 Michael Faath, Martin Lowinski Linux Basics

Linux Basics

Linux distributions

Distro Guide

Where are the differences?

Guide to your favourite Linux distro:

• Installtools (LFS vs. Ubuntu)

• Hardware compatibility (x86, devices, ...)

• Documentation / Support (active community, books)

• Principles (live, free software, KISS)

• License (GPL, DFSG)

• Package Layout (meta vs. binary)

• Help: Linux distribution chooser

15 of 33 Michael Faath, Martin Lowinski Linux Basics

Linux Basics

Linux distributions

Package Management Systems

Package Management Systems

• Software repository

• Verify checksums / signatures of packages

• Updating

• Uninstalling

• Dependencies

16 of 33 Michael Faath, Martin Lowinski Linux Basics

Linux Basics

Linux distributions

Package Management Systems

Types and Examples

• Binary packages

deb Debian package - dpkg, apt, aptitude, ..RPM RPM Package Manager - rpm, yum, ...

• Source packages

ebuild How to retrieve, compile, and install a packagein Gentoo’s Portage system - emerge

17 of 33 Michael Faath, Martin Lowinski Linux Basics

Linux Basics

Linux insight

Outline

1 Linux history

2 Linux distributions

3 Linux insight

18 of 33 Michael Faath, Martin Lowinski Linux Basics

Linux Basics

Linux insight

Boot

Boot

Typical boot sequence:

1 BIOS

2 MBR

3 Boot Loader

4 Kernel (+initrd)

5 init

19 of 33 Michael Faath, Martin Lowinski Linux Basics

Linux Basics

Linux insight

Shell

Shell

• {Shell, Bash, zsh, screen, ksh}• Command line interface

• Powerful tool

20 of 33 Michael Faath, Martin Lowinski Linux Basics

Linux Basics

Linux insight

Filesystem Hierarchy Standard (FHS)

Filesystem Hierarchy Standard (FHS)

• defines main directories and contents

• version 2.3 (2004)

• /

• virtual file system

21 of 33 Michael Faath, Martin Lowinski Linux Basics

Linux Basics

Linux insight

Filesystem Hierarchy Standard (FHS)

Filesystem Hierarchy Standard (FHS)

• static files

• variable files

• shareable files

• unshareable files

22 of 33 Michael Faath, Martin Lowinski Linux Basics

Linux Basics

Linux insight

Filesystem Hierarchy Standard (FHS)

Directory structure I

• /bin

• /boot

• /dev

• /etc

• /home

• /lib

• /media

23 of 33 Michael Faath, Martin Lowinski Linux Basics

Linux Basics

Linux insight

Filesystem Hierarchy Standard (FHS)

Directory structure I

• /bin (essential command binaries)

• /boot (bootloader files)

• /dev (devices)

• /etc (host-specific system-wide configuration files)

• /home (optional, user directories)

• /lib (kernel modules and dynamic librarys for /bin and /sbin)

• /media (optional, mount points for removable media)

24 of 33 Michael Faath, Martin Lowinski Linux Basics

Linux Basics

Linux insight

Filesystem Hierarchy Standard (FHS)

Directory structure II

• /mnt

• /opt

• /root

• /sbin

• /srv

• /tmp

• /usr

• /var

25 of 33 Michael Faath, Martin Lowinski Linux Basics

Linux Basics

Linux insight

Filesystem Hierarchy Standard (FHS)

Directory structure II

• /mnt (optional, temporarily mounted filesystems)

• /opt (optional software packages)

• /root (optional, “home“-directory for the root user)

• /sbin (essential system binaries, for root user only)

• /srv (service-data)

• /tmp (temporary files)

• /usr (secondary hierarchy for read-only user data)

• /var (variable data)

26 of 33 Michael Faath, Martin Lowinski Linux Basics

Linux Basics

Linux insight

Linux Kernel

Linux Kernel Layout

CPU Memory Devices

Kernel

Applications

27 of 33 Michael Faath, Martin Lowinski Linux Basics

Linux Basics

Linux insight

Linux Kernel

Linux Kernel Structure

Hard-

ware I/O CPU Speicher Datenträger Netzwerk Peripherie

USB,PCI…RegisterInterrupts

MMU,RAM IDE,SATASCSI

EthernetWiFi

GPU,AudioTastatur,Maus

Linux-

Kernel Prozessor-

architekturspezifischer

Code

Bus-TreiberSpeicher-operationen

Disk-Controller-Treiber

Netzwerk-karten-Treiber

Benutzer-schnittstellen-

Treiber

InterruptsallgemeinerHardware-zugriff

Speicher-seiten-

Verwaltung

block-orientierteGeräte

virtuellesNetzwerk

abstrakteHI-Treiber

ZeitscheibenModuls

+Ereignisse

logischerSpeicher

logischesDateisystem

virtuellesNetzwerk

HI-Subsystem

Zeit-abstimmung

Geräte-Verwaltung

Speicher-planung

Netzwerk-zwischen-speicher

System-Sicherheit

Speicher-Auslagerung

Cache-Seitenverwalt.

ThreadsvirtuellerSpeicher

virtuellesDateisystem

Netzwerk-protokolle

ProzesseSystem-aufrufe

Speicher-zugriff

Dateisystem-zugriff

Netzwerk-zugriff

Benutzer-schnittstelle

Benutzer-

Modus

System-dienste

Anwendungen

System-dienste

System-dienste

System-dienste

System-dienste

Anwendungen Anwendungen Anwendungen Anwendungen Anwendungen

28 of 33 Michael Faath, Martin Lowinski Linux Basics

Linux Basics

Linux insight

Linux Kernel

Linux Kernel Map

29 of 33 Michael Faath, Martin Lowinski Linux Basics

Linux Basics

Linux insight

Linux Kernel

Linux Kernel

• version: 3.1 (“Wet Seal“ / “Divemaster Edition“)

• december: 3.2 (“Saber-toothed Squirrel“)

• license: GPL 2 / proprietary (BLOBs)

• monolithic kernel

• c / assembler

• 14.856.072 loc in 37.098 files

30 of 33 Michael Faath, Martin Lowinski Linux Basics

Linux Basics

LPIC

• Linux Professional Institude

• Non-profit organization

• Vendor-independent certification for Linux systemadministrators and programmers

• Five year recertification policy

31 of 33 Michael Faath, Martin Lowinski Linux Basics

Linux Basics

LPIC Levels

• LPIC-1 (“Junior Level Linux Professional“)• Exam 101 - Systemarchitectures, Partitioning, Devices, Drivers,

LFH, Package-Management, GNU-/Unix-Commands, ...• Exam 102 - Shell, Scripts, SQL, UI, Desktop, Network basics,

Security, ...

• LPIC-2 (“Advanced Level Linux Professional“)• Exam 201 - Kernel, Filesystem, Hardware, System

administration, Scripting, ...• Exam 202 - Network configuration, Mail/News, DNS, System

security, ...

• LPIC-3 (“Senior Level Linux Professional“)• Six exams

32 of 33 Michael Faath, Martin Lowinski Linux Basics

Linux Basics

Thanks for your attention.

michael@faath.net – gpg: 0xA2586B21

martin@goldtopf.org – gpg: 0x35CDCCC4

33 of 33 Michael Faath, Martin Lowinski Linux Basics