Tag Archives: raid

MegaCli back failed disk

If your raid array is degraded, but you think your HDD is good, you can try back it again. You CAN NOT just change status of failed disk to online, because you server data will be almost lost.

/root/bin/MegaCli64 -pdmarkmissing -physdrv[4:0] -aAll
/root/bin/MegaCli64 -pdprprmv -physdrv[4:0] -a0
/root/bin/MegaCli64 -PDMakeGood -PhysDrv[4:0] -a0
/root/bin/MegaCli64 -PDRbld -Start -PhysDrv[4:0] -a0 or /root/bin/MegaCli64 -pdlocate -start -physdrv[4:0] -a0

Sometimes you need fix foreign configuration:
/root/bin/MegaCli64 -CfgForeign -Clear -aALL
/root/bin/MegaCli64 -PDHSP -Set -PhysDrv [4:0] -a0 or /root/bin/MegaCli64 -PDHSP -Rmv -PhysDrv [4:0] -aN

Make sure you have backups of very important data.

linux raid bitmap

A mdadm bitmap, also called a “write intent bitmap”, is a mechanism to speed up RAID rebuilds after an unclean shutdown or after removing and re-adding a disk.

With a bitmap, writing data to the RAID goes like this:

Update bitmap: Mark the RAID chunks you are about to write to as dirty.
Write the data to the RAID.
Update bitmap: Mark the RAID chunks that were just written as clean.
The advantage of a bitmap is that if the system goes down in the middle of a write, the rebuild needs to check only the chunks marked as dirty, rather than the whole multi-TB RAID. This can speed up the rebuild process from taking several hours to completing in just a few seconds.

The drawback is lower write performance under normal use (outside rebuilds), since mdadm does additional disk access to update the bitmap.

external: Stored as a file on a disk outside the RAID. The advantage over an internal bitmap is better write performance during normal use (outside rebuilds).
internal: Stored as RAID metadata. The advantage over an external bitmap is that you don’t need a non-RAID disk and you save a bit on configuration (the path to the bitmap).

mdadm –grow –bitmap=internal

–bitmap=internal: Create an internal bitmap.
–bitmap=/var/bitmap.bin: Create an external bitmap at the specified path. The path must reside outside the RAID. A bitmap=… parameter must be added to the ARRAY entry in /etc/mdadm/mdadm.conf, and the –bitmap=… parameter must be passed if you are assembling the RAID from the command line.
–bitmap=none: Remove/disable any bitmaps.