Has anyone been successfull getting Snapper to run?

When I try to run the snapper GUI I get:

Using snapper: 'Failed to initialize snapper library: Configuration not found.'

I see there is a bug, but I’m not fully convinced it’s a bug. Seems to me like I may be doing something wrong.
New: Cannot run Snapper from YaST2 - opensuse-bugs.opensuse.org - ArchiveOrange

Someone on the bug comments said to do:

snapper -c srv create-config /srv
snapper -c srv create -d test

I entered the above in with no troubles.

I have installed BTRFS as default in my setup.

Here’s a Snapper install documentation but it’s for 11.4:

openSUSE:Snapper install - openSUSE

Does anybody know the story on this?

I have the exact same problem after installing from the KDE live CD. Apparently it doesn’t happen when installing from the DVD? I’m going to try this tonight after I’ve downloaded the DVD release.

I’ve managed to get mine working just fine with this configuration:

/etc/snapper/configs/root:



# subvolume to snapshot
SUBVOLUME="/"

# filesystem type
FSTYPE="btrfs"


# run daily number cleanup
NUMBER_CLEANUP="yes"

# limit for number cleanup
NUMBER_MIN_AGE="1800"
NUMBER_LIMIT="100"


# create hourly snapshots
TIMELINE_CREATE="yes"

# cleanup hourly snapshots after some time
TIMELINE_CLEANUP="yes"

# limits for timeline cleanup
TIMELINE_MIN_AGE="1800"
TIMELINE_LIMIT_HOURLY="10"
TIMELINE_LIMIT_DAILY="10"
TIMELINE_LIMIT_MONTHLY="10"
TIMELINE_LIMIT_YEARLY="10"


# cleanup empty pre-post-pairs
EMPTY_PRE_POST_CLEANUP="yes"

# limits for empty pre-post-pair cleanup
EMPTY_PRE_POST_MIN_AGE="1800"

/etc/snapper/configs/home:

# subvolume to snapshot
SUBVOLUME="/home"

# filesystem type
FSTYPE="btrfs"


# run daily number cleanup
NUMBER_CLEANUP="yes"

# limit for number cleanup
NUMBER_MIN_AGE="1800"
NUMBER_LIMIT="100"


# create hourly snapshots
TIMELINE_CREATE="yes"

# cleanup hourly snapshots after some time
TIMELINE_CLEANUP="yes"

# limits for timeline cleanup
TIMELINE_MIN_AGE="1800"
TIMELINE_LIMIT_HOURLY="10"
TIMELINE_LIMIT_DAILY="10"
TIMELINE_LIMIT_MONTHLY="10"
TIMELINE_LIMIT_YEARLY="10"


# cleanup empty pre-post-pairs
EMPTY_PRE_POST_CLEANUP="yes"

# limits for empty pre-post-pair cleanup
EMPTY_PRE_POST_MIN_AGE="1800"

/etc/sysconfig/snapper:

### Path: System/Snapper

## Type:        string
## Default:     ""
# List of snapper configurations.
SNAPPER_CONFIGS="root home"

Then run: ‘snapper create’ as root

and yast2-snapper should work just fine!

Thanks. If you could post and let us know how it went that would be great.

That worked! Thank you so much. :slight_smile:

This was the only reason I downloaded SUSE, because my other OS did everything I needed it to, but now that I can run snapper, SUSE will be my OS.

I feel exactly the same way! snapper was the deal breaker that made me choose openSUSE over Mint/Ubuntu yesterday.

It’s a fantastic feature!

On 2011-11-18 14:36, OrangutanClyde wrote:
> I have the exact same problem after installing from the KDE live CD.
> Apparently it doesn’t happen when installing from the DVD? I’m going to
> try this tonight after I’ve downloaded the DVD release.

If two people have the same problem, report in Bugzilla, and both add to it.


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

It’s already been reported, but I did add this link to the bug report so that people can get it running.

Sorry, this does not work for me. When I did the install, I was told NOT to use btrfs for root, so I did not. Hence there is no root file in /etc/snapper/configs.

But when I try to do anything, it complains that there is no root!

jarfx:/etc/snapper/configs # UTF8 locale not supported.
snapper create
Config ‘root’ not found.

My two other (srv and home) snapper files are just as you have them above.

Yast2’s snapper says “Failed to initialize snapper library” and exits.

Is a file called root required? Apparently so. THIS IS A BUG IMHO. I changed the name srv to rooit and yast2 opened. But I only see the files for /srv in yast2, not those for home. Can one put two partitions in one file?

This is still very poorly documented.


addendum:

/etc/sysconfig/snapper did have srv and home in it. Snapper will not work without a root. So when I changed srv to root, and put “root home” in /etc/sysconfig/snapper, is now seems to work.

On 2011-11-18 21:56, simpleblue wrote:
> It’s already been reported, but I did add this link to the bug report
> so that people can get it running.

Then say the number here.


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

https://bugzilla.novell.com/show_bug.cgi?id=725995

After creating the configs I got:
“Command failed (IO error). See log for more information.”

I had to manually create the directory for the snapshots:
mkdir /.snapshots

I’ve been playing around with this and I’ve found a solution that works for me. This will allow you to take snapshots of /root by itself. It also gives the the option to add /home, as well. I made this tutorial to be compatible with people that might have messed some stuff up.

Erase the configs in the /etc/snapper/configs folder:

rm /etc/snapper/configs/home
rm /etc/snapper/configs/root
rm /etc/snapper/configs/srv
...

Make sure your config template is setup properly:

nano /etc/snapper/config-templates/default

… Should look like this:

# subvolume to snapshot
SUBVOLUME="/"

# filesystem type
FSTYPE="btrfs"


# run daily number cleanup
NUMBER_CLEANUP="yes"

# limit for number cleanup
NUMBER_MIN_AGE="1800"
NUMBER_LIMIT="100"


# create hourly snapshots
TIMELINE_CREATE="yes"

# cleanup hourly snapshots after some time
TIMELINE_CLEANUP="yes"

# limits for timeline cleanup
TIMELINE_MIN_AGE="1800"
TIMELINE_LIMIT_HOURLY="10"
TIMELINE_LIMIT_DAILY="10"
TIMELINE_LIMIT_MONTHLY="10"
TIMELINE_LIMIT_YEARLY="10"


# cleanup empty pre-post-pairs
EMPTY_PRE_POST_CLEANUP="yes"

# limits for empty pre-post-pair cleanup
EMPTY_PRE_POST_MIN_AGE="1800"

Copy the default template to /etc/snapper/configs/ and make a new ‘root’ config:

cp /etc/snapper/config-templates/default /etc/snapper/configs/root

Edit snapper Global configuration file:

nano /etc/sysconfig/snapper

… and make sure the file looks like this:

## Path: System/Snapper
## Type:        string
## Default:     ""
# List of snapper configurations.
SNAPPER_CONFIGS="root"

Create a root config (This may come up with errors depending on if you’ve done this before just continue with the next command if this happens):

snapper -c root create-config /
snapper -c root create -d testroot

Open Yast and select ‘snapper’ which should be at the bottom of the list under miscellaneous

~~~ Adding /home directory if you’d like ~~~

If you want to add /home then:

Edit config:

nano /etc/sysconfig/snapper

… and make sure the file looks like this:

## Path: System/Snapper
## Type:        string
## Default:     ""
# List of snapper configurations.
SNAPPER_CONFIGS="root home"

Create home (This may come up with errors depending on if you’ve done this before just continue with the next command if this happens):

snapper -c home create-config /home
snapper -c home create -d testhome

Copy the default template to /etc/snapper/configs/ and make a new ‘home’ config:

cp /etc/snapper/config-templates/default /etc/snapper/configs/home

Edit the new ‘home’ config file:

nano /etc/snapper/configs/home

… and make sure to edit the top line to look like:

# subvolume to snapshot
SUBVOLUME="/home"

Edit config to add ‘home’:

nano /etc/sysconfig/snapper

… and make sure the file looks like this (note that ‘home’ was added):

## Path: System/Snapper
## Type:        string
## Default:     ""
# List of snapper configurations.
SNAPPER_CONFIGS="root home"

Open Yast and select ‘snapper’ which should be at the bottom of the list under miscellaneous

~~~ Some additional stuff ~~~

List snapshots

snapper -c home list

Create a new snapshot (with the name ‘newsnapshot’):

snapper -c home create -d newsnapshot

Delete a snapshot (in this case we’ll delete #3):

snapper -c home delete 3 

For the above post. I cannot edit it anymore but you’ll need to create a subvolume for the snapshots as the very first step:

 btrfs subvolume create /snapshots

Sorry for the complexity. Perhaps I’ve made this tutorial more complex then necessary. Remember this is just a beta, considering that BTRFS is still be beta.

After fighting with this for a few days I found that / worked but not /home, what I finally figured out was the I needed to create a /home/.snapshot, most of the examples show a /home/snapshot subvolume.

btrfs subvolume create /home/.snapshots Notice the “.”

after the snapper -c home list would show the correct snapshots being accumulated ever hour and snapshots can be taken from the command line.

jarfx:/home # jarfx:/home # btrfs subvolume create /snapshots
Create subvolume ‘//snapshots’
ERROR: cannot create subvolume - Inappropriate ioctl for device
Create subvolume ‘//snapshots’
ERROR: cannot create subvolume - Inappropriate ioctl for device

Well, that does not work.

I think you have to do it as
jarfx:/home # btrfs subvolume create /home/snapshots

But I think they updated snapper to fix the problem that it would not work without a root configuration file. This is even though the installation told you NOT to use btrfs on /, so most people will not have / in snapper.

I had renamed the srv configuration to root, and Yast started to work.

Surely what you were told was not to use btrfs for /boot. The file system will be on the btrfs partition so / is there.

does not work for me…
I created root and home configs and changed /etc/sysconfig/snapper .

btrfs subvolume create /snapshots
Create subvolume '//snapshots'
ERROR: cannot create subvolume - Inappropriate ioctl for device

tail -f /var/log/snapper.log 
2011-12-01 11:46:45,204 INFO  libsnapper(5910) Snapper.cc(Snapper):55 - config_name:home disable_filters:false
2011-12-01 11:46:45,204 INFO  libsnapper(5910) AsciiFile.cc(reload):103 - loading file /etc/snapper/configs/home
2011-12-01 11:46:45,204 INFO  libsnapper(5910) AsciiFile.cc(getValue):178 - key:SUBVOLUME value:/home
2011-12-01 11:46:45,204 INFO  libsnapper(5910) AsciiFile.cc(getValue):178 - key:FSTYPE value:btrfs
2011-12-01 11:46:45,204 INFO  libsnapper(5910) Snapper.cc(Snapper):73 - subvolume:/home filesystem:btrfs
2011-12-01 11:46:45,204 INFO  libsnapper(5910) Snapper.cc(loadIgnorePatterns):113 - number of ignore patterns:6
2011-12-01 11:46:45,204 INFO  libsnapper(5910) Snapshot.cc(read):216 - found 1 snapshots
2011-12-01 11:46:45,205 ERROR libsnapper(5910) Snapshot.cc(nextNumber):362 - mkdir failed errno:2 (No such file or directory)
2011-12-01 11:46:45,205 ERROR libsnapper(5910) snapper.cc(main):1181 - caught final exception
2011-12-01 11:46:45,205 INFO  libsnapper(5910) Snapper.cc(~Snapper):84 - Snapper destructor