Removing RAID metadata

Sometimes a hardware RAID controller or fakeraid (BIOS) can leave metadata that makes it impossible to install Windows or Linux, or it installs correctly, but causes a kernel panic or a 0xb7 blue screen error on the first boot. The only method I could find to delete the metadata *quickly* 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. This command executes in less than a second.

15 Responses to Removing RAID metadata

  1. Mark says:

    I just want to say thank you. I had an EXT4 HD that I previously stored my old OS on before switching to manjaro/arch. I though I had incorrectly set up automounting, but then I figured out that the disk used to be used in RAID. Nothing else worked, but this command successfully cleared the RAID data, restoring the drive to a state where I could extract the files.

  2. Wow. I had been fighting this problem for about 6 hours when I found your blog. Thanks! Your instructions fixed it straight away!… Great post!

  3. Neal Ginsberg says:

    It should be noted that you are not actually wiping out all of LSI’s metadata. You are wiping out the areas that Linux and Windows are looking to access. So some of LSI’s metadata is still there and could be accessible via an LSI RAID card.

    1. Randy says:

      Removing the 1st 512 bytes (MBR/partition table) is usually enough for LSI to see drives as ‘unconfigured’.

  4. Blaine says:

    Thanks! This was one of the few resources I found after searching for quite some time on how to clear out stubborn raid meta data. Some sources say it’s at the front of the disk, others say at the end but they just give you an arbitrary seek value. This solution is perfect because it uses your actual drive size offset for the seek value.

    Thanks!

    1. Randy says:

      You’re welcome!

  5. Tim Wu says:

    Thanks!
    I boot with Linux Live CD and execute your command to get rid of metadata warning.

  6. Colin MacKenzie says:

    Yup! Ya fixed my wagon. Thanks!

  7. Robert says:

    I wanted to say Thank you too. You just saved me! I also just posted a link back to your post on my blog. I really appreciate your help!

    http://www.mytechdocs.com/removing-raid-me…sks-when-reusing/

  8. Drag says:

    Thank you. I’ ve just fixes the problem with an ssd and I’ ve installed linux whitout any problem.

  9. user33 says:

    How about this serverfault.com/a/845076/176452 and mdadm –zero-superblock ?

    1. Jonathon says:

      I think this would only apply to a Linux “md” software RAID, not an actual hardware RAID controller.

  10. TechGuyDK says:

    Thanks a lot! – I had 4 discs which has previously been installed in a Dell PowerEdge server with a Perc 5i controller, and needed to move them to another server without Raid-controller and configure them for Linux softraid. I spent hours, trying to get the discs to show up, but your trick did it!
    Tanks again for this great tip.

  11. Zoldaar says:

    Thank Sir – worked a treat !

  12. Efg says:

    I just say thank you, you saved my day