CertGrid CertGrid
Installation·Linux Foundation Certified System Administrator

LFCS lab: Ubuntu, AlmaLinux, and safe storage practice

Two Ubuntu hosts and one RHEL host, because LFCS is sat on either family and the candidate chooses. None of the three has a spare disk, so the Storage domain is taught on loop devices - a file, losetup, and then genuinely mkfs, mount and /etc/fstab against a real block device. That started as a constraint and turned out to be the better lesson, because a reader following along has no spare disk either.

Start Here Guide 2 of 38 Beginner

Ubuntu 26.04 with kernel 7.0.0 and systemd 259; RHEL 10.0 with kernel 6.12 and systemd 257. Loop devices behave identically on both.

Two Ubuntu hosts and one AlmaLinux host, all three belonging to this path. What matters is the distribution in the OS column.
Server NameIP AddressOSRolesCPURAMHDD
LFCS-A01192.168.0.70Ubuntu 26.04 LTSPrimary host - most guides run only here2 Core4 GB50 GB
LFCS-B01192.168.0.71Ubuntu 26.04 LTSSecond host - so networking has two ends2 Core4 GB50 GB
LFCS-C01192.168.0.72AlmaLinux 10.2The other distribution - dnf, firewalld and NetworkManager2 Core4 GB50 GB

This guide includes

Use this before the first LFCS guide. This matters because the exam lets you choose the distribution and this lab has no spare disk - so every storage task is done on a block device you build out of a file.

Before you start

  1. The three machines

    One primary Ubuntu host, a second Ubuntu host so networking has two ends, and one RHEL host for every command that differs.

    bash Example session
    hostnamectl | head -8  Static hostname: lfcs-a01        Icon name: computer-vm          Chassis: vm 🖴Chassis Asset Tag: 8665-3071-9889-5090-6456-3643-06       Machine ID: 0866a31c6c9e49e38f752fa07a1c8c72          Boot ID: f796628f1ad64c93a5a19e6040b4b41e   Virtualization: microsoft Operating System: Ubuntu 26.04 LTShostnamectl hostname; . /etc/os-release; echo "$PRETTY_NAME  kernel $(uname -r)"lfcs-a01Ubuntu 26.04 LTS  kernel 7.0.0-30-generichostnamectl hostname; . /etc/os-release; echo "$PRETTY_NAME  kernel $(uname -r)"lfcs-c01AlmaLinux 10.2 (Lavender Lion)  kernel 6.12.0-211.7.3.el10_2.x86_64

    Expected resultlfcs-a01 on Ubuntu 26.04, lfcs-b01 on Ubuntu 26.04, and rhcsa-util01 on RHEL 10.0.

    Success conditionYou know which machine each command belongs to.

  2. No spare disk

    One 50 GB disk, all of it in use - and that is the same situation a reader following along is in.

    bash Example session
    lsblk -o NAME,SIZE,TYPE,FSTYPE,MOUNTPOINT | grep -v '^sr0\|^fd0'NAME                          SIZE TYPE FSTYPE      MOUNTPOINTsda                            50G disk|-sda1                          1M part|-sda2                          2G part xfs         /boot`-sda3                         48G part LVM2_member  |-almalinux_lfcs--c01-root 44.1G lvm  xfs         /  `-almalinux_lfcs--c01-swap  3.9G lvm  swap        [SWAP]df -h / /boot | column -tFilesystem                            Size  Used  Avail  Use%  Mounted  on/dev/mapper/almalinux_lfcs--c01-root  44G   6.0G  39G    14%   //dev/sda2                             2.0G  454M  1.5G   23%   /bootls -l /dev/loop-control && losetup -a | head -3; echo "attached loop devices: $(losetup -a | wc -l)"crw-rw----. 1 root disk 10, 237 Aug 29 13:36 /dev/loop-controlattached loop devices: 0

    Expected resultsda with a 1M BIOS partition, a 2G /boot, and 48G of LVM holding / - and zero attached loop devices.

    Success conditionYou know why the storage track is written the way it is.

  3. A real block device, made from a file

    truncate a file, attach it with losetup, and look at what the kernel now thinks it has.

    Compare the two du outputs.

    bash Example session
    sudo mkdir -p /opt/lfcs && sudo truncate -s 512M /opt/lfcs/tour.img && ls -lh /opt/lfcs/tour.img && du -h --apparent-size /opt/lfcs/tour.img && du -h /opt/lfcs/tour.img-rw-r--r--. 1 root root 512M Aug 29 15:15 /opt/lfcs/tour.img512M	/opt/lfcs/tour.img0	/opt/lfcs/tour.imgsudo losetup --find --show /opt/lfcs/tour.img/dev/loop0lsblk -o NAME,SIZE,TYPE /dev/loop0 && sudo blockdev --getsize64 /dev/loop0 && cat /sys/block/loop0/queue/logical_block_sizeNAME   SIZE TYPEloop0  512M loop536870912512

    Expected result512M from ls -lh and du --apparent-size, but 0 from du - then /dev/loop0, 512M, type loop, 536870912 bytes, 512-byte sectors.

    Success conditionYou can create a block device on any machine.

  4. A filesystem on it, and a mount

    mkfs.ext4, blkid, mount - the same three commands you would run on /dev/sdb1.

    bash Example session
    sudo mkfs.ext4 -q -L lfcstour /dev/loop0 && sudo blkid /dev/loop0/dev/loop0: LABEL="lfcstour" UUID="f32dc454-84fa-44dc-b3fb-3564bd6dd4be" BLOCK_SIZE="4096" TYPE="ext4"sudo mkdir -p /mnt/tour && sudo mount /dev/loop0 /mnt/tour && df -h /mnt/tour | tail -1 && sudo touch /mnt/tour/proof && ls /mnt/tour/dev/loop0      488M   24K  452M   1% /mnt/tourlost+foundproof

    Expected resultA LABEL, a UUID and BLOCK_SIZE="4096" from blkid; then df reporting 488M of a 512M device, with lost+found and the file just created.

    Success conditionYou have a working filesystem you made yourself.

  5. And taken back down

    The cleanup, in the order it has to happen.

    bash Example session
    sudo umount /mnt/tour && sudo losetup -d /dev/loop0 && sudo rmdir /mnt/tour && sudo rm -f /opt/lfcs/tour.img && sudo rmdir /opt/lfcs 2>/dev/null; losetup -a | wc -l; ls /opt/lfcs 2>&1 | tail -10ls: cannot access '/opt/lfcs': No such file or directory

    Expected result0 attached loop devices and /opt/lfcs: No such file or directory.

    Success conditionYou can leave the machine as you found it.

  6. What sudo is set up to allow

    Every guide on this path uses sudo, so it is worth seeing exactly what that means here.

    bash Example session
    sudo -n -l | tail -4User sysadmin may run the following commands on lfcs-a01:    (ALL : ALL) ALL    (ALL) NOPASSWD: ALLid; groupsuid=1000(sysadmin) gid=1000(sysadmin) groups=1000(sysadmin),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),100(users),101(lxd)sysadmin adm cdrom sudo dip plugdev users lxd

    Expected result(ALL : ALL) ALL and (ALL) NOPASSWD: ALL, and membership of sudo among others.

    Success conditionYou know why no command on this path prompts for a password.

Troubleshooting

Official sources