建立zpool disk

zpool list

NAME                USED  AVAIL     REFER  MOUNTPOINT
local-raidz2-pve3  1.12G  10.2T     1.12G  /local-raidz2-pve3
zfs                2.59M   225G       96K  /zfs

zfs create -V 1T local-raidz2-pve3/learn

zfs list
NAME                      USED  AVAIL     REFER  MOUNTPOINT
local-raidz2-pve3        1.03T  9.21T     1.12G  /local-raidz2-pve3
local-raidz2-pve3/learn  1.03T  10.2T     81.4K  -
zfs                      2.59M   225G       96K  /zfs

磁碟位置 /dev/zvol/local-raidz2-pve3/learn

ls -lh /dev/zvol/local-raidz2-pve3/learn
lrwxrwxrwx 1 root root 9 Dec 25 11:00 /dev/zvol/local-raidz2-pve3/learn -> ../../zd0

格式化

mkfs.btrfs /dev/zvol/local-raidz2-pve3/learn
 zfs create zfs/disk -o mountpoint=/mnt/disk
 zfs set quota=5G zfs/disk
 cd /mnt/disk
 touch file{1..100}
 cd
 zfs snapshot zfs/disk@snap1
 cd /mnt/disk
 rm -f *
 cd
 zfs rollback zfs/disk@snap1
 zfs destroy zfs/disk@snap1
 umount /mn/disk
 zfs destroy zfs/disk
 zfs list

zfs get mountpoint

zfs set mountpoint

zfs mount -a

https://docs.oracle.com/cd/E19253-01/819-5461/gaztn/index.html

Last updated