Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Linux Dateisystem

Linux Dateisystem

Was ist ein Dateisystem?
Welche Verzeichnisse existieren in jedem Linux
System?
Wo darf ich als Benutzer einfach Daten ändern?
Wo sollte man nicht einfach etwas ändern?
Was ist POSIX oder Linux Standard Base?
Unterschiede zu anderen Betriebssystemen

Christian Münch

March 16, 2022
Tweet

More Decks by Christian Münch

Other Decks in Technology

Transcript

  1. Linux Dateisystem
    1
    1

    View Slide

  2. Fragen
    Was ist ein Dateisystem?
    Welche Verzeichnisse existieren in jedem Linux
    System?
    Wo darf ich als Benutzer einfach Daten ändern?
    Wo sollte man nicht einfach etwas ändern?
    Was ist POSIX oder Linux Standard Base?
    Unterschiede zu anderen Betriebssystemen
    2
    2
    Linux Stammtisch Worms -
    Linux Stammtisch Worms - https://wolust.de
    https://wolust.de - @cmuench
    - @cmuench

    View Slide

  3. POSIX
    Portable Operating System Interface
    Für UNIX entwickelte Programmierschnittstelle
    Die gängigen Dateisysteme (ext4, zfs, ...) halten
    sich an den POSIX Standard
    Kompatible Systeme sind z.B. Minix, macOS, HP-
    UX, Solaris
    "Everything is a file"
    3
    3
    Linux Stammtisch Worms -
    Linux Stammtisch Worms - https://wolust.de
    https://wolust.de - @cmuench
    - @cmuench

    View Slide

  4. Ist Linux POSIX
    kompatibel?
    je und nein
    Es gibt spezielle Linux Distributionen die POSIX
    kompatibel sind.
    Linux ist weitestgehend POSIX kompatibel
    4
    4
    Linux Stammtisch Worms -
    Linux Stammtisch Worms - https://wolust.de
    https://wolust.de - @cmuench
    - @cmuench

    View Slide

  5. Linux Standard Base (LSB)
    Arbeitsgruppe der Linux Foundation
    Versucht Standards zwischen Linux Distrubutionen
    schaffen
    Distributionen (Debian, SuSE, Redhat, Ubuntu, ...)
    Möchte keine POSIX Kompatibilität um jeden Preis
    Filesystem Hierarchy Standard (FHS)
    5
    5
    Linux Stammtisch Worms -
    Linux Stammtisch Worms - https://wolust.de
    https://wolust.de - @cmuench
    - @cmuench

    View Slide

  6. LSB Informationen
    lsb_release -a

    No LSB modules are available.

    Distributor ID: Ubuntu
    Description: Ubuntu 16.04.6 LTS

    Release: 16.04

    Codename: xenial
    6
    6
    Linux Stammtisch Worms -
    Linux Stammtisch Worms - https://wolust.de
    https://wolust.de - @cmuench
    - @cmuench

    View Slide

  7. Datei Hierarchie
    Linux Stammtisch Worms -
    Linux Stammtisch Worms - https://wolust.de
    https://wolust.de - @cmuench
    - @cmuench 7
    7

    View Slide

  8. /
    /bin
    /boot
    /dev
    /etc
    /home
    /root
    /tmp
    8
    8
    Linux Stammtisch Worms -
    Linux Stammtisch Worms - https://wolust.de
    https://wolust.de - @cmuench
    - @cmuench

    View Slide

  9. /lib
    /media
    /proc
    /run
    /sbin
    /srv
    /usr
    /var
    /opt
    9
    9
    Linux Stammtisch Worms -
    Linux Stammtisch Worms - https://wolust.de
    https://wolust.de - @cmuench
    - @cmuench

    View Slide

  10. Wichtige
    Unterverzeichnisse
    /usr/bin
    /usr/sbin
    /usr/local
    /usr/lib
    /usr/src
    /var/log
    /var/lib
    /var/spool 10
    10
    Linux Stammtisch Worms -
    Linux Stammtisch Worms - https://wolust.de
    https://wolust.de - @cmuench
    - @cmuench

    View Slide

  11. Wo sollte ich meine
    Dateien ablegen?
    11
    11
    Linux Stammtisch Worms -
    Linux Stammtisch Worms - https://wolust.de
    https://wolust.de - @cmuench
    - @cmuench

    View Slide

  12. Wo sollte man nichts
    manuell anpassen?
    12
    12
    Linux Stammtisch Worms -
    Linux Stammtisch Worms - https://wolust.de
    https://wolust.de - @cmuench
    - @cmuench

    View Slide

  13. Unterschiede zu anderen
    Betriebssystemen
    Keine Laufwerksbuchstaben
    Links und Symlinks
    Mount
    13
    13
    Linux Stammtisch Worms -
    Linux Stammtisch Worms - https://wolust.de
    https://wolust.de - @cmuench
    - @cmuench

    View Slide

  14. Nützliche Tools
    Alles unter /bin (ls, mount, mkdir, rmdir, rm, mv,
    mount, umount, df)
    tree
    ranger
    ... und noch 10.000 andere
    14
    14
    Linux Stammtisch Worms -
    Linux Stammtisch Worms - https://wolust.de
    https://wolust.de - @cmuench
    - @cmuench

    View Slide

  15. Mount
    mount -t iso9660 -o ro /dev/cdrom /mnt

    15
    15
    Linux Stammtisch Worms -
    Linux Stammtisch Worms - https://wolust.de
    https://wolust.de - @cmuench
    - @cmuench

    View Slide

  16. Mount
    $> mount

    /dev/sda5 on / type ext4 (rw,errors=remount-ro)

    proc on /proc type proc (rw,noexec,nosuid,nodev)

    sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)

    none on /sys/fs/fuse/connections type fusectl (rw)

    /dev/sda7 on /backup type vfat (rw)

    /dev/sdb on /media/myusb type vfat (rw,nosuid,nodev,uid=1000,gid=1000,s
    16
    16
    Linux Stammtisch Worms -
    Linux Stammtisch Worms - https://wolust.de
    https://wolust.de - @cmuench
    - @cmuench

    View Slide

  17. fstab
    $> cat /etc/fstab

    proc /proc proc nodev,noexec,nosuid 0 0

    /dev/sda5 / ext4 errors=remount-ro 0 1

    /dev/sda6 /mydata ext2 defaults 0 2

    /dev/sda7 /backup vfat defaults 0 3

    17
    17
    Linux Stammtisch Worms -
    Linux Stammtisch Worms - https://wolust.de
    https://wolust.de - @cmuench
    - @cmuench

    View Slide

  18. $> ls -l /usr/local

    total 36

    drwxr-xr-x 2 root root 4096 Oct 2 03:35 bin

    drwxr-xr-x 2 root root 4096 Nov 29 2018 etc

    drwxr-xr-x 2 root root 4096 Nov 29 2018 games

    drwxr-xr-x 2 root root 4096 Nov 29 2018 include

    drwxr-xr-x 4 root root 4096 Nov 29 2018 lib

    lrwxrwxrwx 1 root root 9 Nov 29 2018 man -> share/man

    drwxr-xr-x 3 root root 4096 Jan 26 2019 mrpe

    drwxr-xr-x 2 root root 4096 Dec 31 2018 sbin

    drwxr-xr-x 6 root root 4096 Dec 31 2018 share

    drwxr-xr-x 2 root root 4096 Nov 29 2018 src

    18
    18
    Linux Stammtisch Worms -
    Linux Stammtisch Worms - https://wolust.de
    https://wolust.de - @cmuench
    - @cmuench

    View Slide

  19. Resourcen
    https://en.wikipedia.org/wiki/POSIX
    https://en.wikipedia.org/wiki/Linux_Standard_Base
    https://en.wikipedia.org/wiki/Filesystem_Hierarchy_Sta
    19
    19
    Linux Stammtisch Worms -
    Linux Stammtisch Worms - https://wolust.de
    https://wolust.de - @cmuench
    - @cmuench

    View Slide