Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: Chris Mason <clm@fb.com>
To: Shaun Reich <sreich@kde.org>, <linux-btrfs@vger.kernel.org>
Subject: Re: sub del: directory not empty, even though it is
Date: Mon, 14 Apr 2014 14:48:53 -0400	[thread overview]
Message-ID: <534C2D95.4090103@fb.com> (raw)
In-Reply-To: <CADVynFCg4KWN9AGNKXAjoamwoLfNO4Q5czv+UCdEhqXWrG8P8A@mail.gmail.com>

On 04/14/2014 12:50 PM, Shaun Reich wrote:
> attempting to restructure my fs snapshots the proper way, previous way
> was like this:
>
> (subvol=0)
> boot
> etc
> var
> ...
> SNAPSHOTS/01-16-14/{boot,etc,dev, proc..}
> SNAPSHOTS/03-22-14... etc
>
> i removed all but the 01-16-14 via sub del. i then thought 'i don't
> want the data at top-level anyways as its a botched upgrade, so i'll
> just revert to the last snapshot via a mv.
>
> so i rm'd everything at top level except snapshots, cd
> snapshots/01-16-14;mv * ../..
>
> now an ls -a at the dated dir shows empty, my files are where they
> should be so i really just want this to be gone. and a sub list on the
> top-level mount path lists:
>
> # btrfs sub list -ta /mnt/1
> ID      gen     top level       path
> --      ---     ---------       ----
> 291     199502  5               SNAPSHOTS/01-16-14
>
> yet, oddly enough btrfs sub del really doesn't want to delete it, even
> though it's entirely empty and not in use either.
>
> # btrfs sub del /mnt/1/SNAPSHOTS/01-16-14
> Transaction commit: none (default)
> Delete subvolume '/mnt/1/SNAPSHOTS/01-16-14'
> ERROR: cannot delete '/mnt/1/SNAPSHOTS/01-16-14' - Directory not empty

We have a pretty long list of reasons why the delete will fail, but the 
not empty one should only pop up if we think this snapshot has a 
reference on something else.  I wonder if the mv didn't drop the refs.

The easiest way to clear it up is with btrfs-debug-tree.

If you're on a recent btrfs-progs:

btrfs-debug-tree -d /dev/xxxx > output.txt

gzip and send to me (privately).  It wont' contain any if your personal 
data, just the subvolume layout.

-chris

  reply	other threads:[~2014-04-14 18:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-14 16:50 sub del: directory not empty, even though it is Shaun Reich
2014-04-14 18:48 ` Chris Mason [this message]
2014-04-14 19:14   ` Chris Mason
2014-04-14 19:29     ` Shaun Reich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=534C2D95.4090103@fb.com \
    --to=clm@fb.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=sreich@kde.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox