LPI BSD Specialist study materials
LPI BSD Specialist study resources

LPI BSD Specialist practice questions

One question at a time. Build your LPI BSD Specialist understanding.

First 50 of 200 questions. Each one lists the choices, the correct answer, and an explanation. The checker at the top of this page saves progress in this browser when it is available.

Continue in the practice tool above to load more questions, 50 at a time.

Question 1BSD Installation and Software Management

On a FreeBSD system, which command installs a binary package from the configured repositories while resolving and installing its dependencies automatically?

  1. pkg register
  2. pkg install Correct answer.
  3. pkg add
  4. pkg create

Explanation

pkg install resolves dependencies from the remote repository metadata and installs the named package together with everything it needs. pkg add is for installing a local package file and does not consult repositories for dependencies. The other subcommands handle registration and package creation, not repository-based installation.

Question 2BSD Installation and Software Management

Which file on a FreeBSD system holds the list of package repositories that pkg(8) queries for binary packages?

  1. /usr/local/etc/pkg.conf
  2. /etc/pkg/FreeBSD.conf Correct answer.
  3. /etc/portsnap.conf
  4. /etc/make.conf

Explanation

The default repository configuration shipped with the base system lives in /etc/pkg/FreeBSD.conf, which points pkg at the official mirrors. Administrators can override or extend repositories in /usr/local/etc/pkg/repos. The other files serve unrelated purposes such as portsnap or ports builds.

Question 3BSD Installation and Software Management

A FreeBSD administrator wants to install a package without its automatic dependencies being recorded as manually installed. Which pkg subcommand displays which packages were installed automatically as dependencies?

  1. pkg query Correct answer.
  2. pkg autoremove
  3. pkg audit
  4. pkg info

Explanation

pkg query can filter installed-package metadata using %a, the automatic-installation flag. For example, pkg query -e '%a = 1' '%n' lists the names of all packages marked automatic, including dependencies that are still needed. pkg autoremove targets only unneeded automatic dependencies.

Question 4BSD Installation and Software Management

Which command refreshes the local pkg catalog so that newly published package versions become visible to pkg install?

  1. pkg update Correct answer.
  2. pkg clean
  3. pkg fetch
  4. pkg upgrade

Explanation

pkg update downloads fresh repository metadata, making new package versions available for installation. pkg upgrade then applies available upgrades to installed packages. Fetch and clean deal with downloading and clearing cached package files, not refreshing catalog metadata.

Question 5BSD Installation and Software Management

When installing FreeBSD from the bsdinstall installer, which menu is used to choose between a full installation and a limited set of system components?

  1. Root Password
  2. Distribution Select Correct answer.
  3. Partitioning
  4. Network Configuration

Explanation

The Distribution Select screen lets the installer choose which distribution sets to install, such as the base system, kernel, and optional components. Partitioning handles disk layout, while network and password screens configure runtime settings. Selecting distributions determines what system components end up on disk.

Question 6BSD Installation and Software Management

During a FreeBSD installation, the administrator wants the system to boot using UEFI. Which partitioning scheme should be selected in bsdinstall?

  1. APM
  2. BSD disklabel
  3. GPT Correct answer.
  4. MBR

Explanation

UEFI firmware on modern hardware requires a GUID Partition Table so that an EFI system partition can be created. MBR is the legacy scheme associated with BIOS booting. APM is the Apple partition map and BSD disklabel is a nested partitioning layer, neither of which provides UEFI boot support.

Question 7BSD Installation and Software Management

Which file does the FreeBSD installer read to apply post-installation configuration such as adding users or enabling services automatically?

  1. /etc/installerconfig Correct answer.
  2. /etc/fstab
  3. /boot/loader.conf
  4. /etc/rc.conf

Explanation

bsdinstall supports scripted installations that read /etc/installerconfig to perform configuration steps after the base system is unpacked. rc.conf controls runtime services on a running system, fstab defines mounts, and loader.conf configures the boot loader. The installerconfig file is the automation hook for post-install tasks.

Question 8BSD Installation and Software Management

On FreeBSD, which command creates a new user account interactively and also creates the home directory and sets the password?

  1. adduser Correct answer.
  2. vipw
  3. pw useradd
  4. useradd

Explanation

adduser is the interactive front end that walks through account creation, creates the home directory from a skeleton, and prompts for a password. pw useradd is the low-level non-interactive tool and does not prompt. useradd is not the standard FreeBSD interactive tool, and vipw edits the password database directly.

Question 9BSD Installation and Software Management

Which command on FreeBSD adds a user to the wheel group so the account can use su to become root?

  1. usermod -aG wheel alice
  2. pw usermod wheel -g alice
  3. groupadd -a alice wheel
  4. pw groupmod wheel -m alice Correct answer.

Explanation

pw groupmod with the -m flag adds an existing user as a member of the named group without removing other members. The other forms either misuse pw flags or use Linux-style tools that are not part of the base FreeBSD userland. Group membership changes take effect at the next login.

Question 10BSD Installation and Software Management

A FreeBSD system needs additional software compiled from source with custom options. Which command is used to fetch and extract the ports tree?

  1. cvsup ports
  2. portsnap fetch extract Correct answer.
  3. make fetchindex
  4. pkg fetch ports

Explanation

portsnap fetch extract downloads the compressed ports tree snapshot and extracts it into /usr/ports. The other commands either belong to pkg, to obsolete tooling, or to index generation rather than obtaining the tree itself. On current releases git is also used, but among these choices portsnap is the correct tree-fetching tool.

Question 11BSD Installation and Software Management

Inside a ports directory, which command installs the port along with its dependencies while honoring any options selected in the configuration dialog?

  1. make config
  2. make install Correct answer.
  3. make build
  4. make clean

Explanation

make install in a port directory builds the software if needed, resolves and installs dependencies, and installs the result. The configuration dialog is presented as part of the build when options are unset. The other targets either only build, only configure, or remove work files.

Question 12BSD Installation and Software Management

Which ports framework variable should be set to suppress interactive configuration prompts during an unattended rebuild?

  1. OPTIONS_SET
  2. WITH_OPTIONS
  3. BATCH Correct answer.
  4. DIALOGOPTIONS

Explanation

Setting BATCH=yes suppresses interactive configuration prompts, allowing unattended ports builds to use saved options or defaults. It does not save selected options itself; interactive selections are recorded through make config in the options database.

Question 13BSD Installation and Software Management

Which command reports which installed package owns a particular file, such as /usr/local/bin/bash?

  1. pkg files
  2. pkg search
  3. pkg which Correct answer.
  4. pkg info

Explanation

pkg which maps a file path back to the installed package that provides it. pkg info shows metadata for a named package, pkg search queries the repository catalog, and pkg files lists the files belonging to a package. Only pkg which performs the reverse lookup from file to package.

Question 14BSD Installation and Software Management

An administrator wants to see only the packages installed manually, excluding automatic dependencies. Which pkg query expression accomplishes this?

  1. pkg query -a '%n %v'
  2. pkg query -a '%n %a'
  3. pkg query -e '%a = 0' '%n' Correct answer.
  4. pkg query -a '%n'

Explanation

The automatic flag is stored in package metadata and can be filtered with the -e expression option. Using -e '%a = 0' restricts output to manually installed packages. The other forms print names or versions for all packages without filtering on the automatic flag.

Question 15BSD Installation and Software Management

Which command removes an installed package together with dependencies that are no longer needed?

  1. pkg purge
  2. pkg autoremove Correct answer.
  3. pkg remove --auto
  4. pkg delete -A

Explanation

pkg autoremove removes packages marked as automatically installed that no longer have any dependent package requiring them. pkg delete removes a named package but leaves orphaned dependencies behind. The other options are not valid pkg subcommand forms for this task.

Question 16BSD Installation and Software Management

Which file on FreeBSD defines the filesystems mounted at boot, including the root filesystem entry?

  1. /etc/devfs.conf
  2. /etc/fstab Correct answer.
  3. /etc/rc.conf
  4. /boot/defaults/loader.conf

Explanation

/etc/fstab lists filesystems with their mount points, types, and options, and is read at boot to mount everything including root. rc.conf controls services, loader.conf sets boot tunables, and devfs.conf controls device node permissions. Only fstab governs filesystem mounts.

Question 17BSD Installation and Software Management

A FreeBSD server must install a package from a local .pkg file without contacting any repository. Which command is appropriate?

  1. pkg fetch ./custom.pkg
  2. pkg install ./custom.pkg
  3. pkg add ./custom.pkg Correct answer.
  4. pkg create ./custom.pkg

Explanation

pkg add installs a package directly from a local file or URL and does not require repository metadata. pkg install expects a package name from a repository. pkg fetch downloads packages and pkg create builds a package from installed files.

Question 18BSD Installation and Software Management

Which bsdinstall step must be performed before the installer can write the base system to disk?

  1. Setting the root password
  2. Selecting and partitioning the target disk Correct answer.
  3. Configuring the network interface
  4. Adding user accounts

Explanation

The installer needs a partitioned and mounted target before it can extract the distribution sets onto it. Network configuration, root password, and user creation are configuration steps that can occur around the installation but are not prerequisites for writing the base system. Disk selection and partitioning therefore come first.

Question 19BSD Installation and Software Management

Which command shows the pkg version and confirms that the package manager database is initialized on a FreeBSD system?

  1. pkg -v Correct answer.
  2. pkg stats
  3. pkg info -a
  4. pkg bootstrap

Explanation

pkg -v prints the version of the pkg utility and is a quick check that pkg is present. If pkg is not yet bootstrapped, running it triggers the bootstrap process. The other commands operate on package data rather than simply reporting the tool version.

Question 20BSD Installation and Software Management

An administrator needs to build a port in a clean environment without installing it on the host. Which target produces a package file that can be installed elsewhere?

  1. make reinstall
  2. make deinstall
  3. make package Correct answer.
  4. make install

Explanation

make package builds the port if necessary and creates a binary package file in the port's work directory, which can then be copied and installed on another system. make install installs onto the local host, while deinstall and reinstall manipulate an existing installation.

Question 21BSD Installation and Software Management

Which command lists all installed packages along with their versions on FreeBSD?

  1. pkg info Correct answer.
  2. pkg show
  3. pkg list
  4. pkg search

Explanation

pkg info with no arguments lists the installed packages and their versions from the local database. pkg list is not the standard subcommand for this, pkg search queries remote repositories, and pkg show is not a valid subcommand. The local database is the authoritative source for installed package versions.

Question 22BSD Installation and Software Management

Which file controls whether a service such as sshd starts automatically at boot on FreeBSD?

  1. /etc/resolv.conf
  2. /etc/hosts
  3. /etc/services
  4. /etc/rc.conf Correct answer.

Explanation

/etc/rc.conf holds variables such as sshd_enable="YES" that the rc system reads at boot to start services. /etc/services maps service names to ports, /etc/hosts resolves hostnames locally, and /etc/resolv.conf configures DNS. Only rc.conf governs service startup.

Question 23BSD Installation and Software Management

After editing /etc/rc.conf to enable a new service, which command starts it immediately without rebooting?

  1. service sshd start Correct answer.
  2. sysrc sshd start
  3. rc.conf reload
  4. pkg start sshd

Explanation

The service command invokes the rc script for the named service with the requested action, so service sshd start launches it right away. sysrc edits rc.conf variables but does not start services. The other forms are not valid ways to start a service.

Question 24BSD Installation and Software Management

A FreeBSD administrator wants to change the hostname persistently. Which command modifies the correct rc.conf variable in one step?

  1. sysctl hostname=server1
  2. hostname server1
  3. sysrc hostname=server1 Correct answer.
  4. ifconfig hostname server1

Explanation

sysrc safely edits the named variable in /etc/rc.conf, making the change persistent across reboots. The hostname command changes it only for the current session, sysctl does not manage hostname this way, and ifconfig configures interfaces. Using sysrc avoids manual editing errors.

Question 25BSD Installation and Software Management

Which pkg subcommand checks installed packages against a database of known security vulnerabilities?

  1. pkg verify
  2. pkg vuln
  3. pkg check
  4. pkg audit Correct answer.

Explanation

pkg audit compares installed package versions against a vulnerability database and reports affected packages. pkg check verifies the integrity of installed files, pkg verify is not the standard subcommand for this, and pkg vuln is not a valid subcommand. Auditing is the security-review step in package maintenance.

Question 26BSD Installation and Software Management

On FreeBSD, an administrator wants to verify which repository catalog the local pkg database was last synchronized against before installing new software. Which file holds the repository configuration used by pkg?

  1. /etc/make.conf
  2. /etc/portsnap.conf
  3. /usr/local/etc/pkg.conf
  4. /etc/pkg/FreeBSD.conf Correct answer.

Explanation

The pkg tool reads repository definitions from configuration files under /etc/pkg/, and the default FreeBSD repository is declared in /etc/pkg/FreeBSD.conf. That file sets the URL, mirror type, and signature type for the repository the package database synchronizes with.

Question 27BSD Installation and Software Management

A FreeBSD administrator wants binary packages built with a specific ABI, for example FreeBSD:14:amd64, rather than the value auto-detected from the running kernel. Which pkg configuration setting controls this?

  1. SIGNATURE_TYPE
  2. MIRROR_TYPE
  3. ABI Correct answer.
  4. ARCH

Explanation

The ABI setting in pkg.conf overrides the automatically detected application binary interface, so pkg fetches packages built for the named platform and release. This is useful when installing packages for a different FreeBSD major version than the one currently running.

Question 28BSD Installation and Software Management

During a scripted FreeBSD installation, an administrator needs to install the base system onto a disk that was already partitioned and had filesystems created and mounted under /mnt. Which bsdinstall subcommand performs just the base extraction step?

  1. bsdinstall install Correct answer.
  2. bsdinstall script
  3. bsdinstall distfetch
  4. bsdinstall jail

Explanation

The bsdinstall install step extracts the base system distribution sets onto the target mounted at /mnt, and it can be invoked on its own when partitioning and mounting were handled separately. Scripted installs commonly chain individual bsdinstall subcommands rather than running the full interactive menu.

Question 29BSD Installation and Software Management

An administrator is preparing an unattended FreeBSD installation and needs the distribution sets to be fetched from an FTP mirror before extraction. Which bsdinstall subcommand retrieves the distribution sets?

  1. bsdinstall extract
  2. bsdinstall config
  3. bsdinstall distfetch Correct answer.
  4. bsdinstall auto

Explanation

The distfetch subcommand downloads the selected distribution sets, such as base and kernel, to the working directory so they can later be extracted. It is a separate step from extraction, which lets a script fetch once and install repeatedly.

Question 30BSD Installation and Software Management

A FreeBSD administrator wants to install a port with its default options without any interactive configuration prompt, even if options were never saved before. Which make invocation achieves this?

  1. make install clean BATCH=yes Correct answer.
  2. make deinstall reinstall
  3. make config recursive
  4. make install clean WITH_OPTIONS=no

Explanation

Setting BATCH=yes makes the ports framework skip the interactive options dialog and accept the defaults, which suits unattended builds. It is commonly combined with install and clean to fetch, build, install, and remove the work directory in one pass.

Question 31BSD Installation and Software Management

After a FreeBSD source upgrade, an administrator wants to remove obsolete files left in the system from the previous version. Which target of the source tree's Makefile performs this cleanup?

  1. make buildworld
  2. make delete-old Correct answer.
  3. make installkernel
  4. make distrib-dirs

Explanation

The delete-old target removes files that belonged to the previous world and are no longer part of the installed system, and delete-old-libs handles superseded shared libraries. Running it after installworld keeps the system free of stale binaries that could confuse the runtime linker.

Question 32BSD Installation and Software Management

Which FreeBSD command verifies that the files installed by the base system match the checksums recorded in the distribution manifest?

  1. mtree -f /etc/mtree/BSD.root.dist
  2. freebsd-version -k
  3. service -e
  4. pkg check -s Correct answer.

Explanation

The pkg check command with the checksum flag validates installed package files against recorded checksums, but base system files are not tracked by pkg, so that tool does not cover them. For the base system, mtree compares the installed files against the hierarchy specifications shipped in /etc/mtree.

Question 33Storage Devices and BSD Filesystems

On a FreeBSD system, which device node refers to the third partition (slice) of the first SCSI disk under the CAM/ada naming scheme?

  1. /dev/da0s3
  2. /dev/ada0p3
  3. /dev/ad0s3
  4. /dev/ada0s3 Correct answer.

Explanation

FreeBSD uses the suffix s for MBR slices and p for GPT partitions, so the third MBR slice of the first ada disk is ada0s3. The ada driver handles ATA/SATA disks, while da covers SCSI/SAS/USB storage.

Question 34Storage Devices and BSD Filesystems

Which BSD command displays the partition table of a disk, including GPT entries, without modifying anything?

  1. tunefs ada0
  2. gpart show ada0 Correct answer.
  3. fsck ada0
  4. newfs ada0

Explanation

gpart show prints the current partition scheme and all partitions on the named disk. newfs creates a filesystem, tunefs alters filesystem parameters, and fsck checks filesystem consistency, so none of those merely display the table.

Question 35Storage Devices and BSD Filesystems

You want to create a UFS2 filesystem on /dev/ada0p2 with soft updates enabled. Which command accomplishes this?

  1. newfs -j /dev/ada0p2
  2. newfs -l /dev/ada0p2
  3. newfs -U /dev/ada0p2 Correct answer.
  4. newfs -O 1 /dev/ada0p2

Explanation

The -U flag to newfs enables soft updates on the new filesystem. Soft updates maintain metadata ordering to keep the filesystem consistent without a full journal.

Question 36Storage Devices and BSD Filesystems

Which file in FreeBSD defines the filesystems mounted at boot time?

  1. /etc/mtab
  2. /etc/mount.conf
  3. /etc/fstab Correct answer.
  4. /etc/vfstab

Explanation

FreeBSD reads /etc/fstab during boot to determine which filesystems to mount and where. Each line lists device, mount point, filesystem type, options, dump and pass fields.

Question 37Storage Devices and BSD Filesystems

What does the fifth field of an /etc/fstab entry control on FreeBSD?

  1. The filesystem type
  2. The dump backup flag used by dump(8) Correct answer.
  3. The mount options string
  4. The fsck pass number

Explanation

The fifth field is the dump flag; a value of 1 tells dump(8) that the filesystem needs backing up. The sixth field is the fsck pass number, which is distinct.

Question 38Storage Devices and BSD Filesystems

Which command mounts all filesystems listed in /etc/fstab that are not marked noauto?

  1. mount -f
  2. mount -t all
  3. mount -a Correct answer.
  4. mount -u

Explanation

mount -a reads /etc/fstab and mounts every entry not flagged noauto. This is typically run during the boot sequence.

Question 39Storage Devices and BSD Filesystems

A disk reports a GPT with a protective MBR and you need to add a new partition. Which command creates a new GPT partition entry?

  1. gpart create -s gpt ada0
  2. gpart recover ada0
  3. gpart destroy -F ada0
  4. gpart add -t freebsd-ufs -s 20G ada0 Correct answer.

Explanation

gpart add inserts a new partition entry into an existing scheme, with -t setting the type and -s the size. The scheme must already exist on the disk before adding partitions.

Question 40Storage Devices and BSD Filesystems

Which ZFS command creates a new pool named tank using two disks mirrored?

  1. zpool create tank mirror ada1 ada2 Correct answer.
  2. zfs create tank mirror ada1 ada2
  3. zpool add tank mirror ada1 ada2
  4. zfs pool create tank mirror ada1 ada2

Explanation

zpool create builds a new storage pool, and the mirror keyword forms a two-way mirror from the listed devices. zfs create operates on datasets within an existing pool, not on pools themselves.

Question 41Storage Devices and BSD Filesystems

You want a ZFS dataset to store its data compressed with LZ4. Which command sets this on an existing dataset named tank/data?

  1. zpool set compression=lz4 tank/data
  2. zfs set compression=lz4 tank/data Correct answer.
  3. zfs create compression=lz4 tank/data
  4. tunefs -l lz4 tank/data

Explanation

zfs set assigns a property such as compression to a dataset. The value lz4 selects the LZ4 algorithm, which is the recommended default on modern OpenZFS.

Question 42Storage Devices and BSD Filesystems

Which ZFS feature protects against silent data corruption by storing and verifying checksums for every block?

  1. Soft updates
  2. GEOM striping
  3. End-to-end block checksums Correct answer.
  4. Journaled soft updates

Explanation

ZFS computes a checksum for every block and verifies it on read, detecting and, with redundancy, repairing corruption. This end-to-end checksumming is a core ZFS integrity feature.

Question 43Storage Devices and BSD Filesystems

What does the ZFS pool property autoexpand control?

  1. Whether datasets are automatically mounted at boot
  2. Whether a pool grows automatically when its underlying vdevs grow Correct answer.
  3. Whether compression is enabled by default
  4. Whether snapshots are created automatically

Explanation

autoexpand, when set to on, allows a pool to use additional capacity exposed by a grown underlying device, such as an enlarged virtual disk. It does not affect mounting or snapshots.

Question 44Storage Devices and BSD Filesystems

Which command shows detailed space usage of a ZFS pool and its datasets, including snapshot space?

  1. zpool iostat
  2. zfs get all
  3. zpool status -v
  4. zfs list -o space Correct answer.

Explanation

zfs list -o space displays used, available, referenced and snapshot-related space columns for datasets. It is the standard way to inspect where pool space is consumed.

Question 45Storage Devices and BSD Filesystems

How do you create a snapshot of the ZFS dataset tank/home named before_upgrade?

  1. zfs clone tank/home@before_upgrade
  2. zfs snapshot tank/home@before_upgrade Correct answer.
  3. zfs create tank/home@before_upgrade
  4. zpool snapshot tank/home before_upgrade

Explanation

Snapshots are named with the dataset followed by @ and the snapshot name, and are created with zfs snapshot. They are read-only point-in-time views.

Question 46Storage Devices and BSD Filesystems

Which GEOM class provides software RAID 1 mirroring on FreeBSD?

  1. gmirror Correct answer.
  2. gstripe
  3. gconcat
  4. geli

Explanation

gmirror is the GEOM class that implements RAID 1 mirroring across multiple providers. gstripe handles striping and gconcat handles concatenation.

Question 47Storage Devices and BSD Filesystems

What is the primary purpose of the geli GEOM class?

  1. Providing filesystem journaling
  2. Providing network block storage
  3. Providing block-level disk encryption Correct answer.
  4. Providing RAID 5 parity

Explanation

geli attaches to a provider and transparently encrypts its contents using the kernel crypto framework. It can also authenticate data and support key files or passphrases.

Question 48Storage Devices and BSD Filesystems

After creating a gmirror named gm0 from ada1 and ada2, which command shows the mirror's synchronization status?

  1. gmirror status gm0 Correct answer.
  2. zpool status gm0
  3. gmirror list ada1
  4. geom label status

Explanation

gmirror status reports each mirror component and whether it is active or being synchronized. This confirms the mirror is healthy after creation.

Question 49Storage Devices and BSD Filesystems

Which command grows a UFS filesystem after the underlying partition has been enlarged, without losing data?

  1. growfs /dev/ada0p2 Correct answer.
  2. newfs /dev/ada0p2
  3. fsck -f /dev/ada0p2
  4. dump -0 -f - /dev/ada0p2

Explanation

growfs expands an existing UFS filesystem to fill the enlarged partition while preserving its contents. It must be run on an unmounted or read-only filesystem.

Question 50Storage Devices and BSD Filesystems

What is the purpose of the fsck pass number in the sixth field of /etc/fstab?

  1. It defines the mount priority relative to other disks
  2. It controls the block size of the filesystem
  3. It sets the number of backup copies of the superblock
  4. It determines the order in which filesystems are checked at boot Correct answer.

Explanation

During boot, fsck checks filesystems in ascending pass order, with the root filesystem typically checked first. A value of 0 means the filesystem is skipped during the boot check.