Partitions and mounting
Disk, MBR or GPT partition table, partition, file system, formatting, mount point, mount, umount, fstab, lsblk, df, and names like /dev/sda1 or /dev/nvme0n1p2.
- 26 cards
- 4 topics
- Free
The outline, topic by topic
Each topic is weighted the way the exam weighs it.
- Concepts
- Questions
- Sort and link
- Scenarios
A few cards from the deck
Partition: what is it?
Show the answer
A contiguous slice of a disk that the system treats as a disk of its own, with its own file system.
That separates the system, personal data and swap space. On Linux, partition 1 of the first SATA disk is
/dev/sda1./mnt/usbalready containsnotes.txt. You runmount /dev/sdb1 /mnt/usb, thenls /mnt/usb. What do you see?- The stick's content:
notes.txtis hidden, and comes back afterumount - The stick's content and
notes.txt, merged in the same directory - Only
notes.txt: mounting never replaces the content of a non-empty directory - Only the stick's content:
notes.txtis permanently erased from the disk
Show the answer
The stick's content:
notes.txtis hidden, and comes back afterumountThe mounted file system takes the place of what the directory showed. The old files have not moved, they are only hidden. That is why you mount on an empty directory.
- The stick's content:
The second SATA disk is called /dev/sdb and its third partition …; on an NVMe disk, the second partition of the first disk is called ….
Show the answer
The second SATA disk is called /dev/sdb and its third partition /dev/sdb3; on an NVMe disk, the second partition of the first disk is called /dev/nvme0n1p2.
An NVMe disk's name ends in a digit, so a
pseparates the disk from the partition number:/dev/nvme0n1is the whole disk.Partition table: what is it?
Show the answer
The area of a disk that lists the partitions with their start and size; the two common formats are MBR and GPT.
MBR is the old format, with four primary partitions and disks limited to 2 TiB. GPT lifts those limits and goes with UEFI boot.
umount /mnt/usbanswers “umount: /mnt/usb: target is busy”. What is the likely cause?- The stick is read-only, which blocks unmounting it:
umount -rfrees it - The mount point is not declared in
/etc/fstab, so the system refuses to unmount it - The partition has no valid file system, so the kernel cannot release it
- A process is using the mount, for instance a terminal sitting in it:
lsof /mnt/usbshows it
Show the answer
A process is using the mount, for instance a terminal sitting in it:
lsof /mnt/usbshows itUnmounting fails as long as a file on the mount is open, or a process has its current directory there. You leave with
cd, close the programs, then runumountagain.- The stick is read-only, which blocks unmounting it: