Cannot use/mount ZVOL

leonardorame

Contributor
Joined
Jun 30, 2018
Messages
106
Hi, I have a replicated FreeNas server containing many datasets and one of them is an zvol that is shown on Storage->Pools, but if I go to the console an do an ls -lah I cannot see it, but I can see all the other datasets.

The next image shows the zvol:

1562279003635.png


But if I go to the console the directory /mnt/datos/vms does not contain anything:

Code:
[leonardo@freenas ~/replica]$ ls -lah
total 11
drwxr-xr-x  5 root  wheel     5B Jul  4 18:41 .
drwxr-xr-x  4 root  wheel     4B May 23 20:01 ..
drwxr-xr-x  3 root  wheel     3B Dec 29  2018 bd
drwxrwxrwx  8 root  wheel     8B Apr 26 16:49 imagenes
drwxr-xr-x  2 root  wheel     2B Dec 28  2018 vms
[leonardo@freenas ~/replica]$ ls -lah vms
total 1
drwxr-xr-x  2 root  wheel     2B Dec 28  2018 .
drwxr-xr-x  5 root  wheel     5B Jul  4 18:41 ..


How can I access that directory?
 

leonardorame

Contributor
Joined
Jun 30, 2018
Messages
106
I found the zvol is in /dev/zvol/datos/replica/vms/UbuntuServer-tcnffc, now how can I mount it?. It is the primary disk of an Ubuntu Virtual Machine.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
If it's not a ZFS filesystem, the official position is that you can't. (even if it were, that's not really how you should use a zvol)

Zvols are block storage and as far as the FreeNAS server is concerned, its job is to ensure that those blocks are kept in a consistent state and can be shared/served over iSCSI or direct block access by VMs.

You may be able to use the fuse filesystems pre-installed in FreeNAS, but you won't find help in the docs for that. The best/recommended way to mount the content is over iSCSI or with a VM.
 

leonardorame

Contributor
Joined
Jun 30, 2018
Messages
106
Thanks @sretalla, it makes sense, because this zvol was replicated from the main server, and is the disk of a virtual machine.

Now, I created a virtual machine (right from the FreeNas GUI) with exactly the same parameters as of the one running on the main server, assigned that zvol as the only hard disk, but it can't boot, the error is this:

Code:
error: failure writing sector 0x394a800 to `hd0`
Press any key to continue...


Can anyone help me with this?
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
Replicas are marked as read only by default, you may want to look at the properties and see if that's the case... you can probably fix it by marking it as writable.
 

leonardorame

Contributor
Joined
Jun 30, 2018
Messages
106
You are right, it is maked as Read Only.

Later today I'll change this and try to start the vm.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
If you keep the replication job running, you may have some unpleasant results on the replica if you run the VM on both ends.
 

leonardorame

Contributor
Joined
Jun 30, 2018
Messages
106
Yes, I know that, that's why I'll wait to this afternoon, stop the replica then run the VM without the nic connected.
 
Top