Skip to main content

Topic 206: System Maintenance

Kursvorgaben LPI:

Topic 206: System Maintenance

206.1 Make and install programs from source (weight: 2)

Candidates should be able to build and install an executable program from source. This objective includes being able to unpack a file of sources.

Key Knowledge Areas

  • Unpack source code using common compression and archive utilities.
  • Understand basics of invoking make to compile programs.
  • Apply parameters to a configure script.
  • Know where sources are stored by default.

The following is a partial list of the used files, terms and utilities

  • /usr/src/
  • gunzip
  • gzip
  • bzip2
  • xz
  • tar
  • configure
  • with without enable disable
  • make
  • uname
  • install
  • fancy copy mit rechten anpassen in einem schritt
  • kann auch verzeichnisse anlegen
  • patch

Beispiele

  • Quellpakete
  • make
  • patch
  • install

206.2 Backup operations (weight: 3)

Candidates should be able to use system tools to back up important system data.

Key Knowledge Areas

  • Knowledge about directories that have to be included in backups
  • Awareness of network backup solutions such as Amanda, Bacula, Bareos and BackupPC
  • Knowledge of the benefits and drawbacks of tapes, CDR, disk or other backup media
  • Perform partial and manual backups.
  • Verify the integrity of backup files.
  • Partially or fully restore backups.

The following is a partial list of the used files, terms and utilities

  • /bin/sh
  • dd
  • tar
  • tar -t zeigt dateien an
  • -c $PATH nimmt $PATH als Basis statt absolut oder PWD
  • tar -af blah.zstd // nimmt automatisch das rictige compression flag anhand des Dateinamens
  • /dev/st* and /dev/nst*
  • nonrevinding streamer tape
  • mt magnetic tape
  • rsync
  • rsync -aXA // max atribute
  • Slash bei Quelle wichtig
  • --del

Beispiele

  • tar
  • rsync

206.3 Notify users on system-related issues (weight: 1)

Candidates should be able to notify the users about current issues related to the system.

Key Knowledge Areas

  • Automate communication with users through logon messages.
  • Inform active users of system maintenance

The following is a partial list of the used files, terms and utilities

  • /etc/issue
  • /etc/issue.net
  • /etc/motd
  • wall
  • /sbin/shutdown
  • systemctl

206.1 Make and install programs from source

Quellpakete installieren

wget https://ftp.gnu.org/gnu/tar/tar-latest.tar.gz
tar xzf tar-latest.tar.gz
cd tar-1.35
./configure

Fehlermeldungen beachten und fehlende Pakete ( enthalten meist „lib“ und „devel“ im Namen ) nachinstallieren.

make

Wenn make erfolgreich durchgelaufen ist, dann als Benutzer root

make install

oder

checkinstall

ausführen.

Patch

mkdir a b
cp /etc/hosts a/
cp /etc/hosts b/
vi b/hosts

Zeile einfügen, andere Zeile bearbeiten, weitere Zeile löschen

Patch erstellen:

diff -u a/hosts b/hosts > hosts.patch

Patch anwenden:

patch -b -p0 < hosts.patch

Patch wieder entfernen:

patch -R -p0 < hosts.patch

Das selbe, aus dem Verzeichnis heraus:

cd a

Patch anwenden:

patch -b -p1 < ../hosts.patch

Patch wieder entfernen:

patch -R -p1 < ../hosts.patch

206.2 Backup operations

tar

tar -cz /usr/share/ > share.tar.gz
tar -c /usr/share/ > share.tar
file share.tar
tar -c -xz /usr/share/ > share.tar.xz
tar -cxz /usr/share/ > share.tar.xz
tar -c --xz /usr/share/ > share.tar.xz
cd /usr
tar -c share/ > ~/share.tar
tar -cC /usr/ share/ > share.tar
tar -tf share.tar
tar -cC /usr/ share/ | zstd > share.tar.zst
tar -cC /usr/ share/ --zstd > share.tar.zst

zstdcat share.tar.zst | tar -x
tar -xf share.tar.zst
tar -x --zstd < share.tar.zst

rsync

nutzer24@notebook24:~$ file /usr/bin/rsync
/usr/bin/rsync: ELF 64-bit LSB pie executable, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=516451447e750e386980a22656f9b2edcb5e6dfa, for GNU/Linux 3.2.0, stripped
nutzer24@notebook24:~$ rsync -aXA --del /usr/share/ share

Tape Devices /dev/st0-x (Streaming Tape)

Tape Devices, die nicht automatisch zurückspulen /dev/nst0-x

206.3 Notify users on system-related issues