Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
tips:zfs [2017/11/21 09:58] – [libvirt] scipio | tips:zfs [2023/01/18 11:22] (current) – sscipioni | ||
---|---|---|---|
Line 36: | Line 36: | ||
zpool create lxd /dev/sda4 | zpool create lxd /dev/sda4 | ||
</ | </ | ||
+ | |||
+ | ===== docker ===== | ||
+ | |||
+ | < | ||
+ | systemctl stop docker | ||
+ | rm -fR / | ||
+ | zfs create -o mountpoint=/ | ||
+ | zfs create -o mountpoint=/ | ||
+ | systemctl start docker | ||
+ | </ | ||
+ | |||
+ | / | ||
+ | < | ||
+ | { | ||
+ | " | ||
+ | [ | ||
+ | {" | ||
+ | ], | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | } | ||
+ | |||
+ | </ | ||
+ | |||
+ | |||
===== libvirt ===== | ===== libvirt ===== | ||
Line 41: | Line 68: | ||
add ZFS pool to libvirt | add ZFS pool to libvirt | ||
< | < | ||
+ | # in bionic | ||
+ | apt install libvirt-daemon-driver-storage-zfs && systemctl restart libvirtd | ||
+ | |||
# create zfs filesystem | # create zfs filesystem | ||
- | #zfs create rpool/ | + | zfs create rpool/ |
- | virsh pool-define-as --name zfspool --source-name rpool --type zfs | + | virsh pool-define-as --name zfspool --source-name rpool/ |
virsh pool-start zfspool | virsh pool-start zfspool | ||
virsh pool-autostart zfspool | virsh pool-autostart zfspool | ||
Line 57: | Line 87: | ||
< | < | ||
virsh vol-delete --pool zfspool maas2 | virsh vol-delete --pool zfspool maas2 | ||
+ | </ | ||
+ | |||
+ | add volume to instance | ||
+ | |||
+ | create file mydevice.xml | ||
+ | < | ||
+ | <disk type=' | ||
+ | <driver name=' | ||
+ | <source dev='/ | ||
+ | <target dev=' | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | add volume | ||
+ | < | ||
+ | virsh attach-device --config juju-controller mydevice.xml | ||
</ | </ | ||
Line 168: | Line 214: | ||
- | ===> CRYPTOLOCKER grows SNAP | + | ------> CRYPTOLOCKER grows SNAP |
check crypto locker every day | check crypto locker every day | ||
Line 181: | Line 227: | ||
fi | fi | ||
</ | </ | ||
+ | |||
+ | ===== swap ===== | ||
+ | |||
+ | < | ||
+ | zfs create -V 4G -b $(getconf PAGESIZE) -o compression=zle \ | ||
+ | -o logbias=throughput -o sync=always \ | ||
+ | -o primarycache=metadata -o secondarycache=none \ | ||
+ | -o com.sun: | ||
+ | |||
+ | mkswap -f / | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | echo / | ||
+ | swapon -av | ||
+ | </ | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ |