IceWhaleTech / zimaos-rauc

475 stars 23 forks source link

Attempting to enable smart reporting on ramdrives (or zram) #16

Open scottharman opened 6 months ago

scottharman commented 6 months ago

error logs from /var/log/casaos/local-storage.log:

2023-11-28T01:18:20.771Z    info    Notified systemd that local storage service is ready    {"func": "main.main", "file": "/home/runner/work/ZimaOS-LocalStorage/ZimaOS-LocalStorage/main.go", "line": 204}
2023-11-28T01:18:20.771Z    info    LocalStorage service is listening...    {"address": "127.0.0.1:42091", "func": "main.main", "file": "/home/runner/work/ZimaOS-LocalStorage/ZimaOS-LocalStorage/main.go", "line": 209}
2023-11-28T01:18:21.170Z    error   failed to enable S.M.A.R.T: smartctl 7.3 2022-02-28 r5338 [x86_64-linux-6.1.22] (local build)
Copyright (C) 2002-22, Bruce Allen, Christian Franke, www.smartmontools.org

/dev/zram0: Unable to detect device type
Please specify device type with the -d option.

Use smartctl -h to get a usage summary

    {"error": "exit status 1", "path": "/dev/zram0", "func": "service.(*diskService).CheckSerialDiskMount", "file": "/home/runner/work/ZimaOS-LocalStorage/ZimaOS-LocalStorage/service/disk.go", "line": 576}
2023-11-28T01:18:21.178Z    error   failed to enable S.M.A.R.T: smartctl 7.3 2022-02-28 r5338 [x86_64-linux-6.1.22] (local build)
Copyright (C) 2002-22, Bruce Allen, Christian Franke, www.smartmontools.org

/dev/zram1: Unable to detect device type
Please specify device type with the -d option.

Use smartctl -h to get a usage summary

    {"error": "exit status 1", "path": "/dev/zram1", "func": "service.(*diskService).CheckSerialDiskMount", "file": "/home/runner/work/ZimaOS-LocalStorage/ZimaOS-LocalStorage/service/disk.go", "line": 576}
2023-11-28T01:18:21.186Z    error   failed to enable S.M.A.R.T: smartctl 7.3 2022-02-28 r5338 [x86_64-linux-6.1.22] (local build)
Copyright (C) 2002-22, Bruce Allen, Christian Franke, www.smartmontools.org

/dev/zram2: Unable to detect device type
Please specify device type with the -d option.

Use smartctl -h to get a usage summary

    {"error": "exit status 1", "path": "/dev/zram2", "func": "service.(*diskService).CheckSerialDiskMount", "file": "/home/runner/work/ZimaOS-LocalStorage/ZimaOS-LocalStorage/service/disk.go", "line": 576}
2023-11-28T01:18:21.440Z    error   failed to send notify   {"message": {"sys_disk":{"size":1006440170496,"avail":954307694592,"health":true,"used":1015250944}}, "error": "open /var/run/casaos/casaos.url: no such file or directory", "func": "main.sendDiskBySocket", "file": "/home/runner/work/ZimaOS-LocalStorage/ZimaOS-LocalStorage/misc.go", "line": 85}
2023-11-28T01:18:21.764Z    error   failed to send notify   {"message": {"sys_usb":[]}, "error": "open /var/run/casaos/casaos.url: no such file or directory", "func": "main.sendUSBBySocket", "file": "/home/runner/work/ZimaOS-LocalStorage/ZimaOS-LocalStorage/misc.go", "line": 95}
age": {"sys_usb":[]}, "error": "open /var/run/casaos/casaos.url: no such file or directory", "func": "main.sendUSBBySocket", "file": "/home/runner/work/ZimaOS-LocalStorage/ZimaOS-LocalStorage/misc.go", "line": 95}

Suggests that all mounted drives are having smart enabled, but obvs can't be done on the virtual drives. Separately, it would be helpful if the smart log could be dumped periodically, once every boot; and from the appropriate interface (i.e. from nvme /dev/nvme0)