-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathzfs-work-commands.sh
30 lines (21 loc) · 1019 Bytes
/
zfs-work-commands.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# zfs create pool
zpool create rpool
# zfs destoy pool
zpool destoy rpool
# zfs create mount point
zfs create -o mountpoint=/srv /rpool/srv
# zfs create new volume src, it will create new volume in path /srv/src
zfs create rpool/srv/src
# if you need delete volume
zfs destoy rpool/srv/src
#if your volume has sub volumes, delete it recursive
zfs destory -r rpool/srv/src
# create new snapshot of volume
zfs snapshot rpool/srv/src@any-text-or-int-for-identification-snapshot
# create new snapshot of volume and sub volumes (recursive)
zfs snapshot rpool/srv/src@any-text-or-int-for-identification-snapshot -r
# move zfs sub volumes from one parent volume to other, with all him snapsjots if its exist
zfs rename rpool/srv/db/subvolume rpool/srv/old/db/subvolume
# send volume from one node to two node via ssh. Note: this command runing on target node and with "pv" utility
# for display progress bar of operation
ssh sourcenode zfs send -v rpool/srv/db/somevolume | pv | zfs recv -Fv rpool/srv/db/somevolume