Remove RAID Metadata

Recently, I faced an issue on one of my servers which had hardware RAID card installed. The hardware RAID was preventing the disks to be shown during the OS re-installation screen. On simple troubleshoot (ofcourse with the help of StackOverflow), I figured out that sometimes hardware RAID controller or fakeraid (BIOS) can leave metadata that makes it impossible to install Windows or Linux, or it may install correctly, but cause a kernel panic or a 0xb7 blue screen error on the first boot itself thus rendering every other sysadmin in a dilemma.

The only method I could find to delete the metadata is to zero out the last 512KB of data on the disk using the following command:

dd if=/dev/zero of=$YOUR_DEV bs=512 seek=$(( $(blockdev --getsz $YOUR_DEV) - 1024 )) count =1024

Replace $YOUR_DEV with the physical device, such as /dev/sda

You could just zero the whole disk, but that could take hours. Thus this command executes in less than a second and works, not to forget its a life saver too!

About the Author: vpsadmin

%d bloggers like this: