Packages and storage: apt, dnf, LVM, tar
Software with apt and dnf, disks, partitions and mounting.
Level 201 · 25 lessons · 27 practice labs
Lessons
Packages
- Package managers: apt and dnf: You will understand how package managers like apt and dnf deliver software, and why installing from signed repositories matters for security.
- Installing, removing and upgrading: You will learn to install, remove and upgrade packages, and see why clearing out unused packages keeps a system smaller and safer.
- Repositories and sources.list: You will understand what software repositories are, how to read the sources.list file, and the risk of adding an untrusted repository.
- RPM queries: which package owns a file: You will use RPM queries to find which package owns a file and to check whether a package's files have been modified.
- DNF history and a local repository: You will use DNF history to see what was installed and when, undo a change, and set up your own local repository.
- Building software from source: configure, make, install: You will compile a program from source, resolve its dependencies and see why removing it is harder.
- Shared libraries: ldd and ldconfig: You will see which libraries a program needs with ldd and fix a missing-library error with ldconfig.
- Verifying package integrity: rpm -V and debsums: With rpm -V and debsums you can check whether installed files were altered and pinpoint suspicious deviations.
- Short task: find a modified package file and repair the package
Disks and volumes
- Block devices and partitions: lsblk: You will use lsblk to list disks and partitions and learn to read how storage is laid out on a system.
- Partition tables: MBR, GPT, fdisk and parted: You will create and delete partitions on a new disk with fdisk and parted and explain MBR versus GPT.
- Creating and checking file systems: mkfs, fsck: You will create ext4 and XFS file systems, read their UUID and label, and check a damaged one with fsck.
- Mounting and /etc/fstab: You will learn to attach a disk to the directory tree and make it mount at boot through /etc/fstab, and how one bad line can break booting.
- Swap space: partitions and files: You will create and enable a swap partition or file and add it to fstab to keep it.
- Disk usage and inodes: df, du, find: You will use df, du and find to discover why a disk is full, and understand inodes, which limit the number of files.
- Deleted but still using space: reclaiming disk with lsof: You can explain the gap between df and du with lsof and safely recover space held by a process that still has a file open.
- LVM: physical and logical volumes: You will learn how LVM pools physical disks into one space and offers flexible logical volumes, and how to create them.
- Growing a logical volume while it runs: You will learn to enlarge a logical volume that is nearly full without stopping the service, and the steps to resize its file system to match.
- Software RAID with mdadm: You will build a mirror (RAID 1) array with mdadm, simulate a disk failure and repair the array.
- Encrypted volumes with LUKS: You will encrypt a partition with LUKS, open and close it, and explain the consequence of losing the passphrase.
- Short task: prepare a new disk with LVM and mount it at boot
Archives and backups
- Archives and compression: tar, gzip, zip: You will use tar, gzip and zip to archive and compress files, and learn to list an archive's contents without unpacking it.
- Backups, checksums and scp: You will learn to make a backup, verify with a checksum that it is not corrupted, and copy it securely to another machine with scp.
- Moving data with ownership and permissions: cp -a, rsync -a and tar: With cp -a, rsync -a and tar you can move a directory to another account or disk without losing ownership, permissions or timestamps.
- Capstone: a daily backup and disk clean-up: For a fictional company's lab server you will set up a backup that runs every day and safely clear out old files that fill the disk.
Practice labs
- Find which package a file came from: Use a package query to find which package a suspicious binary belongs to and submit the package name.
- Fix a broken repository definition: Fix the wrong release name and malformed line in a source list that errors on update so package lists refresh.
- Undo a bad install from transaction history: Find the package update that broke a service in the transaction history, undo it and confirm the old version is back.
- Find a modified package file and repair the package: Use package integrity verification to find the altered file and reinstall the package to restore it.
- Sort changes to package files by kind: Verify every installed package, read the output to separate expected config changes from programs whose permissions or contents changed, and report only the suspicious files.
- Verify an installed package's signature and origin: Query the signing key and source repository of a suspicious hand-installed package, compare it with the checksum of the repository version, replace the unsigned one with the trusted version and show that verification comes back clean.
- Read the state of a mirrored array: From /proc/mdstat and mdadm --detail find the array's level, its member disks and whether it is in sync, and write them to the answer file.
- Build a mirror from two disks: Create a RAID 1 array from two disks with mdadm, format it and make the configuration persistent.
- Replace a failed mirror disk and verify the resync: Remove the failed member from a mirror, add the spare disk and show the array is clean once the resync finishes.
- Find a missing shared library: Use ldd to find the library a program that will not start is missing and submit its name.
- Register a library in a custom directory: Register a library installed under /opt through ldconfig configuration so the program runs without an environment variable.
- Build from source into /usr/local: Build a source archive with configure, make and make install under a custom prefix, solving a missing header error.
- Map the server's disks and partitions: Use lsblk and blkid to tabulate the disks, partitions, file systems and mount points.
- Partition, format and mount a new disk: Create a GPT table and one partition on an empty disk, format it ext4 and set it to mount at boot.
- Check and repair a file system that will not mount: Repair a data partition that refuses to mount with fsck while unmounted and report where recovered files ended up.
- Replace a device name in fstab with a UUID: Fix the fstab line of a partition that fails to mount when disk order changes to use a UUID and verify with mount -a.
- Add a swap file to a server out of memory: Create a swap file with correct permissions, enable it and make it persist across reboots.
- Rescue a server that will not boot on a bad fstab line: On a server that drops to emergency mode waiting for a missing disk, find the bad fstab line, fix it with nofail and confirm a normal boot.
- Solve a disk that is full with space free: On a partition where df shows space but files cannot be created, find the directory exhausting inodes and submit it.
- Find a deleted file still using space: Use lsof to find the deleted but open file holding space du cannot see and reclaim it without stopping the process.
- Set up a daily backup and disk clean-up: Write and schedule a script that archives application data by date and removes archives and temp files older than seven days.
- Prepare a new disk with LVM and mount it at boot: Create a physical volume, volume group and logical volume from an empty disk, format it and add it to fstab.
- Grow a full logical volume while it runs: Grow a nearly full logical volume and its file system from free space in the group without stopping the service.
- Prepare an encrypted volume for sensitive data: Encrypt an empty partition with LUKS, open, format and mount it, and show the data is unreadable once closed.
- Extract only one directory from an archive: List a large tar.gz archive and extract only the requested config directory to the target location.
- Verify the integrity of a transferred backup: Compare the archives' checksums with the given checksum file and submit the one that was corrupted in transfer.
- Move data to a new disk with ownership and permissions: Move the application directory to a new partition keeping ownership, permissions, links and timestamps, and verify zero difference.
About this course
Software with apt and dnf, disks, partitions and mounting.
What you will learn
- Packages
- Disks and volumes
- Archives and backups
Prerequisites
Finishing the level 101 courses of the same path, or knowing those topics, is enough.
Lab environment
Lessons run in your own Kali Linux terminal that opens in the browser. Nothing to install; the lab starts clean in every lesson.
Frequently asked questions
- Is this course right for my level?
- The course is at level 201; it assumes you know the topics of the lower-level courses.
- Is there anything to install?
- No. Every lesson runs in your own lab environment that opens in the browser.
- How do lessons work?
- Each lesson has 8 to 10 steps and a short quiz. Early steps show the command to type, later steps give less help; if two attempts fail, the solution opens.
- Can I try it for free?
- Yes. The first three lessons of every course are free.