Install GRUB 2 for BIOS boot on /dev/sda.
Target the entire disk, not an individual partition.
Which basic command is appropriate?
For BIOS installation, the basic grub-install form names the whole boot disk. Verify boot mode and target carefully because the operation can overwrite boot code.
Detailed explanation
grub-mkconfig /dev/sdaIncorrect. grub-mkconfig generates configuration and does not install boot code to a disk.
Incorrect. grub-mkconfig generates configuration and does not install boot code to a disk.
grub-install /dev/sda1Incorrect. /dev/sda1 is a partition; this scenario targets the whole disk.
Incorrect. /dev/sda1 is a partition; this scenario targets the whole disk.
grub-editenv /dev/sdaIncorrect. grub-editenv edits environment variables rather than installing boot code.
Incorrect. grub-editenv edits environment variables rather than installing boot code.
grub-install /dev/sdaCorrect. grub-install /dev/sda targets the whole BIOS boot disk.
Correct. grub-install /dev/sda targets the whole BIOS boot disk.
Try it yourself
An example you can run in a temporary verification environment.
grub-install --help 2>&1 | head || echo 'grub-install is not installed'Expected result
grub-installの使用法、または未導入の表示。実インストールは行わないKey points
- BIOS targets the whole disk
- Do not confuse disk and partition
- The operation can be destructive
Notes
- Environment: GRUB 2 / BIOS方式
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Read the scope first
Check whether the command acts on the current shell, a new process, an existing process, or a file.
Verify the observable result
Use the supplied command and compare the output with the expected result.