Introducing snapper: A tool for managing btrfs snapshots
April 1st, 2011 by Arvin SchnellToday we want to present the current development of snapper, a tool for managing btrfs snapshots.
For years we had the request to provide rollbacks for YaST and zypper but things never got far due to various technical problems. With the rise of btrfs snapshots we finally saw the possibility for a usable solution. The basic idea is to create a snapshot before and after running YaST or zypper, compare the two snapshots and finally provide a tool to revert the differences between the two snapshots. That was the birth of snapper. Soon the idea was extended to create hourly snapshots as a backup system against general user mistakes.
The tool is now in a state where you can play with it. On the other hand there is still room and time for modifications and new features.
Overview
We provide a command line tool and a YaST UI module. Here is a brief tour:
First we manually create a snapshot:
# snapper create --description "initial"
Running YaST automatically creates two snapshots:
# yast2 users
Now we can list our snapshots:
# snapper list Type | # | Pre # | Date | Cleanup | Description -------+---+-------+--------------------------+----------+------------- single | 0 | | | | current single | 1 | | Wed Mar 30 14:52:17 2011 | | initial pre | 2 | | Wed Mar 30 14:57:10 2011 | number | yast users post | 3 | 2 | Wed Mar 30 14:57:35 2011 | number | single | 4 | | Wed Mar 30 15:00:01 2011 | timeline | timeline
Snapshot #0 always refers to the current system. Snapshot #2 and #3 were created by YaST. Snapshot #4 was created by an hourly cronjob.
Getting the list of modified files between to snapshots is easy:
# snapper diff 2 3 c... /etc/group c... /etc/group.YaST2save c... /etc/passwd c... /etc/passwd.YaST2save c... /etc/shadow c... /etc/shadow.YaST2save c... /etc/sysconfig/displaymanager c... /var/tmp/kdecache-linux/icon-cache.kcache c... /var/tmp/kdecache-linux/plasma_theme_openSUSEdefault.kcache
You can also compare a single file between two snapshots:
# snapper diff --file /etc/passwd 2 3 --- /snapshots/2/snapshot/etc/passwd 2011年03月30日 14:41:45.943000001 +0200 +++ /snapshots/3/snapshot/etc/passwd 2011年03月30日 14:57:33.916000003 +0200 @@ -22,3 +22,4 @@ uucp:x:10:14:Unix-to-Unix CoPy system:/etc/uucp:/bin/bash wwwrun:x:30:8:WWW daemon apache:/var/lib/wwwrun:/bin/false linux:x:1000:100:linux:/home/linux:/bin/bash +tux:x:1001:100:tux:/home/tux:/bin/bash
The main feature of course is to revert the changes between two snapshots:
# snapper rollback 2 3
Finally yast2-snapper provides a YaST UI for snapper.
Testing
Playing with snapper should only be done on test machines. Both btrfs and snapper are not finished and included known bugs. Here is a step-by-step manual for installing and configuring snapper for openSUSE 11.4.
Feedback
We would like to get feedback, esp. about general problems and further ideas. There are also tasks everybody can work on, e.g. the snapper wiki page or a man-page for snapper.
For the time being there is no dedicated mailing-list so just use opensuse-factory@opensuse.org.
Both comments and pings are currently closed.
- Posted: 2011年04月01日 - 10:11
- Author: Arvin Schnell
- Feed: RSS 2.0
2 Responses to “Introducing snapper: A tool for managing btrfs snapshots”
-
Romanator
Great idea. I’m looking forward to BtrFS. However, I think it would very helpful if the snapshot would appear in the Grub menu.
This would be helpful if the system got corrupted. The user can choose an earlier snapshot to recover.
-
Arvin Schnell
AFAIK grub does not support booting from btrfs. There are patches available but even with those booting from snapshots is not possible.
But our bootloader experts want to provide the possibility to boot different kernels where each kernel knows its corresponding snapshots.
-
Advertisement
Tags
11.3 11.4 12.1 12.2 12.3 13.1 13.2 amd ARM ATI Beta buildservice Build Service C-Language cloud Collaboration Community conference Education event Events Factory fglrx fun GNOME gsoc Hackweek KDE Kernel Kraft Linux LXDE obs openSUSE Package PostgreSQL radeon raspberry Raspberry Pi rpm Ruby Tumbleweed XML xorg YaSTArchives
- March 2020 (1)
- February 2020 (2)
- January 2020 (1)
- December 2019 (3)
- November 2019 (2)
- October 2019 (4)
- September 2019 (3)
- August 2019 (3)
- July 2019 (4)
- June 2019 (2)
- April 2019 (4)
- March 2019 (3)
- February 2019 (5)
- January 2019 (1)
- December 2018 (2)
- November 2018 (2)
- October 2018 (3)
- September 2018 (1)
- August 2018 (3)
- July 2018 (2)
- May 2018 (2)
- April 2018 (2)
- March 2018 (2)
- February 2018 (2)
- January 2018 (2)
- December 2017 (1)
- November 2017 (2)
- October 2017 (2)
- September 2017 (3)
- August 2017 (4)
- July 2017 (4)
- June 2017 (2)
- May 2017 (4)
- April 2017 (2)
- March 2017 (3)
- February 2017 (3)
- January 2017 (2)
- December 2016 (5)
- November 2016 (3)
- October 2016 (6)
- September 2016 (2)
- August 2016 (3)
- July 2016 (4)
- June 2016 (2)
- May 2016 (2)
- April 2016 (1)
- March 2016 (2)
- February 2016 (4)
- January 2016 (4)
- December 2015 (6)
- November 2015 (2)
- October 2015 (3)
- September 2015 (2)
- August 2015 (2)
- July 2015 (2)
- June 2015 (3)
- May 2015 (12)
- April 2015 (7)
- March 2015 (6)
- February 2015 (6)
- January 2015 (7)
- December 2014 (5)
- November 2014 (3)
- October 2014 (5)
- September 2014 (3)
- August 2014 (5)
- July 2014 (5)
- June 2014 (7)
- May 2014 (9)
- April 2014 (2)
- March 2014 (9)
- February 2014 (9)
- January 2014 (10)
- December 2013 (9)
- November 2013 (10)
- October 2013 (10)
- September 2013 (6)
- August 2013 (7)
- July 2013 (3)
- June 2013 (7)
- May 2013 (4)
- April 2013 (4)
- March 2013 (7)
- February 2013 (6)
- January 2013 (3)
- December 2012 (3)
- October 2012 (6)
- September 2012 (6)
- August 2012 (5)
- July 2012 (12)
- June 2012 (6)
- May 2012 (4)
- April 2012 (4)
- March 2012 (5)
- February 2012 (2)
- January 2012 (5)
- December 2011 (10)
- November 2011 (6)
- October 2011 (5)
- September 2011 (9)
- August 2011 (12)
- July 2011 (14)
- June 2011 (11)
- May 2011 (18)
- April 2011 (15)
- March 2011 (26)
- February 2011 (16)
- January 2011 (23)
- December 2010 (27)
- November 2010 (18)
- October 2010 (21)
- September 2010 (16)
- August 2010 (21)
- July 2010 (20)
- June 2010 (33)
- May 2010 (29)
- April 2010 (24)
- March 2010 (29)
- February 2010 (22)
- January 2010 (20)
- December 2009 (15)
- November 2009 (21)
- October 2009 (17)
- September 2009 (22)
- August 2009 (28)
- July 2009 (36)
- June 2009 (38)
- May 2009 (40)
- April 2009 (30)
- March 2009 (20)
- February 2009 (21)
- January 2009 (27)
- December 2008 (23)
- November 2008 (12)
- October 2008 (23)
- September 2008 (40)
- August 2008 (24)
- July 2008 (12)
- June 2008 (28)
- May 2008 (26)
- April 2008 (1)