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.