How do I stop ZFS automounting a snapshot dataset after reboot ?

peter247

Member
Dec 31, 2021
63
6
13
63
Hi , I have just starting learning to do ZFS right and from have all my file in a pool I've started to build datasets , media , backups , old_backups , temp , etc.
All my dataset have been copied via ZFS send , receive to a backup hard drive .
I just want to store the snapshots on the drive without it automounting , but every time I reboot it remounts then , is there a way to stop selected dataset from automounting ?
 
Maybe "zfs set canmount=noauto SomePool/SomeDataset"?: https://openzfs.github.io/openzfs-docs/man/master/7/zfsprops.7.html#canmount
canmount=on|off|noauto

If this property is set to off, the file system cannot be mounted, and is ignored by zfs mount -a. Setting this property to off is similar to setting the mountpoint property to none, except that the dataset still has a normal mountpoint property, which can be inherited. Setting this property to off allows datasets to be used solely as a mechanism to inherit properties. One example of setting canmount=off is to have two datasets with the same mountpoint, so that the children of both datasets appear in the same directory, but might have different inherited characteristics.
When set to noauto, a dataset can only be mounted and unmounted explicitly. The dataset is not mounted automatically when the dataset is created or imported, nor is it mounted by the zfs mount -a command or unmounted by the zfs unmount -a command.

This property is not inherited.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!