Cannot rollback snapshot: dataset is busy

Status
Not open for further replies.

Sasayaki

Explorer
Joined
Apr 20, 2014
Messages
86
Update: see below.

Hey all,

I have a single SSD plugged into my FreeNAS box that I run my jails off. Everything was running smoothly, but I went to update Owncloud and Plex Media Server plugins, and apparently it failed because they are both broken beyond belief now.

I wanted to rollback the snapshot on the SSD but it doesn't want to work. If I use the command:

zfs rollback -r SSD@auto-20141024.1411-1d

I get a very long string of:

cannot destroy 'SSD@auto-20141025.1353-1d': dataset is busy
cannot destroy 'SSD@auto-20141024.1514-1d': dataset is busy
cannot destroy 'SSD@auto-20141025.1002-1d': dataset is busy
cannot destroy 'SSD@auto-20141024.1727-1d': dataset is busy
cannot destroy 'SSD@auto-20141024.1645-1d': dataset is busy
cannot destroy 'SSD@auto-20141026.1127-1d': dataset is busy
cannot destroy 'SSD@auto-20141025.2011-1d': dataset is busy
cannot destroy 'SSD@auto-20141025.0906-1d': dataset is busy
cannot destroy 'SSD@auto-20141025.0625-1d': dataset is busy
cannot destroy 'SSD@auto-20141026.0124-1d': dataset is busy
cannot destroy 'SSD@auto-20141025.2252-1d': dataset is busy
cannot destroy 'SSD@auto-20141026.0852-1d': dataset is busy
cannot destroy 'SSD@auto-20141025.0000-1d': dataset is busy
cannot destroy 'SSD@auto-20141024.2111-1d': dataset is busy
cannot destroy 'SSD@auto-20141025.0351-1d': dataset is busy
cannot destroy 'SSD@auto-20141025.1744-1d': dataset is busy
cannot destroy 'SSD@auto-20141025.1208-1d': dataset is busy
cannot destroy 'SSD@auto-20141025.2327-1d': dataset is busy


Etc.

How can I rollback the snapshot so my plugins work again? How do I fix this?
 
Last edited:

Sasayaki

Explorer
Joined
Apr 20, 2014
Messages
86
So I did some more digging, it looks like at some point all my snapshots have a keep on them called freenas:repl, which I'm guessing is FreeNAS's replication task. This has been going on for several weeks and my previous snapshop plan was every 5 minutes (expiring in 24 hours) so I have a LOT of snapshops.

I can manually remove the flag from each snapshot individually, but how can I batch this process? It's broken all my plugins (can't install or update jails), I can't do replication, and the whole system is slowing down a lot.

Is there any way to remove all the holds on all snapshots and then delete them?
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Every 5 minutes is going to hurt performance. ;)

I think you can do something like this:

Assuming you want to only apply this to the SSD dataset you would do this

zfs list -t snapshot -o name | grep SSD | > /tmp/snaps.txt

zfs set freenas:repl="" < `cat /tmp/snaps.txt`

Those 2 commands may not be 100%. It's almost 5am here and I'm sleepy. But I think you'll get the idea. If these aren't correct and you do figure out how to make it right please post back the correct answer for other users. ;)

Do watch the characters that are before cat and after the second snaps.txt. It's the ` key (top right next to the 1 key).
 
Last edited:
Status
Not open for further replies.
Top