Skip to main content

Topic 203: Filesystem and Devices

Kursvorgaben LPI:

Topic 203: Filesystem and Devices

203.1 Operating the Linux filesystem (weight: 4)

Candidates should be able to properly configure and navigate the standard Linux filesystem. This objective includes configuring and mounting various filesystem types.

Key Knowledge Areas

  • The concept of the fstab configuration
  • Tools and utilities for handling SWAP partitions and files
  • Use of UUIDs for identifying and mounting file systems
  • Understanding of systemd mount units

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

  • /etc/fstab
  • /etc/mtab > heute symlink auf /proc/mounts
  • /proc/mounts
  • mount and umount
  • blkid
  • sync
  • gzip
  • bzip2
  • module tools
  • /usr/src/linux/.config
  • /lib/modules/kernel-version/*
  • depmod
  • dkms

Beispiele

  • make
  • kernel
  • Kernel kompilieren
  • dkms
  • initrd
  • swapon
  • swapoff

Beispiele

  • mount und fstab
  • swap

203.2 Maintaining a Linux filesystem (weight: 3)

Candidates should be able to properly maintain a Linux filesystem using system utilities. This objective includes manipulating standard filesystems and monitoring SMART devices.

Key Knowledge Areas

  • Tools and utilities to manipulate and ext2, ext3 and ext4
  • ext3/4 Journal ist nur eine Liste der offenen Dateien. Erhöht nicht sie Sicherheit sondern beschleunigt den fsck. datajournal seit ext4. aber sehr langsam
  • Tools and utilities to perform basic Btrfs operations, including subvolumes and snapshots
  • Tools and utilities to manipulate XFS
  • Awareness of ZFS

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

  • mkfs (mkfs.*)
  • mkswap
  • fsck (fsck.*)
  • tune2fs, dumpe2fs and debugfs
  • tunefs -l /$DEV
  • debugfs konnte man mal dateien wiederherstellen
  • dump2fs
  • metadaten auslesen: z.B. Superblock
  • mke2fs -n $DEV alle Superblöcke berechnen
  • btrfs, btrfs-convert
  • xfs_info, xfs_check, xfs_repair, xfsdump and xfsrestore
  • smartd, smartctl

Beispiele

  • xfs
  • zfs
  • ext
  • debugfs
  • dumpe2fs
  • smart
  • btrfs

203.3 Creating and configuring filesystem options (weight: 2)

Candidates should be able to configure automount filesystems using AutoFS. This objective includes configuring automount for network and device filesystems. Also included is creating filesystems for devices such as CD-ROMs and a basic feature knowledge of encrypted filesystems.

Key Knowledge Areas

  • autofs configuration files
  • /etc/auto.misc
  • Understanding of automount units
  • UDF and ISO9660 tools and utilities
  • ISO9660 wird von cloud init verwendet
  • awareness of CD-ROM filesystems (HFS)
  • awareness of CD-ROM filesystem extensions (Joliet, Rock Ridge, El Torito)
  • Basic feature knowledge of data encryption (dm-crypt / LUKS)

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

  • /etc/auto.master
  • /etc/auto.[dir]
  • udisk
  • mkisofs
  • cryptsetup

Beispiele

  • autofs
  • systemd-automount
  • mkisofs
  • ecryptfs
  • cryptsetup-luks
  • clevis und tang

203.1 Operating the Linux filesystem


root@notebook24:/etc# cat /proc/swaps
Filename				Type		Size		Used		Priority
/dev/nvme0n1p5                          partition	32516092	0		-2
root@notebook24:/etc# ls -l  /etc/mtab
lrwxrwxrwx 1 root root 19  6. Aug 2025  /etc/mtab -> ../proc/self/mounts
root@notebook24:/etc#

203.2 Maintaining a Linux filesystem

Das EXT Journal ist eine Liste aller im FS offenen Dateien und sort in der Hauptsache für einen schnelleren mount nach einem Crash / unsauberen unmount. Es gibt auch “data journal”, das alle write operationen ins joural schreibt. Das degraded aber die write performance und wird deswegen quasi nie verwendet.

debugfs (eigentlich veraltet)

Wenn Du wirklich in der verzweifelten Situation bist, Dateien auf einem ext2/3/4-Dateisystem wieder herstellen zu müssen, schaue Dir ext4magic an.

mkfs.ext4 /dev/sda2
mkdir /mnt/sda2
mount /dev/sda2 /mnt/sda2
mkdir /mnt/sda2/testdir
dd if=/dev/zero of=/mnt/sda2/testdir/löschmich bs=1M count=5
ls -i /mnt/sda2/testdir/löschmich
rm /mnt/sda2/testdir/löschmich
umount /dev/sda2
debugfs -w /dev/sda2

debugfs:

help
ls
cd testdir
ls
lsdel

203.3 Creating and configuring filesystem options

autofs (Beispiel)

Einzelnes Verzeichnis automatisch mounten

Paket:

  • Debian (ab 10): autofs
mkfs.ext4 /dev/vg_system/lv_autofs1

/etc/auto.misc

#Key    -Options             Location
test    -fstype=auto,noatime :/dev/vg_system/lv_autofs1

/etc/auto.master.d/test.autofs

# mount-point   Map            -Options
/misc           /etc/auto.misc ---timeout=30,discard
service autofs restart
automount -m
mount -t autofs
ls /misc/test; date
tail -n 1 /proc/mounts
Dokumentation
NFS-Server automatisch mounten

Voraussetzung: NFS v3 Server im Netzwerk vorhanden

/etc/auto.master :

/net    -hosts
service autofs restart

Auf Verzeichnis /srv/nfs des NFS-Servers 192.168.122.243 zugreifen:

cd /net/192.168.122.243/srv/nfs

https://wiki.lab.linuxhotel.de/doku.php/lpi2:cryptsetup-luks

Clevis und Tang für die automatische Entsperrung von verschlüsselten Systemen (z.B. im Serverbetrieb)

https://github.com/latchset/clevis

https://github.com/latchset/tang