Re: Creating recursive snapshots for all filesystems

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux