Clearing RAID metadata

Clearing RAID metadata


Disks that were previously in use by a RAID controller will often contain metadata that identifies them as being part of a RAID. The default behavior for the CentOS/RHEL Anaconda installer is to flag and ignore these types of disks in case they belong to an existing RAID set, so any automated installs will subsequently fail.

To work around this, you will need to clear the RAID metadata manually by wiping the beginning and the end of the disk, using dd and blockdev. Note that not all distributions come with blockdev installed by default, so you may need to install it separately.

1. First, identify your disk label using the following command:

  • fdisk -l | less

Use the arrow keys to navigate through the list and locate the drive in question. Make note of its /dev/sd* name. In this example we’ll assume that the disk is /dev/sdb.

2. Next, write some zeroes to the beginning of the disk with the following command:

  • dd if=/dev/zero of=/dev/sdb bs=512 count=1024

3. Finally, write some zeroes to the end of the disk. This uses blockdev to read the total amount of sectors from the disk, then we subtract 1024 sectors and, using the seek option, start the dd at 1024 sectors from the end of the disk, writing zeroes to those last 1024.

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

If for some reason the command fails, you can manually write in the seek value instead.

    • Related Articles

    • How to Create and Boot from a LiveCD/USB Drive

      STAGE 1: Download .ISO image, prepare USB flash drive First, you will need an .ISO image of a Linux OS that you will put onto a USB drive (4GB+ recommended). As far as .ISO images go, you can use one from any OS that you wish. We strongly suggest ...
    • HDD models and serials

      Q: I have a failed hard drive, but I do not know the model and serial. How do I obtain this information? A: If the the component is still visible to your operating system and hard drive controller, you can utilize a number of graphical and command ...
    • Create a Bootable Linux USB Flash Drive Using dd

      Insert your USB drive into your computer and use ‘df’ or ‘lsblk’ from the command line to determine the device name your flash drive has been assigned, e.g. /dev/sdb, sdc, etc. Make sure the drive is not mounted. If necessary, unmount it with: sudo ...
    • Install Windows Server 2008/2012 over an Existing RAID Array

      How to install Windows Server on an existing RAID array greater than 2TB in size Why is this a problem? When installing Windows on UEFI-based PC's with RAID arrays you must partition your hard drives using GPT. Traditional MBR-type drives are limited ...
    • Failed HDD Replacement Instructions

      From Nexenta Management Console (NMC) check the status of your pools $ zpool status Find the faulted HDD and record the worldwide number (WWN) of the HDD, and the name of the pool it resides in. You will use the WWN to identify this HDD later An ...