lxc 上應用 zfs
Prepare Disk
- lsblk
- parted /dev/sdb mklabel msdos
- parted /dev/sdb mkpart pri 0% 100%
- blkid /dev/sdb1
ZFS
- dnf install epel-release -y
- dnf install https://zfsonlinux.org/epel/zfs-release.el8_5.noarch.rpm -y
- rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-zfsonlinux
- dnf install kernel-devel zfs -y
- echo zfs > /etc/modules-load.d/zfs.conf
- echo "options zfs zfs_arc_max=104857600" > /etc/modprobe.d/zfs.conf
- /sbin/modprobe zfs
LXC
1. rmdir /var/lib/lxc; ln -s /var/lib/lxc /lxc
2. zpool create lxc /dev/sdb1
3. zfs set relatime=on lxc
4. zfs set xattr=off lxc
5. # New Vol For VPS
zfs create lxc/r8
zfs set refquota=10g lxc/r8
zfs list
NAME USED AVAIL REFER MOUNTPOINT lxc 624K 38.3G 96K /lxc lxc/r8 96K 10.0G 96K /lxc/r8
6. tar --numeric-owner --strip-components=1 -Jxf r8.txz -C /lxc/r8/