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 |
Why am I getting this error messege when I'm trying to Sincronize user accounts....ERROR MESSEGE- Invalid Target
Which of the follwoing are Layer2 protocols ? Choose all that apply. a. HDLC b. IP c. UDP d. SLIP e. PPP
What routing problems have you troubleshot?
Do you know what is the maximum segment length of a 100base-fx network?
10 computer connect with switch sometimes they connect sometimes they disconnect what can be problem ?please
What IP network addresses are set aside for class C (for private use) ? a. 172.16.0.0 (mask 255.240.0.0) b. 172.16.0.0 (mask 255.255.0.0) c. 196.168.0.0 (mask 255.255.0.0) d. 192.168.0.0 (mask 255.255.0.0) e. 198.168.0.0 (mask 255.255.255.0)
what is ppl
Which file associates network name with number ?
What would you use to make a 100mb network ? budget is low.
You mail server belongs to mydomain.com . An email destined for user@host4.mydomain.com . This type of email address is ?
What IP network addresses are set aside for class A (for private use)? a. 1.0.0.0 (mask 255.0.0.0) b. 10.0.0.0 (mask 255.0.0.0) c. 10.0.0.0 (mask 255.255.0.0) d. 100.0.0.0 (mask 255.0.0.0) e. 100.0.0.0 (mask 255.255.0.0)
Your HOSTS file looks like this: 11.12.13 UNIX programmer # Programmers FTP server 11.12.14 server 11.12.15 UNIX developer #Developers FTP server 11.12.20 developer # developer you try to ftp developer, you can connect to the right server. But you try ftp 10.11.12.20, you fail to connect. Why?