{"id":15653189,"url":"https://github.com/cirocosta/xfsvol","last_synced_at":"2025-04-30T21:29:17.624Z","repository":{"id":41086448,"uuid":"97526310","full_name":"cirocosta/xfsvol","owner":"cirocosta","description":"Local Docker Volumes with XFS Project Quota","archived":false,"fork":false,"pushed_at":"2018-05-30T00:07:43.000Z","size":4568,"stargazers_count":31,"open_issues_count":10,"forks_count":6,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-30T20:05:16.676Z","etag":null,"topics":["docker","docker-plugin","go","golang","pquota","quota","storage","volumes","xfs"],"latest_commit_sha":null,"homepage":"","language":"Go","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/cirocosta.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}},"created_at":"2017-07-17T22:03:22.000Z","updated_at":"2024-07-25T02:50:51.000Z","dependencies_parsed_at":"2022-09-05T15:51:32.956Z","dependency_job_id":null,"html_url":"https://github.com/cirocosta/xfsvol","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/cirocosta%2Fxfsvol","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cirocosta%2Fxfsvol/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cirocosta%2Fxfsvol/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cirocosta%2Fxfsvol/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cirocosta","download_url":"https://codeload.github.com/cirocosta/xfsvol/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251785156,"owners_count":21643426,"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":["docker","docker-plugin","go","golang","pquota","quota","storage","volumes","xfs"],"created_at":"2024-10-03T12:44:55.152Z","updated_at":"2025-04-30T21:29:17.543Z","avatar_url":"https://github.com/cirocosta.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003exfsvol 📂  \u003c/h1\u003e\n\n\u003ch5 align=\"center\"\u003eDocker Volume Plugin for managing local XFS-based volumes\u003c/h5\u003e\n\n\u003cbr/\u003e\n\n[![Build Status](https://travis-ci.org/cirocosta/xfsvol.svg?branch=master)](https://travis-ci.org/cirocosta/xfsvol)\n\n## Quickstart\n\n1. Create a mountpoint at `/mnt/xfs` and a directory `/mnt/xfs/volumes`. \n\nFor testing purposes this mountpoint can be a loopback device (note: use a loopback device for testing purposes only).\n\n```sh\nsudo dd if=/dev/zero of=/xfs.1G bs=1M count=1024\nsudo losetup /dev/loop0 /xfs.1G\nsudo mkfs -t xfs -n ftype=1 /dev/loop0\nsudo mkdir -p /mnt/xfs/volumes\nsudo mount /dev/loop0 /mnt/xfs -o pquota\n```\n\n2. Install the plugin\n\n```\ndocker plugin install \\\n        --grant-all-permissions \\\n        --alias xfsvol \\\n        cirocosta/xfsvol\n\ndocker plugin ls\nID                  NAME                DESCRIPTION                                   ENABLED\n06545b643c6a        xfsvol:latest       Docker plugin to manage XFS-mounted volumes   true\n```\n\n3. Create a named volume\n\n```\ndocker volume create \\\n        --driver xfsvol \\\n        --opt size=10M \\\n        myvolume1\n```\n\n4. Run a container with the volume attached\n\n```\ndocker run -it \\\n        -v myvolume1:/myvolume1 \\\n        alpine /bin/sh\n\ndd if=/dev/zero of=/myvolume1/file bs=1M count=100\n(fail!)\n```\n\n5. Check the volumes list\n\n```\ndocker volume ls\nDRIVER              VOLUME NAME\nxfsvol:latest       myvolume1 (1.004MB)\nlocal               dockerdev-go-pkg-cache-gopath\nlocal               dockerdev-go-pkg-cache-goroot-linux_amd64\nlocal               dockerdev-go-pkg-cache-goroot-linux_amd64_netgo\n```\n\nand the `xfsvolctl` utility:\n\n```\nsudo /usr/bin/xfsvolctl ls --root /mnt/xfs/volumes/\nNAME   QUOTA\nciro   1.004 MB\n```\n\n## `xfsvolctl`\n\nThis tool is made to help inspect the project quotas created under a given root path as well as create/delete others. It's usage is documented under `--help`:\n\n```\nxfsvolctl --help\nNAME:\n   xfsvolctl - Controls the 'xfsvol' volume plugin\n\nUSAGE:\n   xfsvolctl [global options] command [command options] [arguments...]\n\nVERSION:\n   0.0.0\n\nCOMMANDS:\n     ls       Lists the volumes managed by 'xfsvol' plugin\n     create   Creates a volume with XFS project quota enforcement\n     delete   Deletes a volume managed by 'xfsvol' plugin\n     help, h  Shows a list of commands or help for one command\n\nGLOBAL OPTIONS:\n   --help, -h     show help\n   --version, -v  print the version\n```\n\n### Under the hood\n\n\n```\n$ sudo mkdir -p /mnt/xfs/tmp/bbb\n$ sudo strace -f xfsvolctl create \\\n        --root /mnt/xfs/tmp/bbb \\\n        --name ccc \\\n        --size 1024 \\\n        --inode 1024\n\nstat(\"/mnt/xfs/tmp/bbb\", {st_mode=S_IFDIR|0755, st_size=6, ...}) = 0\nunlinkat(AT_FDCWD, \"/mnt/xfs/tmp/bbb/backingFsBlockDev\", 0) = -1 ENOENT (No such file or directory)\nmknodat(AT_FDCWD, \"/mnt/xfs/tmp/bbb/backingFsBlockDev\", S_IFBLK|0600, makedev(7, 0)) = 0\nquotactl(Q_XSETQLIM|PRJQUOTA, \"/mnt/xfs/tmp/bbb/backingFsBlockDev\", 1, {version=1, flags=XFS_PROJ_QUOTA, fieldmask=0xc, id=1, blk_hardlimit=0, blk_softlimit=0, ino_hardlimit=0, ino_softlimit=0, bcount=0, icount=0, ...}) = 0\n...\nmkdirat(AT_FDCWD, \"/mnt/xfs/tmp/bbb/ccc\", 0755) = 0\nopen(\"/mnt/xfs/tmp/bbb/ccc\", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 3\nfstat(3, {st_mode=S_IFDIR|0755, st_size=6, ...}) = 0\nioctl(3, FS_IOC_FSGETXATTR, 0xc4201a95e4) = 0\nioctl(3, FS_IOC_FSSETXATTR, 0xc4201a95e4) = 0\n\nquotactl(Q_XSETQLIM|PRJQUOTA, \"/mnt/xfs/tmp/bbb/backingFsBlockDev\", 2, {version=1, flags=XFS_PROJ_QUOTA, fieldmask=0xc, id=2, blk_hardlimit=2, blk_softlimit=2, ino_hardlimit=1024, ino_softlimit=1024, bcount=0, icount=0, ...}) = 0\n[pid  6833] ioctl(2, TCGETS, {B38400 opost isig icanon echo ...}) = 0\n\n\n// retrieving (ls)\n\n[pid  8609] quotactl(Q_XGETQUOTA|PRJQUOTA, \"/mnt/xfs/tmp/ddd/backingFsBlockDev\", 2, {version=1, flags=XFS_PROJ_QUOTA, fieldmask=0, id=2, blk_hardlimit=8, blk_softlimit=8, ino_hardlimit=0, ino_softlimit=0, bcount=8, icount=104, ...}) = 0\n\n\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcirocosta%2Fxfsvol","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcirocosta%2Fxfsvol","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcirocosta%2Fxfsvol/lists"}