5. lxc 上應用 zfs

 

 

 


lxc 上應用 zfs

 

Prepare Disk

  1. lsblk
  2. parted /dev/sdb mklabel msdos
  3. parted /dev/sdb mkpart pri 0% 100%
  4. blkid /dev/sdb1

ZFS

  1. dnf install epel-release -y
  2. dnf install https://zfsonlinux.org/epel/zfs-release.el8_5.noarch.rpm -y
  3. rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-zfsonlinux
  4. dnf install kernel-devel zfs -y
  5. echo zfs > /etc/modules-load.d/zfs.conf
  6. echo "options zfs zfs_arc_max=104857600" > /etc/modprobe.d/zfs.conf
  7. /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/

 

Creative Commons license icon Creative Commons license icon