Unable to mount ZVOL

Status
Not open for further replies.

extera

Cadet
Joined
Apr 19, 2013
Messages
8
I have created a ZVOL that I want to use as an iSCSI extend for my ESX server.
I would also like to mount this ZVOL (read-only) so I can browse the ZVOL.

Untill now I have only created the ZVOL and tried to mount it.

ZVOL "iSCSI" shows up in /dev/zvol/SAN/

Code:
[root@claustofobia] ~# cd /dev/zvol/SAN/
[root@claustofobia] /dev/zvol/SAN# ls
./      ../     iSCSI


Created dir /tmp/test
Code:
[root@claustofobia] /tmp# ls -lah
drwxr-xr-x   2 root  wheel   512B Sep  1 11:08 test/


Trying to mount this read-only:

Code:
[root@claustofobia] /tmp/test# mount -r /dev/zvol/SAN/iSCSI /tmp/test/
mount: /dev/zvol/SAN/iSCSI: No such file or directory


I have tried a new install in a VM. (9.1.2.7)

Created a ZVOL, created manual snapshot and cloned the snapshot.
Still i can't mount it.

Code:
[root@freenas] /dev/zvol/SAN# mount -r /dev/zvol/SAN/iSCSI-clone-manual-20140901 /mnt/SAN/iSCSI/
mount: /dev/zvol/SAN/iSCSI-clone-manual-20140901: No such file or directory
[root@freenas] /dev/zvol/SAN# 
[root@freenas] /dev/zvol/SAN# ls
./                              iSCSI-clone-manual-20140901
../                             iSCSI@manual-20140901
iSCSI
[root@freenas] /dev/zvol/SAN# 


What am I doing wrong?

In my final setup I would like to snapshot and replicate the ZVOL to a seperate pool (single 4TB disk).
I want to mount the replicated ZVOL on the backup pool, and be able to access this over NFS so i can easily restore VM's.
 
Last edited:

extera

Cadet
Joined
Apr 19, 2013
Messages
8
I have tried this under ZFSguru ( FreeBSD 10.0-STABLE)
This works without a problem

Code:
[root@zfsguru /home/ssh]# zfs create -V 100M tank/test
newfs /dev/zvol/tank/test[root@zfsguru /home/ssh]# newfs /dev/zvol/tank/test
/dev/zvol/tank/test: 100.0MB (204800 sectors) block size 32768, fragment size 4096
        using 4 cylinder groups of 25.03MB, 801 blks, 3328 inodes.
super-block backups (for fsck_ffs -b #) at:
192, 51456, 102720, 153984
[root@zfsguru /home/ssh]# mkdir /tmp/test
[root@zfsguru /tmp]# mount -r /dev/zvol/tank/test /tmp/test
[root@zfsguru /tmp]# df -h

Filesystem                          Size    Used   Avail Capacity  Mounted on
/dev/zvol/tank/test                  96M    8.0K     89M     0%    /tmp/test


Could this be because ZFSguru uses FreeBSD 10 instead of 9.2?

//edit: NOPE

tested in a vm running FreeNAS 10 Alpha. No succes

Code:
[root@freenas] /dev/zvol/SAN# mount /dev/zvol/SAN/iSCSI /tmp/test/
mount: /dev/zvol/SAN/iSCSI: No such file or directory
[root@freenas] /dev/zvol/SAN# 
 
Last edited:

mav@

iXsystems
iXsystems
Joined
Sep 29, 2011
Messages
1,428
This is because since 9.2.1.7 FreeNAS started to use ZVOLs in new "dev" mode. It completely bypassed GEOM. It improves performance and security, but makes mounting within storage impossible. It should be possible to revert it by setting tunable vfs.zfs.vol.mode to 0 (default) or 1 (geom).
 

extera

Cadet
Joined
Apr 19, 2013
Messages
8
thank you for your anwser!

I just tried this, but when i set this tunable, /zvol disapears from /dev/ ?

I'm also running 9.2.1.6 on my 'production' storage server. Can't mount on this server as well.

tunable off:
Code:
[root@freenas] /# cd /dev
[root@freenas] /dev# ls -lah | grep zvol
dr-xr-xr-x   3 root  wheel      512B Sep  3 13:55 zvol/
[root@freenas] /dev# 


tunable on:
Code:
[root@freenas] ~# cd /dev
[root@freenas] /dev# ls -lah | grep zvol
[root@freenas] /dev#
 
Last edited:

mav@

iXsystems
iXsystems
Joined
Sep 29, 2011
Messages
1,428
Hmm. That should not happen. Have you tried both 0 and 1 values?
 

mav@

iXsystems
iXsystems
Joined
Sep 29, 2011
Messages
1,428
Ah, sorry, mode=0 in tunables does not work as I expected. You should set it to 1.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
You know the default in 9.2.1.7 is vfs.zfs.vol.mode=2? LOL
 

mav@

iXsystems
iXsystems
Joined
Sep 29, 2011
Messages
1,428
Yes, I know that default is 2. That is why behavior changed, making mounting is impossible.
 

extera

Cadet
Joined
Apr 19, 2013
Messages
8
thanks a lot!
I works now!

Appears to be useless, I can't mount an VMFS formatted ZVOL.
mount -t vmfs /dev/zvol/SAN/VMware /var/mnt/ISCSI/ doenst work
mount: /dev/zvol/SAN/VMware: Operation not supported by device

I can mount it after running
newfs /dev/zvol/SAN/VMware
so mounting on itself is now working.
 
Status
Not open for further replies.
Top