Planning a disk layout
Deciding what goes on which partition before you install: which directories are worth separating, why /boot and swap are special, and what LVM buys you over a fixed partition table.
Lesson 1 of 6 in objective 102. Linux installation and package management, part of LPIC-1 Exam 101-500.
What is worth its own partition, and why
The reason to separate a directory is almost always that something can fill it. /var holds logs, mail spools and package caches, and a runaway log on a single-partition system fills the root filesystem and stops the machine. /home holds user data, and separating it means a reinstall can keep it. /tmp is world-writable, so a separate /tmp bounds what any user can consume and lets it be mounted with noexec and nosuid.
/boot is separated for a different reason: something has to be readable before the machine is fully up. If the root filesystem is encrypted or sits on an exotic volume manager, the kernel and initramfs have to live somewhere the boot loader can read unaided. On UEFI systems there is also an EFI system partition, formatted FAT and usually mounted at /boot/efi, which the firmware itself reads.
Swap is not a directory but a partition or file the kernel uses to page memory out. The old rule of twice RAM is long obsolete; what matters for the exam is that swap exists, that it is type 82 on an MBR table, that mkswap prepares it and swapon activates it, and that hibernation needs swap at least the size of RAM.
LVM, and mount points as a layer of indirection
A classic partition table pins sizes at install time and resizing them later means moving data. LVM adds a layer: physical volumes (the partitions or disks) are grouped into a volume group, and logical volumes are carved out of that group and can be grown, shrunk or moved while the system runs. The filesystem sits on the logical volume, so /home can borrow space from the volume group next year without repartitioning.
The three layers have three sets of commands named after them, and the exam asks for them by name rather than by description. pvcreate initialises a partition or a whole disk as a physical volume; vgcreate pools one or more physical volumes into a named volume group; lvcreate carves a logical volume out of that group, and only the logical volume ever receives a filesystem and a mount point. Growing follows the same naming one word further on — vgextend adds another physical volume to an existing group, lvextend hands group space to a logical volume — and the filesystem on top is a separate step again, grown with resize2fs or xfs_growfs after the volume beneath it has moved. pvs, vgs and lvs report each layer.
Either way, the thing a user sees is a mount point — a directory in the single tree at which a filesystem is attached. Linux has no drive letters: a second disk is not "D:", it is whatever directory you mount it on, and the same filesystem mounted somewhere else is the same data at a different path.
Worth carrying in
- /boot
- Kernel and initramfs. Separate when root is encrypted or on LVM the loader cannot read.
- /var
- Logs, spools, caches — the directory that grows without asking.
- /home
- User data. Separating it survives a reinstall.
- swap
- Paged-out memory. Prepared with
mkswap, activated withswapon, listed in/proc/swaps. - EFI system partition
- FAT partition the firmware reads, normally mounted at
/boot/efi. - LVM
- Physical volumes → volume group → logical volumes, resizable after the fact.
- pvcreate / vgcreate / lvcreate
- Initialise a physical volume, pool volumes into a group, carve a logical volume out of it. In that order.
- vgextend / lvextend
- Add a physical volume to a group; give group space to a logical volume. The filesystem is grown separately.
What the exam does with this
- Be able to say what a given separation BUYS. Every question here is really "what goes wrong if this is one big partition".
- Hibernation needs swap of at least the size of RAM; ordinary paging does not.
- The LVM verbs are asked in order:
pvcreateprepares,vgcreatepools,lvcreatecarves. Only the logical volume gets a filesystem. - A mount point is a directory, and mounting over a non-empty directory hides its contents rather than merging them.
- Objective
- 102. Linux installation and package management
- Share of the exam
- 18.33% (the whole objective)
- Questions in this lesson
- 10
- Signed for by a person
- 0
Partly checked. None of the 10 questions here has been read against the cited source by a person. 10 questions have been checked against their cited clause by an automated pass — which is not the same thing, and is not a signature.
Only questions a person has signed for are used in mock exams here. That is the whole difference between the two kinds of checking above.
How these questions are written — where each question comes from, what the verification ledger records, and what happens when one is found wrong.
Drill this lesson
A lesson is one sitting: the trainer draws a short run from these questions alone and spaces the ones you get wrong.
Practise Planning a disk layout
Questions in this lesson
- A mail server keeps filling its root filesystem because spooled mail and logs grow without bound, and when the disk fills the whole system becomes unusable. Which single change to the disk layout most directly contains that failure? machine-checked
- In LVM terminology, which object is created directly on a partition or whole disk so that its storage can be added to a pool? machine-checked
- You are laying out storage for a general-purpose Linux server. Which TWO of the following are genuine reasons to use LVM for the data filesystems rather than plain partitions? machine-checked
- You are laying out the disk for a workstation that boots via UEFI. Which filesystem must be created on the EFI System Partition so that the firmware itself can read the boot loader from it? machine-checked
- A workstation will be reinstalled from scratch every couple of years, with the operating system filesystem reformatted each time, but the users' documents and per-user settings must survive untouched. Which directory most deserves a filesystem of its own? machine-checked
- A server has a GPT-partitioned disk but its firmware boots in legacy BIOS mode. grub-install refuses to embed its core image and warns that it has nowhere to put it. Which partition must the layout include? machine-checked
- Which TWO statements about swap space on a Linux system are correct? machine-checked
- Type the absolute path of the directory that the Filesystem Hierarchy Standard reserves for the static files of the boot loader, including the kernel image and initramfs on a typical distribution. machine-checked
- You have already prepared two physical volumes with pvcreate. Type the LVM command, with no options or arguments, that pools them into a volume group. machine-checked
- The directory /srv/data already holds 40 GB of files on the root filesystem. You add a new disk and mount it on /srv/data. What happens to the 40 GB that were there before? machine-checked
Practise Planning a disk layout