Zfs: Inappropriate error with 'zfs diff' if filesystem is not mounted

Created on 20 Apr 2015  路  5Comments  路  Source: openzfs/zfs

Version: at least 0.6.4 affected

If you execute 'zfs diff' between 2 snapshots of a filesystem-dataset, but the dataset is not mounted, you get:

Cannot diff an unmounted snapshot: operation not applicable to datasets of this type

1) It does not matter/help if the snapshot(s) are mounted. It only matters whether the FS is mounted.
2) The operation is certainly applicable to datasets of this type.

After mounting the filesystem, 'zfs diff' operates correctly.

good first issue

Most helpful comment

Same on 0.8.3 .

# zfs create tank/test
# zfs get mountpoint tank/test
NAME       PROPERTY    VALUE       SOURCE
tank/test  mountpoint  none        inherited from tank
# zfs snapshot tank/test@1
# zfs snapshot tank/test@2
# zfs diff tank/test@1 tank/test@2
Cannot diff an unmounted snapshot: operation not applicable to datasets of this type

All 5 comments

Close as stale.

If it's actual - feel free to reopen.

Still present in 0.8.0-rc3. Getting exactly the same error under the same circumstances as in OP.

The same here.

Same on 0.8.3 .

# zfs create tank/test
# zfs get mountpoint tank/test
NAME       PROPERTY    VALUE       SOURCE
tank/test  mountpoint  none        inherited from tank
# zfs snapshot tank/test@1
# zfs snapshot tank/test@2
# zfs diff tank/test@1 tank/test@2
Cannot diff an unmounted snapshot: operation not applicable to datasets of this type

I just hit this with 0.8.4, and it was sufficiently confusing as to make me search for an explanation for that error message. I first tried mounting both snapshots, and that didn't solve the problem.

The error message is confusing, it should state that the operation would succeed if the dataset were mounted.

Was this page helpful?
0 / 5 - 0 ratings