Lpic 2 Linux Engineer · Free Practice Question Medium
Question 3
- A grub-install --efi-directory=/boot/efi
- B efibootmgr --create --disk /dev/sda --part 1 --loader \EFI\ubuntu\grubx64.efi --label 'Ubuntu' --bootnum 1
- C mount /dev/sda1 /mnt && chroot /mnt
- D systemctl enable grub
Reveal correct answer
Correct answer: B
A. The 'grub-install' command is used to install GRUB bootloader on a system, but it does not add a new EFI boot entry. It is not the correct command to manually add a new EFI boot entry in this scenario.
B. The 'efibootmgr' command is used to manipulate the EFI boot manager. In this case, the command creates a new EFI boot entry for Ubuntu on disk /dev/sda, partition 1, with the specified loader path and label. This command is the correct choice for manually adding a new EFI boot entry.
C. The 'mount' and 'chroot' commands are used to change the root directory to another location, typically for system maintenance tasks. While these commands are useful in certain scenarios, they are not relevant for manually adding a new EFI boot entry.
D. The 'systemctl enable grub' command is used to enable a service to start at boot time in systemd-based Linux distributions. It is not the correct command for manually adding a new EFI boot entry in a UEFI firmware environment.
Discussion
Think the marked answer is wrong, or have a better explanation? Share it below — comments appear after review.
