zvol and zfs send no file on the receiving side.

Johan Hendriks joh.hendriks at gmail.com
Sat Nov 26 07:26:26 UTC 2011


Hello all!

After some reluctance using zfs i decided it was time to just use it, 
and it make my life a lot easier.
Thank you all !

One thing i can not get to work however is sending and receiving a zfs 
volume.

I have a master so to say, and a bacup server.
On the master the pool is named storage, on the backup machine the pool 
is called tank.

on the master i did the following.

# zfs create -V10G storage/iscsitest

if i do a zfs list -t volume, i see that the volume is there.

# zfs list -t volume
NAME                       USED  AVAIL  REFER  MOUNTPOINT
storage/iscsitest         10.3G  65.9G    16K  -

If i go to the directory /storage and do a ls -al
i see my zvol file.

# ls -al
total 1901416
drwxr-xr-x   4 root  wheel            5 Nov 25 17:44 .
drwxr-xr-x  19 root  wheel         1024 Nov 25 11:33 ..
-rw-r--r--   1 root  wheel  10737418240 Nov 25 20:46 iscsitest

Ok all is fine, i can create a scsi target pointing to 
storage/iscsitest, and it works, and i use a esxi host to mount it.
I did put a virtual machine on it so i have some data in the zvol.
Works great.

Now i want to make a backup of that zvol so i can create a kind of cold 
standby server.
This way when the master dies for what ever reason, my zvols are on 
another server as a backup,
but if things really get troublesome i can share them as iscsi target!

So on the master i create a snapshot of my zvol.

#zfs snapshot storage/iscsitest at snap1

Check with zfs list -t snapshot to see if i have a snapshot.

#zfs list -t snapshot
NAME                      USED  AVAIL  REFER  MOUNTPOINT
storage/iscsitest at snap1      0      -    16K  -

Well there it is.

now i send that zvol to my backup server.
So the following command should do it.

# zfs send -R storage/iscsitest at snap1 | ssh root at 192.168.50.200 zfs recv 
-v tank/iscsitest
Password: mypasss
receiving full stream of storage/iscsitest at snap1 into tank/iscsitest at snap1
received 3.85KB stream in 1 seconds (3.85KB/sec)

on my backup server, i now have the following

#zfs list
NAME             USED  AVAIL  REFER  MOUNTPOINT
tank             159G   427G    31K  /tank
tank/iscsitest  10.3G   438G    16K  -
tank/share       149G   427G   136G  /mnt

Ok that looks fine, lets see if i have some snapshots here.

#zfs list -t snapshot
NAME                    USED  AVAIL  REFER  MOUNTPOINT
tank/iscsitest at snap1       0      -    16K  -

Ok that looks good.
Let see if there is a volume

# zfs list -t volume
NAME             USED  AVAIL  REFER  MOUNTPOINT
tank/iscsitest  10.3G   438G    16K  -

Well all looks good, now lets look at the file so i can share this over 
iscsi.

cd /tank
#ls -al
total 4
drwxr-xr-x   2 root  wheel    2 Nov 25 21:45 ./
drwxr-xr-x  22 root  wheel  512 Nov 25 21:54 ../

Where is my file???
I am trying to get this done for a long time now, and i can not get it 
to work!!
i did do a export / import, but no file!
Also tried doing a rollback on the backup server.


Also a local backup does not work.

# zfs send -R storage/iscsitest at snap1 | zfs recv -v storage/iscsitest-bck
receiving full stream of storage/iscsitest at snap1 into 
storage/iscsitest-bck at snap1
received 3.85KB stream in 1 seconds (3.85KB/sec)

# zfs list
NAME                       USED  AVAIL  REFER  MOUNTPOINT
storage                    411G  45.3G  1.81G  /storage
storage/iscsitest         10.3G  55.6G    16K  -
storage/iscsitest-bck     10.3G  55.6G    16K  -

# zfs list -t volume
NAME                       USED  AVAIL  REFER  MOUNTPOINT
storage/iscsitest         10.3G  55.6G    16K  -
storage/iscsitest-bck     10.3G  55.6G    16K  -

# zfs list
NAME                       USED  AVAIL  REFER  MOUNTPOINT
storage/iscsitest         10.3G  55.6G    16K  -
storage/iscsitest-bck     10.3G  55.6G    16K  -

# ls -al
total 1901416
drwxr-xr-x   4 root  wheel            5 Nov 25 17:44 .
drwxr-xr-x  19 root  wheel         1024 Nov 25 11:33 ..
-rw-r--r--   1 root  wheel  10737418240 Nov 25 20:46 iscsitest

So again no file iscsitest-bck

What am i missing.!

This is on FreeBSD 9.0 RC2 AMD64

Thanks again for the wonderful work on ZFS.
regards
Johan


More information about the freebsd-fs mailing list