... | ... | @@ -214,3 +214,48 @@ critical. |
|
|
cryptsetup resize DEVICE_LABEL
|
|
|
|
|
|
WARNING: this last step has not been tested.
|
|
|
|
|
|
# Creating
|
|
|
|
|
|
## New logical volume with bind mount
|
|
|
|
|
|
Assuming a situation where the root LV is full and want to add a new
|
|
|
volume and move part of the existing filesystem in it. We also assume
|
|
|
that we have available free space in the existing volume group.
|
|
|
|
|
|
Create the new LV, we'll call it `srv` since it will be mounted at
|
|
|
`/srv`:
|
|
|
|
|
|
lvcreate -n srv -l50G vg_ganeti
|
|
|
mkfs.ext4 -m0 /dev/vg_ganeti/srv
|
|
|
|
|
|
Mount the new volume at a temporary location:
|
|
|
|
|
|
mkdir /mnt/srv
|
|
|
mount /dev/vg_ganeti/srv /mnt/srv
|
|
|
|
|
|
Then stop any services that might be using the data that we're about
|
|
|
to move to its new home:
|
|
|
|
|
|
systemctl stop gitlab-runner docker
|
|
|
|
|
|
Move data around, recreate mount point and unmount the temp location:
|
|
|
|
|
|
mv /var/lib/docker /mnt/srv
|
|
|
mkdir /var/lib/docker
|
|
|
umount /mnt/srv
|
|
|
|
|
|
Adjust `/etc/fstab`:
|
|
|
|
|
|
echo "UUID=$(blkid /dev/vg_ganeti/srv -o value -s UUID) /srv ext4 defaults 1 2" >> /etc/fstab
|
|
|
echo "/srv/docker /var/lib/docker none bind 0 0" >> /etc/fstab
|
|
|
|
|
|
Reload systemd and local-fs.target to regenerate .mount services:
|
|
|
|
|
|
systemctl daemon-reload
|
|
|
systemctl reload local-fs.target
|
|
|
|
|
|
Verify that the new volume is mounted correctly and restart services:
|
|
|
|
|
|
findmnt
|
|
|
systemctl start docker gitlab-runner |