Vigilante said:
NTFS doesn't use an MBR anyway, it uses MFT.
The file system has nothing to do whatsoever with the MBR. The MBR (
"Master Boot Record") sits on the very first sector (512 bytes) of your boot disk, and gets loaded
well before the computer has even looked at any file system. In fact, the computer
must look at the MBR to find out what partitions there are on the disk, since the MBR includes the partition table; and only
after it finds out what partitions there are on the disk, can it begin to look at the file systems that they hold.
The actual function of the MBR, then (apart from keeping the partition table), is to execute a small (
very small) piece of code that will decide which partition will be booted; the MBR code that gets installed by Windows, e.g., will simply boot the
"active" disk partition (which is flagged in the partition table).
A friend of mine once had an MBR virus, too. He tried to get rid of it by deleting all partitions with
FDISK, but that didn't work. (We subsequently found out that
FDISK simply won't touch the MBR sector code.) We found only one way to remove the virus: Boot a Linux Live CD, and use the
"dd" command to destroy the MBR (including the partition table)--
"dd" is the
"dump data" command in Linux, but when used in this way, it is often referred to as
"destroy disk," since you effectively lose all data from the disk.
In case you want to give it a try, the command is something like the following:
Code:
dd if=/dev/zero of=/dev/hda bs=512 count=2048
(where
"count" is the number of sectors to zap; you could specify a count of 1, but an MBR virus will likely carry its payload in the next few sectors immediately following the MBR, so it's probably a good idea to zap a few more).
Also, after this operation, the partition table will be invalid; you may want to rewrite a valid (albeit empty) partition before continuing, using something like the following command:
You will be told that the partition table is corrupted; just use the
"w" command to correct it, then quit the fdisk command using the
"q" command.
After this, your disk will look like an new, empty disk to the computer.