Monitor send/receive progress with pv (accessing pool inside jail)

asmodeus

Explorer
Joined
Jul 26, 2016
Messages
70
Hello,

I am in the process of setting up a backup NAS for my 9.10U6. I like to monitor the progress of zfs send/receive commands with pv, as well as speed them up with mbuffer. Since we are not supposed to install anything in the FreeNAS root, I put pv and mbuffer in a separate jail. But how would I be able to access my entire pool and run a command like this in that jail?

zfs send -I tank/@manual | mbuffer -q -s 128k -m 1G | pv -b | nc NEWBOX 8000

I have tried providing my /mnt/tank as a mount point to the jail but that didn't work - it's not recursive and mounted as an empty dir. Also considered jexec for the mbuffer and pv parts but that does not work as IO redirection is on the shell level.

I then stumbled over warden flags such as enforce_statfs=0,allow.mount=1,allow.mount.zfs=1 but I am a bit unclear on usage and implications.
Has anyone done something like this before?

Thank you,
Achim
 

Mlovelace

Guru
Joined
Aug 19, 2014
Messages
1,111
Hello,

I am in the process of setting up a backup NAS for my 9.10U6. I like to monitor the progress of zfs send/receive commands with pv, as well as speed them up with mbuffer. Since we are not supposed to install anything in the FreeNAS root, I put pv and mbuffer in a separate jail. But how would I be able to access my entire pool and run a command like this in that jail?

zfs send -I tank/@manual | mbuffer -q -s 128k -m 1G | pv -b | nc NEWBOX 8000

I have tried providing my /mnt/tank as a mount point to the jail but that didn't work - it's not recursive and mounted as an empty dir. Also considered jexec for the mbuffer and pv parts but that does not work as IO redirection is on the shell level.

I then stumbled over warden flags such as enforce_statfs=0,allow.mount=1,allow.mount.zfs=1 but I am a bit unclear on usage and implications.
Has anyone done something like this before?

Thank you,
Achim
pv and mbuffer are in freeNAS, there is no need to run the command string from a jail.
 

asmodeus

Explorer
Joined
Jul 26, 2016
Messages
70
pv and mbuffer are in freeNAS, there is no need to run the command string from a jail.

Maybe they were added in a newer version? I do not have them on my 9.10U6 box:

[root@freenas ~]# which mbuffer
[root@freenas ~]# which pv
[root@freenas ~]#
 

Mlovelace

Guru
Joined
Aug 19, 2014
Messages
1,111
Maybe they were added in a newer version? I do not have them on my 9.10U6 box:

[root@freenas ~]# which mbuffer
[root@freenas ~]# which pv
[root@freenas ~]#
Interesting, it appears mbuffer was added to 11.1 and pipe viewer to 11.0, freeNAS was using dd to buffer zfs send/receive. I think I would sooner install mbuffer and pv into the freeNAS root then try recursively snapshotting/sending my pool from a jail. You can alway roll back a borked freeNAS install from it's snapshot.
 

asmodeus

Explorer
Joined
Jul 26, 2016
Messages
70
Thank you, great idea! I ended up just adding the packages. I know it's not recommended to modify FreeNAS ROOT, but here's what did the trick:

edit /usr/local/etc/pkg/repos/FreeBSD.conf, set enabled to yes.
pkg update
pkg lock pkg
pkg install pv mbuffer
 
Top