1

I have a system that creates periodic btrfs snapshots and deletes old ones. Today, I've started receiving warnings that the system can't delete some old snapshots.

This is the output I get:

root@machine:/path# btrfs sub del 2014-10-26--01-50-01-@ten_minutely
Delete subvolume '/path/2014-10-26--01-50-01-@ten_minutely'
ERROR: cannot delete '/path/2014-10-26--01-50-01-@ten_minutely'

I can create and delete new snapshots without a problem - just a couple of them, created today, exhibit this behaviour.

The permissions look ok. Syslog show nothing related. I checked btrfs filesystem df, and there's space available for the filesystem - both for metadata and data.

A strace of the delete command shows:

#...
ioctl(3, 0x5000940f, 0xffa1d1f0)        = -1 ENOTEMPTY (Directory not empty)
close(3)                                = 0
#...

What further steps can I take to investigate the cause?

2
  • I hope that you are not housing production data on a btrfs filesystem its not to that level yet.
    – mdpc
    Oct 26, 2014 at 20:49
  • @mdpc Sort of - it's a small system with just a couple of users. I've been using btrfs without significant problems for about 3 years now Oct 27, 2014 at 2:00

1 Answer 1

4

After some digging around, I found the root of the problem

Inside the snapshots that cannot be deleted, there was a subvolume - apparently another snapshot. The system that creates periodic snapshots must have run twice for the same path - thus creating the second snapshot inside the first, instead of taking that name.

For the record, I'm using btrfs-snapshot-rotation through plain cron. Since I had multiple snapshot frequencies, two must have run in the same second. A potential solution is to switch to anacron.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .