linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Possible to wait for snapshot deletion?
@ 2014-02-13 19:02 Kai Krakow
  2014-02-13 19:29 ` Brendan Hide
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Kai Krakow @ 2014-02-13 19:02 UTC (permalink / raw)
  To: linux-btrfs

Hi!

Is it technically possible to wait for a snapshot completely purged from 
disk? I imagine an option like "--wait" for btrfs delete subvolume.

This would fit some purposes I'm planning to implement:

* In a backup scenario have a subprocess which deletes snapshots one by one,
  starting with the oldest. If free space raises above a certain threshold,
  pause the subprocess. If number of kept snapshots falls below a certain
  threshold, exit the subprocess. When the backup job finished, it joins the
  subprocess to wait for a pending subvolume deletion if any, then syncs the
  filesystem and waits some grace time for uncommitted writes, then shuts
  the system down or hibernates it.

* Wait for pending background subvolume deletion before putting the system
  to sleep.

* Get better control of cron jobs working with subvolumes so jobs either do
  not overlap or do not put too much parallel work on the file system.

Scrubbing does allow that. Why don't snapshots do? At least I found no 
options for it.

Background information: If btrfs is shut down improperly, already deleted 
subvolume entries may reappear in their directories. The deletion is not 
gracefully resumed. Since deletion of subvolumes/snapshots can take hours, 
this is a problem for systems that are not guaranteed to be up all the time 
or suffer from disconnected power, especially if multiple snapshots are 
being deleted at once. With an option to wait, a script managing snapshot 
deletion could more gracefully resume its job.

-- 
Replies to list only preferred.


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2014-02-14 16:15 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-13 19:02 Possible to wait for snapshot deletion? Kai Krakow
2014-02-13 19:29 ` Brendan Hide
2014-02-14  0:25   ` Kai Krakow
2014-02-13 19:57 ` Hugo Mills
2014-02-13 20:45 ` Garry T. Williams
2014-02-14  0:12   ` Kai Krakow
2014-02-14 16:05     ` David Sterba
2014-02-13 21:42 ` Holger Hoffstätte
2014-02-14  0:15   ` Kai Krakow
2014-02-14 16:15 ` David Sterba

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).