Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: Sander <sander@humilis.net>
To: Alexander Skwar <alexanders.mailinglists+nospam@gmail.com>
Cc: "linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>
Subject: Re: Creating recursive snapshots for all filesystems
Date: Fri, 3 May 2013 10:48:22 +0200	[thread overview]
Message-ID: <20130503084822.GA22531@panda> (raw)
In-Reply-To: <CADn-QaPQ0aH1rb3rG3bE87Ka3XaLzHHeA6nwNLbQJsbB_BiXkw@mail.gmail.com>

Alexander Skwar wrote (ao):
> Where I'm hanging right now, is that I can't seem to figure out a
> "bullet proof" way to find all the subvolumes of the filesystems I
> might have.

> Is there an easier way to achieve what I want? I want to achieve:
> 
> Creating recursive snapshots for all filesystems

Not sure if this helps, but I have subvolid=0, which contains all my
subvolumes, mounted under /.root/

/etc/fstab:
LABEL=panda   /  btrfs  subvol=rootvolume,space_cache,inode_cache,compress=lzo,ssd  0  0
LABEL=panda   /home           btrfs   subvol=home                                   0  0
LABEL=panda   /root           btrfs   subvol=root                                   0  0
LABEL=panda   /var            btrfs   subvol=var                                    0  0
LABEL=panda   /holding        btrfs   subvol=.holding                               0  0
LABEL=panda   /.root          btrfs   subvolid=0                                    0  0
LABEL=panda   /.backupadmin   btrfs   subvol=backupadmin                            0  0 
/Varlib       /var/lib        none    bind                                          0  0

panda:~# ls -l /.root/
total 0
drwxr-xr-x. 1 root root 580800 Jan 30 17:46 backupadmin
drwxr-xr-x. 1 root root     24 Mar 27  2012 home
drwx------. 1 root root    742 Mar 19 15:50 root
drwxr-xr-x. 1 root root    226 May 16  2012 rootvolume
drwxr-xr-x. 1 root root     96 Apr  3  2012 var

In my snapshots script:

  ...
  yyyymmddhhmm=`date +%Y%m%d_%H.%M`
  ...
  for subvolume in `ls /.root/`
  do
    ...
    /sbin/btrfs subvolume snapshot ${filesystem}/${subvolume}/ \
      /.root/.snapshot_${yyyymmddhhmm}_${hostname}_${subvolume}/ || result=2
    ...
  done
  ...

This creates timestamped snapshots for all subvolumes.

	Sander

  reply	other threads:[~2013-05-03  8:48 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-02 20:41 Creating recursive snapshots for all filesystems Alexander Skwar
2013-05-03  8:48 ` Sander [this message]
2013-05-03 11:46   ` Alexander Skwar
2013-05-05 11:05 ` Kai Krakow
2013-05-05 12:59   ` Alexander Skwar
2013-05-05 16:03     ` Kai Krakow
2013-05-05 16:19       ` Alexander Skwar
2013-05-09 20:41     ` nocow 'C' flag ignored after balance Kyle Gates
2013-05-10  5:15       ` Liu Bo
2013-05-10 13:58         ` Kyle Gates
2013-05-16 19:11           ` Kyle Gates
2013-05-17  7:04             ` Liu Bo
2013-05-17 14:38               ` Kyle Gates
2013-05-28 14:22               ` Kyle Gates
2013-05-29  1:55                 ` Liu Bo
2013-05-29  8:33                   ` Miao Xie
2013-05-30 16:40                     ` Kyle Gates
2013-05-30 16:40                   ` Kyle Gates

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=20130503084822.GA22531@panda \
    --to=sander@humilis.net \
    --cc=alexanders.mailinglists+nospam@gmail.com \
    --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