Exam LFCS All QuestionsBrowse all questions from this exam
Question 38

Which of the following commands overwrites the bootloader located on /dev/sda without overwriting the partition table or any data following it?

    Correct Answer: C

    When overwriting the bootloader located on /dev/sda without affecting the partition table or any subsequent data, the appropriate command needs to target only the specific bytes that constitute the bootloader. The Master Boot Record (MBR) consists of 512 bytes total: the first 440 bytes typically contain the bootloader, while the remaining bytes include the partition table and signature. Using the command 'dd if=/dev/zero of=/dev/sda bs=440 count=1' will overwrite only the first 440 bytes, effectively erasing the bootloader but preserving the partition table and other critical data. Commands that use 'bs=512' would overwrite the complete 512 bytes, affecting the partition table. Thus, the correct command is the one that uses 'bs=440' to ensure only the bootloader gets overwritten.

Discussion
ignou143Option: B

Right Answer is : dd if=/dev/zero of=/dev/sda bs=512 count=1

Funkslinger

Do we want to overwrite the bootloader or the whole MBR? Answer is C

BuruguduystunstugudunstuyOption: C

The command that overwrites the bootloader located on '/dev/sda' without overwriting the partition table or any data following it is 'dd if=/dev/zero of=/dev/sda bs=440 count=1'. The correct answer is Option C. The 'dd' command is a utility for copying data from one location to another. It can be used to overwrite data on a device, such as a hard drive or a bootloader. The 'if' option specifies the input file, and the 'of' option specifies the output file. The 'bs' option specifies the block size, and the 'count' option specifies the number of blocks to copy. In this case, the command will copy a single block of data ('count=1') from '/dev/zero' (a special file that provides an endless stream of zero bits) to '/dev/sda' using a block size of '440' bytes. This will overwrite the bootloader located on '/dev/sda' without overwriting the partition table or any data following it.

Buruguduystunstugudunstuy

The other options will overwrite more data on the device, potentially causing data loss or corruption. Option C will overwrite the first 440 bytes of the device, which is the correct block size to overwrite the bootloader without overwriting the partition table or any data following it. Option A will overwrite the entire device, including the partition table and all data. Option B will overwrite the first 512 bytes of the device, potentially causing data loss or corruption. Option D will overwrite the entire device, including the partition table and all data.

FlubuOption: C

For example in Windows, “the 4 bytes following the first 440 bytes contain the Windows Unique Disk Signature” -> https://unix.stackexchange.com/questions/254657/mbr-size-is-440-bytes-or-512-bytes#254662

Flubu

None, is correct. ... it is composed of 3 parts: the boot code (446 bytes long), the partition table (64 bytes long) and the boot code signature (2 bytes long) -> https://unix.stackexchange.com/questions/252509/using-dd-in-order-to-save-and-restore-a-boot-sector