Unable To Delete Datasets - Busy

panzerscope

Contributor
Joined
May 30, 2022
Messages
146
Hey guys,

Quick one, is there a way to forcibly remove a dataset ? I am trying to remove a couple of datasets which I am getting the following busy error on

1678123232437.png


I have since restarted the server and re-tried, with no success. So far as I know, none of my machines are any longer mounting this dataset nor is this dataset a part of any backup routines.

Is there a way to either forcibly remove the dataset or a way to view what is accessing it ?

Please note that this dataset is just a subfolder of my main "Storage" dataset and not an entire volume. I did notice this Topic, but referred to a ZVOL and was hesitant to just randomly try things...for obvious reasons.

Many thanks,
P
 
Joined
Jun 15, 2022
Messages
674
Did you have S.M.A.R.T. testing scheduled? Use smartctl to check if a test is running on any disk in the array and has not completed, that will make a disk busy, along with everything above it (logically) in my experience.
 
Last edited:
Joined
Jun 15, 2022
Messages
674
I just realized I should have stated that more clearly (and I only mean this to be helpful): is any disk in the volume undergoing S.M.A.R.T. testing?

So far that (and possibly sharing) are all I've run into.

(original post updated)
 

Alecmascot

Guru
Joined
Mar 18, 2014
Messages
1,177
Search for "dataset is busy" and sit down for a long read.....
 
Joined
Oct 22, 2019
Messages
3,641
1.) Do any snapshots have a "hold"? You can check with the "zfs holds" command.

For instance:
Code:
zfs list -r -t snap -H -o name Tank/Storage/Taxreturns | xargs zfs holds


2.) Is any data being read/written to any of the datasets in question?
 

panzerscope

Contributor
Joined
May 30, 2022
Messages
146
1.) Do any snapshots have a "hold"? You can check with the "zfs holds" command.

For instance:
Code:
zfs list -r -t snap -H -o name Tank/Storage/Taxreturns | xargs zfs holds


2.) Is any data being read/written to any of the datasets in question?
Cheers,

I am not writing anything to the Datasets in question, or reading. I ran the command you suggested and all the came back was:

1678231522587.png


Looking at that, I would assume there are no ZFS Holds ?
 

panzerscope

Contributor
Joined
May 30, 2022
Messages
146
Solved the issue. In my case, one of my Apps (Nextcloud) had the dataset mounted, after stopping the app, I was able to remove the Dataset.
 

a8es

Cadet
Joined
Dec 8, 2023
Messages
1
Since this is one of the top results that shows up in search, to figure out which process is holding the dataset
In the shell run
# Figure out which process(es)
grep "$YOUR_DATASET_NAME" /proc/*/mounts

# List processes and filter by the id(s) from last step
ps -aux | grep $PROC_ID

In my case it was prometheus/node-exporter, but this process should work for any case
 

nutrient2314

Cadet
Joined
Jan 26, 2024
Messages
6
I had a background terminal window opened that had the dataset as the working directory, wasted 30 minutes trying to figure out.
 

wolffstarr

Cadet
Joined
Dec 30, 2017
Messages
1
Since this is one of the top results that shows up in search, to figure out which process is holding the dataset
In the shell run


In my case it was prometheus/node-exporter, but this process should work for any case
Just wanted to say thank you for this - I was tearing my hair out and this got me sorted - forgot I had one of the datasets mounted in a Jailmaker jail.
 
Top