what command to restore if the boot block is corrupted in
linux



what command to restore if the boot block is corrupted in linux..

Answer / mohammed sajjad

Scenario 1: Backup the boot sector (or MBR)
If the first harddisk in the system is /dev/sda, to backup the boot sector the following command can be used:

# dd if=/dev/sda of=bsbackup.bin bs=512 count=1

Essentially this command will read the first 512 bytes of /dev/sda and write it to the file bsbackup.bin.
Scenario 2: Restore the boot sector from a file:

# dd if=bsbackup.bin of=/dev/sda bs=512 count=1

This will restore the boot sector to /dev/sda that was backed up in Scenario 1.
Scenario 3: Zero out the boot sector (leaving the partition table intact)
Sometimes a virus or other issue can leave a corrupted executable code section in the MBR. I have personally seen a boot sector that would not store grub information (and thus boot linux after its installed) properly until the first 446 bytes were zeroed out and grub re-installed. The following command will do just that:

# dd if=/dev/zero of=/dev/sda bs=446 count=1

Scenario 4: Zero out the entire MBR (this will erase the partition table as well – effectively destroying the ability to easily access data on the drive)
A variation of the last dd command will wipe out the master boot record entirely. You will have to repartition and reformat your hard disk after this:

Is This Answer Correct ?    1 Yes 3 No

Post New Answer

More Networking Administration Interview Questions

Which command causes in.named to take a snapshot of its in-memory cached data.

1 Answers  


What is the difference between 802.2 and 802.3 frames ? a. 802.3 = 802.2 + LLC Header Info b. 802.2 = 802.3 + LLC Header Info c. 802.2 = 802.3 + Length field c. 802.3 = 802.2 + Length field

1 Answers  


Do you know what is the maximum segment length of a 100base-fx network?

0 Answers  


What determines what the network address is of the network a Solaris machine belongs to ?

1 Answers  


What is called as a series of bits with a well-defined beginning and ending.

1 Answers  






Which command allows you to monitor the routing requests that are not getting resolved from the routing table ?

1 Answers  


all your interview question in networking and system administration

0 Answers   Wipro,


what is domain

17 Answers   IBM, Syscom,


I am using windows server 2008 and its working as DHCP server. 100 clients are connected to this server. All clients are accessing Internet. But I wanna to block some specific websites which is not required by client. So how it can be done through DHCP server? is there any third party software available ? or any other method you know then please answer it.

1 Answers  


User Datagram Protocol (UDP) is __ and __ a. connectionless, stateless b. connection-orineted, stateless c. connection-oriented, stateful d. connectionless, stateful

0 Answers  


is it cpu is hardware

11 Answers   BBM, TNPSC Tamil Nadu Public Service Commission,


what are the advantages and disadvantages of Vlan?

1 Answers   Google, HP, Pepsi,


Categories
  • Networking Protocols Interview Questions Networking Protocols (671)
  • Networking Administration Interview Questions Networking Administration (1008)
  • Networking Security Interview Questions Networking Security (196)
  • Networking General Interview Questions Networking General (266)
  • Networking AllOther Interview Questions Networking AllOther (430)