ZFS clone is a clone from zfs filesystem whose intial contents are the same with the filesystem from which it was created. Clones can only be created from snapshot. Below is tips to create sanpshot from ZFS filesystem and then create clone.
- See ZFS file system on your host.bash-3.00# zfs listNAME USED AVAIL REFER MOUNTPOINTmirrpool 132K 976M 19K /mirrpoolmirrpool/fs1 18K 976M 18K /mirrpool/fs1
- See the content of your file system.bash-3.00# ls -al /mirrpool/fs1total 7drwxr-xr-x 2 root root 3 Nov 2 11:54 .drwxr-xr-x 3 root root 3 Nov 2 11:54 ..-rw-r--r-- 1 root root 0 Nov 2 11:54 data1
- Create a snapshot from your filesystem. In this example you create snapshot from mirrpool/fs1.bash-3.00# zfs snapshot mirrpool/fs1@todayNAME USED AVAIL REFER MOUNTPOINTmirrpool 133K 976M 19K /mirrpoolmirrpool/fs1 18K 976M 18K /mirrpool/fs1mirrpool/fs1@today 0 - 18K -
- See that your snapshot also contain same data with your original filesystem (step 2).bash-3.00# ls -al /mirrpool/fs1/.zfs/snapshot/todaytotal 4drwxr-xr-x 2 root root 3 Nov 2 11:54 .dr-xr-xr-x 3 root root 3 Nov 2 11:54 ..-rw-r--r-- 1 root root 0 Nov 2 11:54 data1
- Create clone from the snapshot. In this example you create a clone named mirrpool/fs2. Initial content of clone is same with the original file system.bash-3.00# ls -al /mirrpool/fs2total 7drwxr-xr-x 2 root root 3 Nov 2 11:54 .drwxr-xr-x 4 root root 4 Nov 2 13:44 ..-rw-r--r-- 1 root root 0 Nov 2 11:54 data1
- See that origin from the clone is the snapshot.bash-3.00# zfs get -r origin mirrpoolNAME PROPERTY VALUE SOURCEmirrpool origin - -mirrpool/fs1 origin - -mirrpool/fs1@today origin - -mirrpool/fs2 origin mirrpool/fs1@today -
No comments:
Post a Comment