Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFE] docs for lvm support #700

Open
lizelive opened this issue Apr 1, 2022 · 2 comments · May be fixed by flatcar-archive/flatcar-docs#315
Open

[RFE] docs for lvm support #700

lizelive opened this issue Apr 1, 2022 · 2 comments · May be fixed by flatcar-archive/flatcar-docs#315

Comments

@lizelive
Copy link

lizelive commented Apr 1, 2022

Current situation

i want to use lvm to setup caching

Impact

improve filesytem performance

Ideal future situation

be able to enable lvm by enabling some systemd service

i think
systemctl start lvm2-monitor.service
works but idk much about lvm

@lizelive lizelive added the kind/feature A feature request label Apr 1, 2022
@pothos
Copy link
Member

pothos commented Apr 1, 2022

You can create the LVM setup with pvcreate, vgcreate, lvcreate, and lvconvert as usual.

Here is some copy paste snippet:

Setting up the LVM cache

First, we create physical volumes for our devices, and check that it worked
correctly:

sudo pvcreate ${VOLUME} ${DEVA} ${DEVB}
sudo pvs

Then, we create a volume group with our three physical devices. In that volume
group, we create three logical volumes: one for the data, another for the cache
and the last one for the cache's metadata. Then we check that everything worked
as expected.

sudo vgcreate cache-layer-vg ${VOLUME} ${DEVA} ${DEVB}
sudo lvcreate -l 100%FREE -n data cache-layer-vg ${VOLUME}
sudo lvcreate -L 700G -n cachedisk cache-layer-vg
sudo lvcreate -L 16G -n metadisk cache-layer-vg
sudo lvs

Now we need to turn those logical volumes into the actual cache. First we
attach the metadata to the cache and then the cache to the data.

sudo lvconvert --type=cache-pool /dev/cache-layer-vg/cachedisk --poolmetadata  /dev/cache-layer-vg/metadisk
sudo lvconvert --type cache /dev/cache-layer-vg/data --cachepool /dev/cache-layer-vg/cachedisk
sudo lvs

With that, we've set up the data volume to be cached with our SSD disks. We can
now format it and mount it:

sudo mkfs.ext4 /dev/cache-layer-vg/data
sudo mkdir /var/www
sudo mount /dev/cache-layer-vg/data /var/www

Would be nice to have a docs PR.

@pothos pothos added kind/docs and removed kind/feature A feature request labels Apr 1, 2022
@dongsupark dongsupark changed the title [RFE] lvm support [RFE] docs for lvm support Jul 8, 2022
@tormath1 tormath1 linked a pull request Sep 8, 2023 that will close this issue
@tormath1
Copy link
Contributor

tormath1 commented Sep 8, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging a pull request may close this issue.

3 participants