{"id":13582411,"url":"https://github.com/containers/docker-lvm-plugin","last_synced_at":"2025-05-07T21:41:06.090Z","repository":{"id":47085112,"uuid":"54664398","full_name":"containers/docker-lvm-plugin","owner":"containers","description":"Docker volume plugin for LVM volumes","archived":false,"fork":false,"pushed_at":"2023-07-29T00:08:43.000Z","size":1617,"stargazers_count":156,"open_issues_count":12,"forks_count":64,"subscribers_count":16,"default_branch":"main","last_synced_at":"2025-03-31T14:21:22.502Z","etag":null,"topics":["docker","docker-lvm-plugin","golang","hacktoberfest","lvm","lvm-volumes","lvm2"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/containers.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE-OF-CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2016-03-24T18:20:54.000Z","updated_at":"2025-01-31T10:41:32.000Z","dependencies_parsed_at":"2024-01-19T08:15:27.548Z","dependency_job_id":"75f17de9-85ac-47fd-97f6-dc0ce8b2a86e","html_url":"https://github.com/containers/docker-lvm-plugin","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/containers%2Fdocker-lvm-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/containers%2Fdocker-lvm-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/containers%2Fdocker-lvm-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/containers%2Fdocker-lvm-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/containers","download_url":"https://codeload.github.com/containers/docker-lvm-plugin/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252961318,"owners_count":21832183,"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-lvm-plugin","golang","hacktoberfest","lvm","lvm-volumes","lvm2"],"created_at":"2024-08-01T15:02:41.217Z","updated_at":"2025-05-07T21:41:06.061Z","avatar_url":"https://github.com/containers.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# docker lvm plugin\n[![CI Actions Status](https://github.com/containers/docker-lvm-plugin/workflows/CI/badge.svg)](https://github.com/containers/docker-lvm-plugin/actions)\n[![License: GNU LGPL v3.0](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://github.com/containers/docker-lvm-plugin/blob/master/LICENSE)\n[![Release](https://img.shields.io/badge/version-1.0-blue)](https://github.com/containers/docker-lvm-plugin/releases/tag/v1.0)\n\nDocker Volume Driver for lvm volumes\n\nThis plugin can be used to create lvm volumes of specified size, which can\nthen be bind mounted into the container using `docker run` command.\n\n## Setup\n\n    1) git clone git@github.com:projectatomic/docker-lvm-plugin.git (You can also use HTTPS to clone: git clone https://github.com/projectatomic/docker-lvm-plugin.git)\n    2) cd docker-lvm-plugin\n    3) export GO111MODULE=on\n    4) make\n    5) sudo make install\n\n## Wanna try it out!? (Vagrant)\n\nFrom the `$root` directory of the project.\n\n```\n$ vagrant up\n```\n\nOnce the VM is up and running (`vagrant global-status` will list you all the vagrant VMs running on your system), you can `ssh` into the VM by running `vagrant ssh docker-lvm-plugin-fedora33`.\n\n## Screencast\n[![asciicast](https://asciinema.org/a/248482.svg)](https://asciinema.org/a/248482)\n\n## Usage\n\n1) Start the docker daemon before starting the docker-lvm-plugin daemon.\n   You can start docker daemon using command:\n```bash\nsudo systemctl start docker\n```\n2) Once docker daemon is up and running, you can start docker-lvm-plugin daemon\n   using command:\n```bash\nsudo systemctl start docker-lvm-plugin\n```\nNOTE: docker-lvm-plugin daemon is on-demand socket activated. Running `docker volume ls` command\nwill automatically start the daemon.\n\n3) Since logical volumes (lv's) are based on a volume group, it is the\n   responsibility of the user (administrator) to provide a volume group name.\n   You can choose an existing volume group name by listing volume groups on\n   your system using `vgs` command OR create a new volume group using\n   `vgcreate` command.\n   e.g.\n```bash\nvgcreate vg0 /dev/hda\n```\n   where /dev/hda is your partition or whole disk on which physical volumes\n   were created.\n\n4) Add this volume group name in the config file\n```bash\n/etc/docker/docker-lvm-plugin\n```\n\n5) The docker-lvm-plugin also supports the creation of thinly-provisioned volumes. To create a thinly-provisioned volume, a user (administrator) must first create a thin pool using the `lvcreate` command.\n```bash\nlvcreate -L 10G -T vg0/mythinpool\n```\nThis will create a thinpool named `mythinpool` of size 10G under volume group `vg0`.\nNOTE: thinpools are special kind of logical volumes carved out of the volume group.\nHence in the above example, to create the thinpool `mythinpool` you must have atleast 10G of freespace in volume group `vg0`.\n\n6) The docker-lvm-plugin allows you to create volumes using an optional volume group, which you can pass using `--opt vg` in `docker volume create` command. However, this is **not recommended** and user (administrator) should stick to the default volume group specified in /etc/docker/docker-lvm-plugin config file.\n\n   If a user still chooses to create a volume using an optional volume group\n   e.g `--opt vg=vg1`, user **must** pass `--opt vg=vg1` when creating any derivative volumes\n   based off this original volume. E.g\n\n   * Any snapshot volumes which are created off a volume that was created using the optional volume group.\n   * Any thin volumes which are created off a thin pool that was created using an optional volume group.\n\n## Volume Creation\n`docker volume create` command supports the creation of regular lvm volumes, thin volumes, snapshots of regular and thin volumes.\n\nUsage: docker volume create [OPTIONS]\n```bash\n-d, --driver    string    Specify volume driver name (default \"local\")\n--label         list      Set metadata for a volume (default [])\n--name          string    Specify volume name\n-o, --opt       map       Set driver specific options (default map[])\n```\nFollowing options can be passed using `-o` or `--opt`\n```bash\n--opt size\n--opt thinpool\n--opt snapshot\n--opt keyfile\n--opt vg\n```\nPlease see examples below on how to use these options.\n\n## Examples\n```bash\n$ docker volume create -d lvm --opt size=0.2G --name foobar\n```\nThis will create a lvm volume named `foobar` of size 208 MB (0.2 GB) in the\nvolume group vg0.\n```bash\n$ docker volume create -d lvm --opt size=0.2G --opt vg=vg1 --name foobar\n```\nThis will create a lvm volume named `foobar` of size 208 MB (0.2 GB) in the\nvolume group vg1.\n```bash\ndocker volume create -d lvm --opt size=0.2G --opt thinpool=mythinpool --name thin_vol\n```\nThis will create a thinly-provisioned lvm volume named `thin_vol` in mythinpool.\n```bash\ndocker volume create -d lvm --opt snapshot=foobar --opt size=100M --name foobar_snapshot\n```\nThis will create a snapshot volume of `foobar` named `foobar_snapshot`. For thin snapshots, use the same command above but don't specify a size.\n```bash\ndocker volume create -d lvm --opt size=0.2G --opt keyfile=/root/key.bin --name crypt_vol\n```\nThis will create a LUKS encrypted lvm volume named `crypt_vol` with the contents of `/root/key.bin` as a binary passphrase. Snapshots of encrypted volumes use the same key file. The key file must be present when the volume is created, and when it is mounted to a container.\n\n## Volume List\nUse `docker volume ls --help` for more information.\n\n``` bash\n$ docker volume ls\n```\nThis will list volumes created by all docker drivers including the default driver (local).\n\n## Volume Inspect\nUse `docker volume inspect --help` for more information.\n\n``` bash\n$ docker volume inspect foobar\n```\nThis will inspect `foobar` and return a JSON.\n```bash\n[\n    {\n        \"Driver\": \"lvm\",\n        \"Labels\": {},\n        \"Mountpoint\": \"/var/lib/docker-lvm-plugin/foobar\",\n        \"Name\": \"foobar\",\n        \"Options\": {\n            \"size\": \"0.2G\"\n        },\n        \"Scope\": \"local\"\n    }\n]\n```\n\n## Volume Removal\nUse `docker volume rm --help` for more information.\n```bash\n$ docker volume rm foobar\n```\nThis will remove lvm volume `foobar`.\n\n## Bind Mount lvm volume inside the container\n\n```bash\n$ docker run -it -v foobar:/home fedora /bin/bash\n```\nThis will bind mount the logical volume `foobar` into the home directory of the container.\n\n## Tests\n```\nsudo make test\n```\n**NOTE**: These are destructive tests and can leave the system in a changed state.\u003cbr/\u003e\nIt is highly recommended to run these tests either as part of a CI/CD system or on\na immutable infrastructure e.g VMs.\n\n## Currently supported environments.\nFedora, RHEL, Centos, Ubuntu (\u003e= 16.04)\n\n## License\nGNU GPL\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcontainers%2Fdocker-lvm-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcontainers%2Fdocker-lvm-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcontainers%2Fdocker-lvm-plugin/lists"}