How do I mount a zvol in shell so that it's browseable?

cdmead

Cadet
Joined
Feb 16, 2020
Messages
3
Hi all,
I'm a FreeNAS and ZFS newbie so pardon any ignorant questions.

I've been using FreeNAS as a Media library and it's worked great. I've set up a dataset and zvol, which is shared via iscsi to my media server.
I'm now trying to set up an rclone encrypted backup to google drive. I've got the crypt setup done, and the connection to google drive.

I'm just trying to get the zvol mountable so i can rclone the data up via cron job. When I mount the zvol, I can't browse it. I tried setting canmount to 'yes' but it doesn't seem that I can, and i'm not sure where to go from here.

Can someone suggest where i'm going wrong?
Thanks!
 

Heracles

Wizard
Joined
Feb 2, 2018
Messages
1,401
Hi cdmead,

A zvol is not a file system. As such, you can not mount it and read the file written in it. The reason is simply because there are no files written in the zvol itself.

A zvol is more like a raw hard drive. After you created the zvol itself, it is mounted a first time by an external entity as a hard drive. Here, it is presented over iSCSI to your server. Once that raw hard drive is mounted, the external server will format it with its own file system, like VMFS for an ESXi storage. After it is formatted, there is a second mount of that file system and it is in that second mount that the files ares.

So you can not a single mount of a zvol and access the files.

To backup a zvol, one thing you can do is a zfs send / receive to another zfs system. That one does not need to understand the content of the raw drive that a zvol is and will just copy everything as is.
 

Adrian

Contributor
Joined
Jun 29, 2011
Messages
166
An admirably instructive signature!
 

cdmead

Cadet
Joined
Feb 16, 2020
Messages
3
Hi cdmead,

A zvol is not a file system. As such, you can not mount it and read the file written in it. The reason is simply because there are no files written in the zvol itself.

A zvol is more like a raw hard drive. After you created the zvol itself, it is mounted a first time by an external entity as a hard drive. Here, it is presented over iSCSI to your server. Once that raw hard drive is mounted, the external server will format it with its own file system, like VMFS for an ESXi storage. After it is formatted, there is a second mount of that file system and it is in that second mount that the files ares.

So you can not a single mount of a zvol and access the files.

To backup a zvol, one thing you can do is a zfs send / receive to another zfs system. That one does not need to understand the content of the raw drive that a zvol is and will just copy everything as is.

Ah. Well....s***. That would explain it. So if i wanted to rclone this to google drive it would have been better if i'd set it up as a dataset?
 

cdmead

Cadet
Joined
Feb 16, 2020
Messages
3
or should i just rclone it from the OS that's got the zvol mounted as a filesystem?
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
Top