From mboxrd@z Thu Jan 1 00:00:00 1970 From: Josh Berry Subject: Re: Updating the wiki pages adding btrfs command Date: Wed, 15 Sep 2010 16:46:14 -0700 Message-ID: References: <201009131923.53227.kreijack@libero.it> <201009142125.56710.kreijack@libero.it> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Cc: Sage Weil , David Nicol , kreijack , linux-btrfs To: Chris Ball Return-path: In-Reply-To: List-ID: On Wed, Sep 15, 2010 at 15:37, Chris Ball wrote: =2E.. > =C2=A0 > Why not just do: > =C2=A0 > # btrfs subvolume delete /path/to/subvolume1 > =C2=A0 > # btrfs subvolume delete /path/to/subvolume2 > =C2=A0 > # sync > > Or even better, "btrfs filesystem sync ". > > I'm assuming that the caller wants to wait until the subvol delete > has happened, but is unwilling to wait until all other writes to the > FS have finished, and is even more unwilling to wait for all writes > on the rest of the system to finish. > > I don't know whether that's actually a reasonable/plausible use case, > though. I think so, because I have that use case (sorta). I have a home fileserver with btrfs, and a cron job on that machine runs hourly, taking snapshots. However, once the disk fills up, I want to delete the oldest snapshots: while [[ disk > xx% full ]]; do btrfs subvol delete /the/oldest/snapshot wait for space to free up done If delete does not wait to free space, I'll delete too many snapshots. But if I force a filesystem-wide sync after every delete, the loop may take longer, which on a system busier than mine could take more than the hour to complete. -- Josh -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" = in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html