{"id":17658637,"url":"https://github.com/ruuda/diskctl","last_synced_at":"2025-03-30T10:27:23.202Z","repository":{"id":53822213,"uuid":"462907251","full_name":"ruuda/diskctl","owner":"ruuda","description":"Domain-specific inventory management system for disks in btrfs file systems","archived":false,"fork":false,"pushed_at":"2024-09-08T08:14:44.000Z","size":30,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-05T12:23:03.567Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Haskell","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ruuda.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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}},"created_at":"2022-02-23T21:12:04.000Z","updated_at":"2024-11-13T09:09:43.000Z","dependencies_parsed_at":"2024-09-08T09:28:57.696Z","dependency_job_id":"10ac54f3-e16f-4c01-9705-01637a975a11","html_url":"https://github.com/ruuda/diskctl","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/ruuda%2Fdiskctl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruuda%2Fdiskctl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruuda%2Fdiskctl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruuda%2Fdiskctl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ruuda","download_url":"https://codeload.github.com/ruuda/diskctl/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246305320,"owners_count":20756067,"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-10-23T15:27:46.685Z","updated_at":"2025-03-30T10:27:23.180Z","avatar_url":"https://github.com/ruuda.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Diskctl\n\nDiskctl is an domain-specific inventory management system for tracking disks in\nbtrfs file systems. It is useful when your storage needs have escalated from one\nexternal disk, to the point where you have several disks lying on your desk and\nyou realize “Hmm, which one was which again? Maybe I should have labeled them.”\n\nWith Diskctl you track your disks, LUKS volumes, and btrfs file systems, in a\nTOML file. This file acts as a crude inventory database that can be kept under\nsource control. Diskctl can check it for consistency, and display derived\nproperties, such as the price per terabyte, or wipe speed in MB/s.\n\nDiskctl is a bespoke utility that is aimed at my very particular setup. In its\ncurrent form it is probably not useful to anybody else, but perhaps it can form\na starting point for other tools. I should write a blog post about my setup and\nthe rationale behind it at some point, but the gist of it is:\n\n * There are btrfs file systems.\n * Each file system consists of multiple LUKS volumes in RAID1.\n * Each LUKS volume sits directly atop a disk (no partition table).\n * Before creating the LUKS volume, I wipe the disk with random bytes.\n\n## Example\n\nGiven the following inventory file:\n\n```toml\n[[disk]]\nlabel         = \"2021-11a\"\nmodel_name    = \"Devnull Systems X10\"\nserial_number = \"7a4a0065\"\npurchase_date = 2021-11-03\nwipe_date     = 2021-11-14\nwipe_seconds  = 253957\nsize_bytes    = 12000138625024\nprice_eur     = 199.99\n\n[[volume]]\nlabel     = \"pool-a\"\ndisk      = \"2021-11a\"\nluks_uuid = \"5456959a-e303-4c55-8827-bac709be7cff\"\n\n[[filesystem]]\nlabel      = \"pool\"\nbtrfs_uuid = \"1767978f-14ee-40cb-98b9-f936858dd12f\"\nvolumes    = [\n  { volume = \"pool-a\", install_date = 2021-11-21 },\n]\n```\n\nWe can show the filesystem like so:\n\n```console\n$ diskctl --file example.toml filesystem\n ● pool\n   ├─ btrfs uuid:           1767978f-14ee-40cb-98b9-f936858dd12f\n   ├─ size:                 12.00 TB, 12000138625024 bytes\n   ├─ price:                € 199.99, € 16.66/TB\n   └─ volume:               pool-a\n      ├─ luks uuid:         5456959a-e303-4c55-8827-bac709be7cff\n      ├─ installed:         2021-11-21\n      └─ disk:              2021-11a\n         ├─ model name:     Devnull Systems X10\n         ├─ serial number:  7a4a0065\n         ├─ size:           12.00 TB, 12000138625024 bytes\n         ├─ price:          € 199.99, € 16.66/TB\n         ├─ purchase date:  2021-11-03\n         ├─ wipe date:      2021-11-14\n         └─ wipe time:      2d:22h:32m:37s, 47.25 MB/s\n```\n\n(It is more useful with more disks and volumes, but that would make the example\ntoo large for the readme.)\n\n## Building\n\nWith [Nix](https://nixos.org/) 2.14 or later:\n\n    $ nix develop --command make\n    $ export LOCALE_ARCHIVE=/nix/store/4ahmilj13ppkfqsad42k9bjf6fafr7km-glibc-locales-2.30/lib/locale/locale-archive\n    $ src/diskctl --help\n\n## License\n\nDiskctl is licensed under the [Apache 2.0][apache2] license. It may be used in\nfree software as well as closed-source applications, both for commercial and\nnon-commercial use under the conditions given in the license. If you want to\nuse Diskctl in your GPLv2-licensed software, you can add an [exception][except]\nto your copyright notice. Please do not open an issue if you disagree with the\nchoice of license.\n\n[apache2]: https://www.apache.org/licenses/LICENSE-2.0\n[except]:  https://www.gnu.org/licenses/gpl-faq.html#GPLIncompatibleLibs\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fruuda%2Fdiskctl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fruuda%2Fdiskctl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fruuda%2Fdiskctl/lists"}