mirror of
https://github.com/kopia/kopia.git
synced 2026-01-30 17:23:18 -05:00
docs(site): Add LVM example for actions (#3286)
* Add LVM example for actions * Fix wording of LVM example
This commit is contained in:
@@ -141,6 +141,38 @@ rmdir /mnt/$KOPIA_SNAPSHOT_ID
|
||||
zfs destroy $ZPOOL_NAME@$KOPIA_SNAPSHOT_ID
|
||||
```
|
||||
|
||||
### LVM Snapshots:
|
||||
|
||||
When snapshotting filesystems using LVM snapshots, we must first create a LVM snapshot using `lvcreate` and mount the filesystem inside the LVM snapshot somewhere.
|
||||
Then we tell `kopia` to snapshot the mounted directory instead of the current one.
|
||||
Make sure to match the snapshot size with your requirements. The snapshot grows with the delta to the origin logical volume.
|
||||
You also need to make sure to have enough free space in your volume group, otherwise the snapshot creation will fail.
|
||||
|
||||
After snapshotting, we need to unmount and remove the temporary logical volume using `lvremove` command:
|
||||
|
||||
Before:
|
||||
|
||||
```shell
|
||||
#!/bin/sh
|
||||
set -e
|
||||
VG_NAME=vg0
|
||||
LV_NAME=lv-root
|
||||
SNAPSHOT_SIZE=10G
|
||||
lvcreate -L ${SNAPSHOT_SIZE} -s -n $KOPIA_SNAPSHOT_ID $VG_NAME/$LV_NAME
|
||||
mkdir -p /mnt/$KOPIA_SNAPSHOT_ID
|
||||
mount /dev/$VG_NAME/$KOPIA_SNAPSHOT_ID /mnt/$KOPIA_SNAPSHOT_ID
|
||||
echo KOPIA_SNAPSHOT_PATH=/mnt/$KOPIA_SNAPSHOT_ID
|
||||
```
|
||||
|
||||
After:
|
||||
|
||||
```shell
|
||||
#!/bin/sh
|
||||
VG_NAME=vg0
|
||||
umount /mnt/$KOPIA_SNAPSHOT_ID
|
||||
rmdir /mnt/$KOPIA_SNAPSHOT_ID
|
||||
lvremove -f $VG_NAME/$KOPIA_SNAPSHOT_ID
|
||||
```
|
||||
|
||||
### Windows shadow copy
|
||||
|
||||
|
||||
Reference in New Issue
Block a user