MegaRAID Patrol read
MegaRAID Patrol read periodically verifies all sectors(including system reserved area) of drives including hot spare connected to a controller. The goal is to protect data integrity by detecting drive failure before the failure can damage data. The corrective actions depend on the drive group configuration and the type of errors.
Patrol read starts only when the controller is idle for a defined period of time and no other background tasks are active, though it can continue to run during heavy I/O processes.
Note: A patrol read is initiated only when the controller is idle for a defined time period and has no other background activities, such as Background initialization, rebuilding, consistency check etc..
Read Patrol is an adaptive process that runs as a background operation on the MegaRAID controller. It is adaptive, so that during periods of high disk access by the host applications, read patrol activity is lessened, and thus does not interfere with the applications.
During periods of lesser disk accesses by host applications, the read patrol activity can be increased. The purpose is to make sure that all stripes of a logical drive are read within a reasonable period of time, thus trying to ensure that the user’s data is available when needed. This process causes the drives to read the data by issuing read-verify commands. By using the read-verify command, the data from the drives is not transferred to the MegaRAID adapter unless an error is detected and reported by one or more drives included in the stripe. If a single drive reports an error within the stripe, the read patrol function initiates read commands to all the other stripe unit drives and the data for this single failing stripe unit is recreated by the MegaRAID adapter from the remaining data and parity stripe units.
After recreating this data, the adapter then issues a write-verify command to the drive that reported the error on the read-verify command and writes this recreated portion of the stripe to that drive. After this write completes successfully, this is now a known good stripe, and read patrol can continue with the next stripe. In the event that two or more drives report errors during the read-verify portion of the read patrol, the failing stripe will be added to the Bad Stripe Table.
Просмотр состояния адаптера
1 |
# megacli -AdpAllInfo -aALL | less |
Просмотр состояния всех логических дисков в RAID
1 |
# megacli -LDInfo -Lall -Aall |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
Adapter 0 -- Virtual Drive Information: Virtual Drive: 0 (Target Id: 0) Name : RAID Level : Primary-5, Secondary-0, RAID Level Qualifier-3 Size : 5.457 TB Sector Size : 512 Is VD emulated : Yes Parity Size : 2.728 TB State : Optimal Strip Size : 64 KB Number Of Drives : 3 Span Depth : 1 Default Cache Policy: WriteBack, ReadAhead, Cached, Write Cache OK if Bad BBU Current Cache Policy: WriteBack, ReadAhead, Cached, Write Cache OK if Bad BBU Default Access Policy: Read/Write Current Access Policy: Read/Write Disk Cache Policy : Disk's Default Ongoing Progresses: Check Consistency : Completed 66%, Taken 438 min. Encryption Type : None Bad Blocks Exist: No Is VD Cached: No |
Опции Patrol Read
1 |
# megacli -AdpPR -Dsbl|EnblAuto|EnblMan|Start|Stop|Info -aN|-a0,1,2|-aALL |
Description Sets Patrol Read options on a single controller, multiple controllers, or all controllers:
1 2 3 4 5 6 7 8 9 |
-Dsbl: Disables Patrol Read for the selected controller(s). -EnblAuto: Enables Patrol Read automatically for the selected controller(s). This means Patrol Read will start automatically after the controller initialization is complete. -EnblMan: Enables Patrol Read manually for the selected controller(s). This means that Patrol Read does not start automatically; it has to be started manually by selecting the Start command. -Start: Starts Patrol Read for the selected controller(s). -Stop: Stops Patrol Read for the selected controller(s). -Info: Displays the following Patrol Read information for the selected controller(s): • Patrol Read operation mode • Patrol Read execution delay value • Patrol Read status |
Получение информации о Read Patrol
1 |
# megacli -AdpPR -Info -aALL |
1 2 3 4 5 6 7 8 |
Adapter 0: Patrol Read Information: Patrol Read Mode: Auto Patrol Read Execution Delay: 168 hours Number of iterations completed: 260 Next start time: 11/04/2017, 03:00:00 Current State: Stopped Patrol Read on SSD Devices: Disabled |
Включение автоматического сканирования Read Patrol
1 |
# megacli -AdpPR -EnblAuto -aALL |
Выключение автоматического сканирования Read Patrol
1 |
# megacli -AdpPR -Dsbl -aALL |
Просмотр текущего коэффициента чтения
1 |
# megacli -AdpGetProp PatrolReadRate -aALL |
1 |
Adapter 0: Patrol Read Rate = 30% |
Минимизация/сокращение влияния сканирования Read Patrol на дисковую подсистему ввода/вывода путем уменьшения коэффициента чтения с дефолтных 30% до,например, 5%
1 |
# megacli -AdpSetProp PatrolReadRate 5 -aALL |
1 |
Adapter 0: Set Patrol Read Rate to 5% success. |
1 |
# megacli -AdpGetProp PatrolReadRate -aALL |
1 |
Adapter 0: Patrol Read Rate = 5% |
Ручной старт/запуск сканирования Read Patrol
1 |
# megacli -AdpPR -Start -aALL |
Остановка сканирования Read Patrol
1 |
# megacli -AdpPR -Stop -aALL |
Установка/изменение интервала сканирования Read petrol c дефолтных 7 дней(168 часов) на, например, 30 дней(720 часов)
Значение временного интервала устанавливается в часах
1 |
# megacli –AdpPRSetDelay 720 -aALL |
Исправление media-ошибок во время Patrol Read
1 |
# megacli -AdpSetProp -PrCorrectUncfgdAreas -1 -aALL |
MegaRAID consistency check
MegaRAID consistency checking is different from Read Patrol in that consistency checking reads all portions of a stripe, computing parity from the data portions of the stripe and then comparing the computed parity to the parity read from the drive. Not valid to RAID0 of course.
If the compare fails, the computed parity is then written to the appropriate drive. This process can impact the performance on the controller.
The consistency check can be started manually or automatically, both can set/start by MegaRAID Storage Manager or MegaCli(MegaCli64), In this article, I’ll be using example of MegaCli command line.
Consistency checking is automatically started in background mode at the time a parity type logical drive is created, and at this time each parity portion of every stripe is created from the existing data portions of the stripe and written to the appropriated drive.
By default, MegaRAID consistency check is enabled to concurrent mode, runs every 168 hours at up to 30% performance impact, you can check and set the values according to your business environment.
Просмотр текущего статуса, режима работы, даты следующего планового запуска, интервала запуска Consistency Check
1 |
# megacli AdpCcSched -Info -aALL |
1 2 3 4 5 6 7 8 9 10 |
Adapter #0 Operation Mode: Concurrent Execution Delay: 168 Next start time: 11/04/2017, 03:00:00 Current State: Stopped Number of iterations: 252 Number of VD completed: 1 Excluded VDs : None Exit Code: 0x00 |
Изменение запланированного времени старта сканирования Consistency Check
1 |
# megacli -AdpCCSched -SetSTartTime 20171118 02 -aALL |
1 |
Set next scheduled consistency check at 02:00am 20171118 |
Просмотр того, что делает Consistency Check в данный момент
1 |
# megacli -LDCC -ShowProg -lall -aall |
1 |
Check Consistency on VD #0 is not in progress. |
В момент выполнения сканирования,например, вывод может быть таким
1 |
# megacli -LDCC -ShowProg -lall -aall |
1 |
Check Consistency on VD #0 (target id #0) Completed 71% in 462 Minutes. |
Просмотр коэффициента сканирования Consistency Check
1 |
# megacli -AdpGetProp CCRate -aALL |
1 |
Adapter 0: Check Consistency Rate = 30% |
Уменьшение коэффициента сканирования до 5% с целью уменьшения влияния сканирования на производительность дисковой подсистемы
1 |
# megacli -AdpSetProp CCRate 5 -aALL |
1 |
Adapter 0: Set Check consistency rate to 5% success. |
1 |
# megacli -AdpGetProp CCRate -aALL |
1 |
Adapter 0: Check Consistency Rate = 5% |
Изменение интервала сканирования с дефолтных 168 часов(7 дней) до,например,720 часов(30 дней)
1 |
# megacli -AdpCcSched -SetDelay 720 -aALL |
Ручной старт/запуск сканирования Consistency Check
1 |
# megacli -LDCC -start -lall -aall |
Если появляется ошибка типа
1 |
"Consistency Check suspended on VD. . ." |
то выполняем
1 |
# megacli -LDCC -resume -lall -aall |
Остановка сканирования Consistency Check
1 |
# megacli -LDCC -stop -lall -aall |
Отключение сканирования Consistency Check
1 |
# megacli -AdpCcSched -Dsbl -aALL |
Изменение режима работы с дефолтного concurrent на sequencial
1 |
# megacli AdpCcSched -Info -aALL | grep -i mode |
1 |
Operation Mode: Concurrent |
1 |
# megacli -AdpCcSched -ModeSeq -aALL |
1 |
# megacli AdpCcSched -Info -aALL | grep -i mode |
1 |
Operation Mode: Sequencial |
Изменение режима работы на concurrent
1 |
# megacli -AdpCcSched -ModeConc -aALL |
После изменения режима с Отключено на режим concurrent/sequencial следующая запланированная Consistency Check будет проводиться в 2135 году,поэтому дополнительно необходимо установить время запланированного запуска снова
1 2 3 4 5 6 7 8 |
Operation Mode: Concurrent Execution Delay: 168 Next start time: 07/28/2135, 02:00:00 Current State: Stopped Number of iterations: 118 Number of VD completed: 1 Excluded VDs : None Exit Code: 0x00 |
Источник:
http://fibrevillage.com/storage/176-megaraid-patrol-read-detail
http://fibrevillage.com/storage/177-megaraid-consistency-check-in-detail