Q & A: Linux: Switch Users, Boot Process, File System

Quiz: Root Access, Boot Process, File Systems, Partitions, and Mounting

1. True/False

The root user is the superuser account and has the highest access rights on a Linux system.

Answer: True


2. True/False

It is recommended to stay logged in as root for normal daily work because it is faster.

Answer: False
Explanation: Staying logged in as root is risky because mistakes may affect the entire system.


3. Multiple Choice

Which command is preferred when you need to run one privileged command?

A. su -
B. sudo command
C. exit
D. whoami

Answer: B. sudo command


4. Multiple Choice

What does the command below do?

su -

A. Runs one command as root
B. Opens a login shell as root
C. Shows the current user
D. Lists mounted filesystems

Answer: B. Opens a login shell as root


5. Multiple Choice

Which process is usually started by the kernel as the first userspace process?

A. GRUB
B. BIOS
C. systemd or init
D. fdisk

Answer: C. systemd or init


6. Multiple Choice

Which systemd target usually represents a non-graphical multi-user system?

A. poweroff.target
B. rescue.target
C. multi-user.target
D. graphical.target

Answer: C. multi-user.target


7. Multi-Select

Which of the following are risks of using the root account directly?

Select all that apply.

A. Accidental system-wide file changes
B. Running ordinary tasks with unnecessary privileges
C. Forgetting that you are logged in as root
D. More accountability than sudo
E. Background processes may run with root privilege

Answers: A, B, C, E


8. Multi-Select

Which commands are commonly part of the basic partition, format, mount, and verify workflow?

Select all that apply.

A. lsblk
B. fdisk
C. mkfs
D. mount
E. df -h
F. passwd

Answers: A, B, C, D, E


9. Multi-Select

Which statements about filesystems are correct?

Select all that apply.

A. A filesystem organizes data and metadata on storage
B. Journaling can reduce recovery time after an unclean shutdown
C. ext4 is commonly used on many Linux distributions
D. FAT is a modern Linux-native journaling filesystem
E. NTFS is associated with Microsoft Windows

Answers: A, B, C, E


10. Fill in the Blank with Choices

A filesystem defines how __________ and metadata are organized and accessed on a storage device.

A. users
B. data
C. passwords
D. targets

Answer: B. data


11. Fill in the Blank with Choices

The Linux filesystem table is stored in the file __________.

A. /etc/passwd
B. /etc/fstab
C. /boot/grub
D. /var/log

Answer: B. /etc/fstab


12. Fill in the Blank with Choices

On modern systems, __________ is normally preferred over MBR for large disks unless compatibility requires MBR.

A. FAT
B. GPT
C. ext2
D. BIOS

Answer: B. GPT


13. Matching

Match each FHS directory with its purpose.

DirectoryPurpose
1. /etcA. User home directories
2. /varB. Device files
3. /homeC. System-wide configuration files
4. /devD. Logs and changing data
5. /bootE. Boot loader files and kernels

Answer:

DirectoryCorrect Purpose
/etcC
/varD
/homeA
/devB
/bootE

14. Matching

Match each command with its purpose.

CommandPurpose
1. lsblkA. Format a partition with a filesystem
2. fdiskB. Show block devices
3. mkfsC. Modify partition tables
4. mountD. Attach a filesystem to the Linux directory tree
5. umountE. Detach a mounted filesystem

Answer:

CommandCorrect Purpose
lsblkB
fdiskC
mkfsA
mountD
umountE

15. Ordering

Put the boot stages in the correct order.

A. Kernel starts init/systemd
B. BIOS/UEFI starts
C. GRUB loads the selected kernel
D. System reaches target/services
E. MBR or boot loader code begins the boot manager stage

Correct Order:

  1. B
  2. E
  3. C
  4. A
  5. D

16. Ordering

Put the storage setup steps in the correct order.

A. Format the partition with mkfs
B. Identify the disk with lsblk
C. Mount the filesystem
D. Create a partition using fdisk
E. Verify using df -h

Correct Order:

  1. B
  2. D
  3. A
  4. C
  5. E

17. Short Answer

Explain the difference between sudo and su -.

Sample Answer:
sudo runs a single command with elevated privileges and logs the action. su - opens a new login shell as another user, usually root if no username is provided. sudo is safer for one administrative task, while su - is used when a full shell as another user is needed.


18. Hands-on Short Answer

Write commands to format /dev/sdb1 as ext4, create /mnt/test, mount the partition, and verify it.

Sample Answer:

sudo mkfs -t ext4 /dev/sdb1
sudo mkdir -p /mnt/test
sudo mount -t ext4 /dev/sdb1 /mnt/test
df -h

19. Analytical Short Answer

Why is /dev/sdb commonly used with fdisk, but /dev/sdb1 is commonly used with mkfs?

Sample Answer:
/dev/sdb represents the whole disk, so fdisk uses it to create or modify the disk’s partition table. /dev/sdb1 represents a specific partition, so mkfs formats that partition with a filesystem.


20. Higher-Order Short Answer

A server should automatically mount a new ext4 partition after every reboot. Which file should be configured, and what information does it need?

Sample Answer:
The file /etc/fstab should be configured. It needs the filesystem or UUID, mount point, filesystem type, mount options, dump value, and filesystem check pass value. Example pattern:

UUID=... /mnt/data ext4 defaults 0 2

This allows the system to mount the filesystem automatically during boot.

REF: AI Tools/ChatGPT

Leave a Reply