Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the maximum length allowed for a utp cable?

1091


Can we run STP and RSTP in a same box?

3224


one server is down it doen't display anything what you do?

1884


Tell me about your job profile.

4196


Have you worked in an assignment based environment, e.g. work request or trouble ticket system, and if so, describe that environment?

2732


How do you manage multiple concurrent high level projects?

2397


Define tracert?

1035


VLAN tagging/un-tagging process –where and when it happens?

2111


if one server is down, whenever restart the machine we get ok prompt what is the problem?

1805


Explain the role of ieee in computer networking?

1019


Explain 802.1Q header?.

2041


Tell me what advantages does fiber optics have over other media?

959


Tell me what is the equivalent layer or layers of the tcp/ip application layer in terms of osi reference model?

918


hi this is raj igot job in tcs and also i got visa from u.s in this time i dont know what to do can u sugges me pls........

1803


List the functions of a network administrator?

993