{"id":48801303,"url":"https://github.com/galpt/io-scheduler-setup","last_synced_at":"2026-04-14T03:02:29.622Z","repository":{"id":339559491,"uuid":"1162449038","full_name":"galpt/io-scheduler-setup","owner":"galpt","description":"IO Scheduler Setup Script","archived":false,"fork":false,"pushed_at":"2026-02-20T09:53:08.000Z","size":13,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-20T13:30:46.510Z","etag":null,"topics":["io-scheduling","linux","linux-kernel","linux-shell"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/galpt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-20T09:24:00.000Z","updated_at":"2026-02-20T09:53:11.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/galpt/io-scheduler-setup","commit_stats":null,"previous_names":["galpt/io-scheduler-setup"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/galpt/io-scheduler-setup","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/galpt%2Fio-scheduler-setup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/galpt%2Fio-scheduler-setup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/galpt%2Fio-scheduler-setup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/galpt%2Fio-scheduler-setup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/galpt","download_url":"https://codeload.github.com/galpt/io-scheduler-setup/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/galpt%2Fio-scheduler-setup/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31779951,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-14T02:24:21.117Z","status":"ssl_error","status_checked_at":"2026-04-14T02:24:20.627Z","response_time":153,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["io-scheduling","linux","linux-kernel","linux-shell"],"created_at":"2026-04-14T03:02:26.412Z","updated_at":"2026-04-14T03:02:29.617Z","avatar_url":"https://github.com/galpt.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# IO Scheduler Setup\n\nSmall interactive helper to inspect and set block device I/O schedulers,\nand persist a chosen scheduler across reboots using a udev rule.\n\n---\n\n## Table of Contents\n- [Status](#status)\n- [Features](#features)\n- [Requirements](#requirements)\n- [Usage](#usage)\n- [Examples](#examples)\n- [Design Notes](#design-notes)\n- [Limitations \u0026 Next Steps](#limitations--next-steps)\n- [Contributing](#contributing)\n- [License](#license)\n\n## Status\n- Basic interactive script saved at `io-scheduler-setup.sh`. Intended for\n  manual use on systems where `/sys/block/\u003cdev\u003e/queue/scheduler` is writable.\n\n## Features\n- Enumerates block disks with `lsblk` and shows model/size/rotational flag.\n- Reads available schedulers from `/sys/block/\u003cdev\u003e/queue/scheduler`.\n- Applies a scheduler immediately (writes to sysfs).\n- Optionally writes a udev rule at `/etc/udev/rules.d/99-io-scheduler.rules`\n  to make the scheduler selection persistent across reboots.\n  The `99-` prefix ensures this rule runs after all system defaults\n  (e.g. `60-ioschedulers.rules` from systemd-udev which resets NVMe to `none`).\n- Provides `--remove \u003cdev\u003e` to remove rules created for a device.\n\n## Requirements\n- A Linux kernel and distribution that expose `/sys/block/\u003cdev\u003e/queue/scheduler`.\n- `bash`, `lsblk`, `udevadm`, and basic shell utilities (`awk`, `sed`, `grep`).\n- Root privileges to write sysfs and to create udev rules (script will escalate via `sudo`).\n\n## Usage\n1. Make the script executable from the `IO Scheduler Setup` directory:\n\n```bash\nchmod +x io-scheduler-setup.sh\n```\n\n2. Run interactively (recommended):\n\n```bash\nsudo ./io-scheduler-setup.sh\n```\n\n3. Remove previously created udev rules for a device:\n\n```bash\nsudo ./io-scheduler-setup.sh --remove sda\n```\n\n\u003e [!NOTE]\n\u003e - Persistent udev rules are written to `/etc/udev/rules.d/99-io-scheduler.rules`.\n\u003e - The `99-` prefix guarantees this file is processed after system defaults that would otherwise override your choice.\n\u003e - The script backs up an existing rule file before appending new entries.\n\n## Examples\n- Inspect disks and set scheduler interactively:\n\n```bash\nsudo ./io-scheduler-setup.sh\n# follow prompts to choose disk, apply scheduler, and optionally persist it\n```\n\n- Create a persistent rule for `/dev/sdb` (example interactive flow):\n  - Choose `/dev/sdb` in the menu\n  - Apply desired scheduler (optional)\n  - Choose to create persistent udev rule and enter the desired scheduler\n\n## Design Notes\n- The script prefers to match devices by their kernel name (e.g. `sda`) when\n  writing udev rules: `SUBSYSTEM==\"block\", KERNEL==\"sda\", ATTR{queue/scheduler}==\"\u003csched\u003e\"`.\n- This keeps rules simple and predictable; for more advanced per-model rules\n  you can edit the generated `/etc/udev/rules.d/60-io-scheduler.rules` manually.\n- After writing rules the script reloads udev rules and triggers a change event\n  for the affected device.\n\n## Limitations \u0026 Next Steps\n- Not all block devices allow changing the scheduler at runtime (some device/driver\n  stacks ignore writes to `/sys/block/.../queue/scheduler`). If writing fails,\n  the script reports the error.\n- NVMe vs SATA: device naming differs (`nvme0n1` vs `sda`) — the script lists\n  all block disks so pick the exact kernel name printed by the menu.\n- Future improvements: add a dry-run mode, allow matching by WWN or model for\n  more permanent device identification, and add unit tests or a validation\n  mode that runs on non-root to show proposed changes.\n\n## Contributing\n- Bug reports and improvements welcome. Keep changes small and avoid running\n  untrusted code as root. When modifying udev behavior, prefer clear, documented\n  rules and make backups of `/etc/udev/rules.d/60-io-scheduler.rules`.\n\n## License\n- MIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgalpt%2Fio-scheduler-setup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgalpt%2Fio-scheduler-setup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgalpt%2Fio-scheduler-setup/lists"}