Skip to content

Add -F (really, really force) to zfs destroy #18088

@pjv

Description

@pjv

I propose that a new -F option for zfs destroy that would Force destroying file systems, volumes, snapshots, or bookmarks regardless of whether the "dataset is busy" would be an excellent addition to the command.

Here is the use-case: I currently have a dataset that is a file system for an lxc that has been deleted from my proxmox host. The file system is not mounted, either directly or indirectly; it is not referenced anywhere in /proc/*/mounts. There are no visible processes referencing any files on the file system; no reference to a path on it can be found via lsof or fuser. The file system is not included in any of the host's backup or replication jobs. The host system has been rebooted (which is not ideal). The dataset is categorically not busy in any possible meaningful sense of the word 'busy' and yet:

➜ sudo zfs destroy -fvRr zfs-storage/subvol-105-disk-0
will destroy zfs-storage/subvol-105-disk-0
cannot destroy 'zfs-storage/subvol-105-disk-0': dataset is busy

In this scenario (which google tells me is not extremely uncommon), I think the world would be a better place if I could issue sudo zfs destroy -F zfs-storage/subvol-105-disk-0 and go to sleep that night knowing that the dataset was no longer occupying any GB on my disk.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type: FeatureFeature request or new feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions