LPI BSD Specialist study materials
LPI BSD Specialist study resources

LPI BSD Specialist: Storage Devices and BSD Filesystems

LPI BSD Specialist · Work through your exam, one topic at a time.

All guide sections

Storage Devices and BSD Filesystems

Storage Devices and BSD Filesystems covers disks, partitioning schemes, the filesystems the BSDs create on them, and the configuration that mounts those filesystems at boot. Expect questions mixing device naming, labels and fstab syntax.

Naming and partitioning

FreeBSD names disks by driver: ada0 for SATA, da0 for SCSI/USB, nvd0 for NVMe. MBR slices are s1, s2; GPT partitions are p1, p2. gpart manages GPT: gpart create -s gpt ada1, then gpart add -t freebsd-ufs -l data ada1, which yields the stable device /dev/gpt/data. OpenBSD and NetBSD use disklabel, where letters a (root), b (swap), c (whole raw disk) and d onward are partitions; c must never be newfs'd.

Filesystems and fstab

FreeBSD defaults to UFS2; newfs -U enables soft updates and tunefs -j enable adds journaling once soft updates are on. ZFS is managed with zpool create tank ada2 and zfs create tank/data, inspected with zpool status and cleaned with zpool scrub. The /etc/fstab fields are device, mountpoint, fstype, options, dump and pass, where pass is 1 for root, 2 for other checked filesystems and 0 for swap or anything not fsck'd at boot.

Worked example

Make a second disk usable: gpart create -s gpt ada1; gpart add -t freebsd-ufs -l data ada1; newfs -U /dev/gpt/data; mkdir -p /data; mount /dev/gpt/data /data; then add /dev/gpt/data /data ufs rw 2 2 to /etc/fstab. Reasoning: the label removes dependence on the raw ada1p1 name, newfs must create the filesystem before mount can succeed, and pass 2 schedules a background fsck rather than the root pass.

Traps

newfs destroys existing data, so confirm the target device. Mounting over a non-empty directory hides its contents. A wrong fstype or missing pass field can drop boot into single-user mode. ZFS pools are not fsck'd via fstab; they mount from the pool cache and appear in zfs list.