Problem/Justification
When running a windows VM, we occasionally need to restore a file from a previous snapshot. When the -t ntfs option was available, we would simply clone the zvol, mount it, and pluck out the file that we needed. Now that the option has been removed, we need to use an additional VM in order to mount the zvol in order to fetch the file. This breaks the ability to automate audits, quickly restore files, etc. Allowing the use of “mount -t ntfs” would return our ability to automate audits, and to quickly restore single files.
Impact
With the ability restored, we would be able to very quickly restore single files from zvols that are housing ntfs filesystems. There would be no negative impact, as users wouldn’t be able to accidentally stumble on this. A user that is manually running the “mount” command would already be aware of any implications.
User Story 1
A file is accidentally deleted from a windows VM. An administrator is notified and clones the snapshot from the desired timeframe. The administrator then uses the “-t ntfs” option to mount the zvol. They copy the file out that they need. After, they unmount the zvol, then destroy the clone.
User Story 2
A series of VMs are all using zvols. These zvols are replicated elsewhere. An administrator wants to automate mounting, reading a random file, and then unmounting the zvol. This would be done to ensure that the replication is working properly as part of a data resiliency strategy implemented at the organization. Using the “-t ntfs” option for the mount command, they are able to have their script do a full audit from start to finish.
root@truenas[/tmp]# file -s /dev/zvol/data/nvme_backup/VM/workbox_new-e54uf
/dev/zvol/data/nvme_backup/VM/workbox_new-e54uf: symbolic link to ../../../../zd432
root@truenas[/tmp]#
root@truenas[/tmp]# fdisk -l /dev/zd432
Disk /dev/zd432: 100 GiB, 107374182400 bytes, 209715200 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 16384 bytes
I/O size (minimum/optimal): 16384 bytes / 33554432 bytes
Disklabel type: gpt
Disk identifier: 2B57F1FD-3340-4FB4-A290-A8807F32FA26
Device Start End Sectors Size Type
/dev/zd432p1 2048 206847 204800 100M EFI System
/dev/zd432p2 206848 239615 32768 16M Microsoft reserved
/dev/zd432p3 239616 208651887 208412272 99.4G Microsoft basic data
/dev/zd432p4 208652288 209711103 1058816 517M Windows recovery environment
So, I want 239616 * 512 (starting sector multiplied by the 512 byte sector-size) to get the data partition.
I’m hoping it’s included in the next release, that would be lovely. Also, your commands are great, but if you are already root (#) you don’t need to preface your command with sudo.
As an aside, the same method works with using raw disks (which is where I started using this approach years ago, before FreeNAS could virtualize anything.)
Anyways, you give me hope that it will be available in Fangtooth. Thank you!