SiloCityLabs / lochnas

Docker configuration for all-in-one nas setup
https://lochnas.com
GNU General Public License v3.0
50 stars 3 forks source link

Disk health check #32

Open ldrrp opened 2 years ago

ldrrp commented 2 years ago

Problem

Currently there are no checks for disk health. This is a problem if we want to ensure data is not lost.

Solution

On a cron check for the health of the disks and if any are unhealthy we should notify the user and log the issue.

Example:

 - disks:
    - uuid: AISDYIAYSIDYUA
      options:
        - notification:
            enabled: true
        - log: true
    - uuid: BISDASDSAJFYUA
      options:
        - notification:
            enabled: true
        - log: true

Notify may be "true", "false" or "email" etc. Parsed as string. True will use server default.

Additionally we should allow the user to call the disk check directly.

Steps to Reproduce the Problem

  1. ./server.bin -system disk-check
ldrrp commented 2 years ago
root@cloud:/docker-nas/server# udevadm info -q property -n /dev/sdq | grep -i type
DEVTYPE=disk
SCSI_TYPE=disk
ID_TYPE=disk
ID_PART_TABLE_TYPE=gpt
root@cloud:/docker-nas/server# udevadm info -q property -n /dev/md127 | grep -i type
DEVTYPE=disk
ID_PART_TABLE_TYPE=gpt
root@cloud:/docker-nas/server# udevadm info -q property -n /dev/md0 | grep -i type
DEVTYPE=disk
ID_FS_TYPE=ext4
root@cloud:/docker-nas/server# udevadm info -q property -n /dev/sda | grep -i type
DEVTYPE=disk
SCSI_TYPE=disk
ID_TYPE=disk
ID_FS_TYPE=linux_raid_member
ldrrp commented 2 years ago

https://github.com/dell/csi-baremetal/tree/master/pkg/base/linuxutils