{"id":24541286,"url":"https://github.com/1999azzar/swap-management","last_synced_at":"2026-05-19T17:13:54.257Z","repository":{"id":272971013,"uuid":"913964056","full_name":"1999AZZAR/swap-management","owner":"1999AZZAR","description":"A comprehensive Linux swap management utility that provides control over ZRAM, ZSWAP, disk swap, and system swap parameters.","archived":false,"fork":false,"pushed_at":"2025-02-11T13:13:42.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-11T14:25:26.700Z","etag":null,"topics":["linux","memory-management","swap"],"latest_commit_sha":null,"homepage":"","language":"Shell","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/1999AZZAR.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}},"created_at":"2025-01-08T17:28:16.000Z","updated_at":"2025-02-11T13:13:45.000Z","dependencies_parsed_at":null,"dependency_job_id":"f811bc72-7c39-4de3-9aa2-2f805858eed0","html_url":"https://github.com/1999AZZAR/swap-management","commit_stats":null,"previous_names":["1999azzar/swap-management"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1999AZZAR%2Fswap-management","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1999AZZAR%2Fswap-management/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1999AZZAR%2Fswap-management/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1999AZZAR%2Fswap-management/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/1999AZZAR","download_url":"https://codeload.github.com/1999AZZAR/swap-management/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243830913,"owners_count":20354850,"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":["linux","memory-management","swap"],"created_at":"2025-01-22T18:17:28.980Z","updated_at":"2026-05-19T17:13:54.251Z","avatar_url":"https://github.com/1999AZZAR.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Swap Manager - Enhanced\n\nA powerful, safety-first Linux swap management utility with a modern terminal UI for controlling ZRAM, ZSWAP, disk swap, and system parameters.\n\n## Features\n\n- **Context-Aware Terminal UI**: Dynamic menus that adapt based on your system's current state (Enable/Disable toggles).\n- **Proactive Dependency Check**: Validates required tools (`bc`, `mkswap`, etc.) on startup.\n- **Advanced ZRAM Management**:\n  - Temporary or persistent configuration via systemd.\n  - **Live Algorithm Switching**: Detects and changes compression algorithms (lz4, zstd, etc.) on the fly.\n  - Proactive module loading for algorithm discovery.\n- **Robust ZSWAP Configuration**:\n  - **Instant Runtime Updates**: Apply changes immediately via sysfs without rebooting.\n  - **Crypto-API Integration**: Scans `/proc/crypto` to list only kernel-supported compressors.\n  - Dual-layer persistence (Runtime + GRUB).\n- **Disk Swap Suite**:\n  - **Dynamic Resizing**: Safely resize swap files with data integrity checks.\n  - **Priority Management**: Live and persistent swap priority control.\n  - **Safety Guardrails**: Verifies `swapoff` success before file deletion; automatic `/etc/fstab` backups.\n- **Swap Aggressiveness Control**: 3 optimized presets (Aggressive, Moderate, Conservative) + custom settings.\n- **Auto-Configuration**: Intelligent RAM-based scaling (0.1x - 3.0x multiplier).\n\n## Prerequisites\n\n- **Root access** (Required for memory/swap operations)\n- **Linux Kernel**: Support for ZRAM/ZSWAP\n- **Core Utils**: `bc`, `modprobe`, `mkswap`, `fallocate`\n- **Bootloader**: GRUB (for persistent ZSWAP settings)\n\n## Installation\n\n### Automated Installation\n\n```bash\nwget -q https://github.com/1999AZZAR/swap-management/raw/main/install.sh -O install.sh \u0026\u0026 bash install.sh\n```\n\n### Manual Installation\n\n1. Download the script:\n   \n   ```bash\n   sudo wget -O /usr/local/bin/swap-manager https://raw.githubusercontent.com/1999AZZAR/swap-management/main/swap_manager.sh\n   ```\n2. Make it executable:\n   \n   ```bash\n   sudo chmod +x /usr/local/bin/swap-manager\n   ```\n3. (Optional) Create alias:\n   \n   ```bash\n   echo \"alias swap='sudo swap-manager'\" \u003e\u003e ~/.bashrc \u0026\u0026 source ~/.bashrc\n   ```\n\n## Usage\n\nRun the utility:\n\n```bash\nswap\n```\n\n### Main Menu Overview\n\n1. **Auto Configuration**: Set recommended ZRAM/ZSWAP ratios based on RAM size.\n2. **Configure Swap Aggressiveness**: Tune swappiness and cache pressure.\n3. **ZRAM Management**: Toggle ZRAM and change compression algorithms.\n4. **ZSWAP Management**: Context-aware toggle for ZSWAP and runtime compressor tuning.\n5. **Disk Swap Management**: Add/Remove swap, change priority, or resize files.\n6. **Check System Status**: Detailed report of RAM, ZRAM, ZSWAP, and Disk Swap.\n\n## Configuration \u0026 Logs\n\n| Path                               | Purpose                     |\n| ---------------------------------- | --------------------------- |\n| `/etc/swap-manager/`               | Configuration directory     |\n| `/var/log/swap-manager.log`        | Operation logs for auditing |\n| `/etc/systemd/system/zram.service` | Persistent ZRAM unit        |\n\n## Safety Notes ⚠️\n\n- **Memory Pressure**: Resizing or disabling swap during high memory usage may lead to OOM (Out of Memory) conditions.\n- **Bootloader**: ZSWAP changes are applied to GRUB; ensure you verify bootloader updates if using a non-standard configuration.\n- **Backups**: The script automatically backs up `/etc/fstab` before modifications.\n\n## License\n\nMIT License","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F1999azzar%2Fswap-management","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F1999azzar%2Fswap-management","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F1999azzar%2Fswap-management/lists"}