Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: Nikolay Borisov <nborisov@suse.com>
To: "Lentes, Bernd" <bernd.lentes@helmholtz-muenchen.de>,
	Btrfs ML <linux-btrfs@vger.kernel.org>
Subject: Re: what mens gen and ogen in btrfs sub list / ?
Date: Thu, 14 Apr 2022 16:39:35 +0300	[thread overview]
Message-ID: <605b45a5-cb80-a32f-0744-8441e46fb3a9@suse.com> (raw)
In-Reply-To: <587892959.1863318.1648125512532.JavaMail.zimbra@helmholtz-muenchen.de>



On 24.03.22 г. 14:38 ч., Lentes, Bernd wrote:
> 
> Hi,
> 
> i'd like to write a script in which, beneath other stuff, the oldest snapshot(s) are deleted.
> So i'm looking for a way to sort the list of the snapshots by date.
> I read the manpage and stumbled across gen and ogen of snapshots.
> But what does that mean and how can the values be interpreted ?
> Or is there another way to list the snapshots by e.g. creation date ?
> 
> OS: Ubuntu 20.04
> btrfs-progs: 5.4.1-2
> 
> root@nc-mcd:~/skripte# btrfs sub list -tcg /
> ID      gen     cgen    top level       path
> --      ---     ----    ---------       ----
> 273     1060462 170590  5               snapshots/pre_upgrade_27112020
> 279     1060464 1006204 5               snapshots/root-19102021
> 
> 
> Thanks.




So 'gen' is the current transid of the volume, that is the last 
transaction into which  something changed i.e a file was 
created/modified/deleted etc.

cgen OTOH is the transaction when the given subvolume was created.

      parent reply	other threads:[~2022-04-14 14:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-24 12:38 what mens gen and ogen in btrfs sub list / ? Lentes, Bernd
2022-04-14 11:32 ` Andrew Skretvedt
2022-04-14 13:39 ` Nikolay Borisov [this message]

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=605b45a5-cb80-a32f-0744-8441e46fb3a9@suse.com \
    --to=nborisov@suse.com \
    --cc=bernd.lentes@helmholtz-muenchen.de \
    --cc=linux-btrfs@vger.kernel.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