2

I used to have a RAID 0 setup but I ditched it and restarted from scratch with a plain non raid single disk system. The second disk is just used for general storage.

Well today, I boot the machine and for whatever reason the BIOS booted from the secondary drive which still had the old RAID 0 boot record and OS and everything. Took me a few minutes to figure out what went wrong, I changed the boot order in my BIOS and my 'new' machine came back.

How do I blow away the bootability of the old secondary drive without destroying any of the partitions on it? The MBR has the partition table so I can't just blow it away, but I can't find any partition tool that will erase the MBR while keeping the partition table.

This is a ubuntu 10.10 setup.

Stu
  • 2,118
  • 2
  • 15
  • 21

2 Answers2

5

The actual MBR boot loader is located on the first sector of the hard drive. This sector also contains the partition table for the drive, so care must be taken to remove the boot loader code without removing the partition table. The following command should do it:

dd if=/dev/null of= bs=446 count=1

Slightly more information is at this URL WARNING: Before making this modification, have good backups available.

SteveM
  • 899
  • 4
  • 6
1

Just use fdisk (or any other partitioning tool) to set the partition as "inactive".

EEAA
  • 108,414
  • 18
  • 172
  • 242
  • 1
    This won't help if a bootloader was installed into the MBR directly (very common with various Linux bootloaders) — in this case the code in MBR won't even look at the active flag. (However, there are some BIOSes which parse the DOS partition table and refuse to boot from a disk without any active partitions — this sometimes causes an inverse problem with some Linux distros which forget to make sure there is an active partition after installing a bootloader into MBR.) – Sergey Vlasov Dec 15 '10 at 21:10