{"id":20163449,"url":"https://github.com/sjinks/watchscsi","last_synced_at":"2026-06-08T00:32:11.684Z","repository":{"id":77874997,"uuid":"55323897","full_name":"sjinks/watchscsi","owner":"sjinks","description":"Watch the status of a SCSI device and turn it online when it goes offline","archived":false,"fork":false,"pushed_at":"2016-04-03T01:57:26.000Z","size":2,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-01-13T14:22:08.733Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sjinks.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"custom":["https://www.paypal.com/donate/?hosted_button_id=SAG6877JDJ3KU","https://send.monobank.ua/jar/7rosVfiwKM"]}},"created_at":"2016-04-03T01:18:22.000Z","updated_at":"2018-02-17T04:31:01.000Z","dependencies_parsed_at":"2023-02-28T07:46:07.062Z","dependency_job_id":null,"html_url":"https://github.com/sjinks/watchscsi","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sjinks%2Fwatchscsi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sjinks%2Fwatchscsi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sjinks%2Fwatchscsi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sjinks%2Fwatchscsi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sjinks","download_url":"https://codeload.github.com/sjinks/watchscsi/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241600493,"owners_count":19988715,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-14T00:29:39.625Z","updated_at":"2026-06-08T00:32:11.649Z","avatar_url":"https://github.com/sjinks.png","language":"C","funding_links":["https://www.paypal.com/donate/?hosted_button_id=SAG6877JDJ3KU","https://send.monobank.ua/jar/7rosVfiwKM"],"categories":[],"sub_categories":[],"readme":"# watchscsi\n\nWatch the status of a SCSI device and turn it online when it goes offline\n\nThis is a tool written for myself while fighting with a faulty LSI Logic / Symbios Logic MegaRAID SAS 2208 RAID controller:\n\n```\nApr  2 12:42:09 wildwolf kernel: [656183.160235] megasas: Found FW in FAULT state, will reset adapter.\nApr  2 12:42:09 wildwolf kernel: [656183.160237] megaraid_sas: resetting fusion adapter.\nApr  2 12:43:56 wildwolf kernel: [656290.363894] megaraid_sas: Diag reset adapter never cleared!\nApr  2 12:45:43 wildwolf kernel: [656397.567552] megaraid_sas: Diag reset adapter never cleared!\nApr  2 12:47:31 wildwolf kernel: [656504.775214] megaraid_sas: Diag reset adapter never cleared!\nApr  2 12:47:31 wildwolf kernel: [656504.775216] megaraid_sas: Reset failed, killing adapter.\nApr  2 12:47:31 wildwolf kernel: [656504.775220] sd 0:2:0:0: Device offlined - not ready after error recovery\n...\nApr  2 12:47:31 wildwolf kernel: [656504.775353] sd 0:2:0:0: rejecting I/O to offline device\nApr  2 12:47:31 wildwolf kernel: [656504.786146] sd 0:2:0:0: [sda] killing request\n```\n\nIn this case the error recovery sets the SCSI device offline, the file system becomes read only, and the server finally crashes.\n\nHowever, it might be possible to turn the device back online by writing `running` to `/sys/bus/scsi/devices/\u003cscsi_host_no\u003e:0:\u003cscsi_id\u003e:\u003cscsi_lun\u003e/state`.\n\nThis program monitors the state of the device, when the state is `offline`, it tries to change it to `running`.\n\nUsage:\n\nwatchscsi deviceid\n\nFor example: `watchscsi 0:2:0:0`\n\nIn this case the program will monitor `/sys/bus/scsi/devices/0:2:0:0/state`\n\n`usr.local.bin.watchscsi.SAMPLE` is a *sample* Apprmor profile for this program.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsjinks%2Fwatchscsi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsjinks%2Fwatchscsi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsjinks%2Fwatchscsi/lists"}