30-40 minute fsck of array on some reboots

Hello,

I have an EON running Raspberry Pi OS (64-bit). I’m booting from a Micro SD card and using mdadm to create a RAID1 array using two WD Red 4 TB drives. I have the array (md0) formatted as ext4.

Sometimes, when rebooting the EON, it does a lengthy fsck on the md0 array. It takes 30-40 minutes to come up after the reboot.

Is there something that would trigger this to happen on certain reboots but not others? I’m just running a “sudo reboot” from a terminal. Am I supposed to be doing something to unmount/stop the array before rebooting?

Thanks for any help/guidance.

WD Red (not Plus, not Pro) are SMR drives. They’re slow to write and depending on a number of factors, can cause no end of problems with any sort of RAID array.

Best advice is to avoid using them in a RAID of any kind.

1 Like

I should have clarified…the drives are WD Red Plus which are CMR - not the “plain” Red that are SMR.

Have you tried performing any checks of the drives’ SMART status?

How are you shutting down the Pi?

I haven’t seen this behaviour myself-you may have to try checking the dmesg logs for any errors.

When it does the check, are you seeing a specific disk mounted consistently (e.g. /dev/sdX) for the check or just the mount point?

Make sure you are asking the system to shutdown nicely… i.e. use shutdown… Drives that are slow may not take a reboot request nicely… shutdown does just that, shutdown and expect to flush everything needed.

A reboot may not allow the drive to preserve data… I suspect the file system (on top of the raid device) is not being marked clean, hence the long fsck on a restart.

It appears my sudo reboot command instead of sudo shutdown -r was causing this. Duh.

Thanks for the help.