From owner-freebsd-stable@FreeBSD.ORG  Sat Sep 13 04:14:55 2014
Return-Path: <owner-freebsd-stable@FreeBSD.ORG>
Delivered-To: freebsd-stable@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 41724761;
 Sat, 13 Sep 2014 04:14:55 +0000 (UTC)
Received: from ipmail05.adl6.internode.on.net (ipmail05.adl6.internode.on.net
 [150.101.137.143])
 by mx1.freebsd.org (Postfix) with ESMTP id 99CF4403;
 Sat, 13 Sep 2014 04:14:53 +0000 (UTC)
Received: from ppp118-210-249-247.lns20.adl6.internode.on.net (HELO
 leader.local) ([118.210.249.247])
 by ipmail05.adl6.internode.on.net with ESMTP; 13 Sep 2014 13:44:52 +0930
Message-ID: <5413C4BA.7080302@ShaneWare.Biz>
Date: Sat, 13 Sep 2014 13:44:50 +0930
From: Shane Ambler <FreeBSD@ShaneWare.Biz>
User-Agent: Mozilla/5.0 (X11; FreeBSD amd64;
 rv:24.0) Gecko/20100101 Thunderbird/24.6.0
MIME-Version: 1.0
To: Andriy Gapon <avg@FreeBSD.org>, freebsd-stable@FreeBSD.org, 
 amvandemore@gmail.com, killing@multiplay.co.uk
Subject: Re: Snapshots that won't delete [was: Re: ZFS on root booting...]
References: <FE64613E-B083-436C-8A08-13923ED88797@icloud.com>
 <7F008C560B48412AB66A1EBD9382DDAE@multiplay.co.uk>
 <CC276D59-F83C-4C78-BD9B-84040D3DE3E4@icloud.com>
 <9315C209-701A-49EF-85D3-ACCCD1513EC3@icloud.com>
 <959C54D2C8EB4AC8983DC1DA3CE042E3@multiplay.co.uk>
 <9F24DD48FBEA46C39F98DF600D46DA1A@multiplay.co.uk>
 <B4A16726-142D-458A-9B3A-153BDD579A63@icloud.com>
 <BAB9F50F-9D2C-435C-8035-659E2B412FC7@icloud.com>
 <4450778127F4407EB6566A0FE11CD651@multiplay.co.uk>
 <090135D4-8B1F-42B4-82FC-6FD2F1DBDDA8@icloud.com>
 <20140911071233.GA50585@anubis.morrow.me.uk> <541280D8.9090500@ShaneWare.Biz>
 <541293D0.4080907@FreeBSD.org>
In-Reply-To: <541293D0.4080907@FreeBSD.org>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-BeenThere: freebsd-stable@freebsd.org
X-Mailman-Version: 2.1.18-1
Precedence: list
List-Id: Production branch of FreeBSD source code <freebsd-stable.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/freebsd-stable>,
 <mailto:freebsd-stable-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/freebsd-stable/>
List-Post: <mailto:freebsd-stable@freebsd.org>
List-Help: <mailto:freebsd-stable-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/freebsd-stable>,
 <mailto:freebsd-stable-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sat, 13 Sep 2014 04:14:55 -0000

On 12/09/2014 16:03, Andriy Gapon wrote:
> On 12/09/2014 08:12, Shane Ambler wrote:
>> On 11/09/2014 16:42, Ben Morrow wrote:

>>> Recently, though, my dump script has started having occasional problems
>>> with snapshots that won't delete. Pending further investigation I have
>>> been renaming them to allow the recursive delete to succeed, and (so
>>> far) rebooting has always made it possible to get rid of them. 
>>
>> I have seen that issue with 9.2 and at least one other person mentioned
>> it as well. I currently have a snapshot that I accessed at least 3 weeks
>> ago and renamed to keep rotations working and have not accessed since,
>> it still won't delete as it is busy. I can only delete these snapshots
>> after a reboot.
>>
>> The only cause I know is accessing the snapshot.
>> I can simply ls .zfs/snapshot/daily.01/somefolder to prevent it being
>> deleted. With a manual zfs destroy I get "dataset is busy" and have not
>> found a way to find any process that has hold of it.
> 
> Look for it in `mount` output.

There is no entry in mount or df for the snapshot

The zfs mounted property is only yes for real filesystems - all
snapshots show as '-'

On 12/09/2014 16:44, Adam Vande More wrote:
>
> What exactly have you tried and what were the results?

zfs rename works
zfs destroy fails both before and after rename with
'cannot destroy snapshot zrpleader/home/shane@daily.bad: dataset is busy'

I can't find anything with fstat or lsof to indicate a process has
anything open within the snapshot path.

I haven't done a lot of digging for info so don't think I've tried
anything else yet.

On 12/09/2014 17:49, Steven Hartland wrote:
>
> Is there a hold on the snapshot?

Don't know how to tell that.


The first time I encountered this I think I sent xfe to the snapshot
dir and opened a video with vlc. The one I have from a few weeks ago I
did cp ~/.zfs/snapshot/daily.01/folder/file ~/folder/ from a terminal
as a normal user.

The original snapshots were created with
zfs snapshot -r zrpleader@daily.01

I have manually destroyed each of the individual filesystem snapshots
that I could and have two bad snapshots remaining, one from a few weeks
ago and one from a few days ago.

Both of these I can not access now. ls .zfs/snapshot/daily.bad says
'ls: .zfs/snapshot/daily.bad: Device busy'

-- 
FreeBSD - the place to B...Serving Data

Shane Ambler