[CentOS] My grub2-btrfs & yum-plugin-snapper

Andreas Benzler

andreas at benzlerweb.de
Thu Jun 15 09:02:57 UTC 2017


Hello Guys,


Last Sunday I had the idea to expand my gameplay btrfs. Now what was
missing was a yum plugin which worked like arch or opensuse. Ok, I told
myself and learned a little python. Also something for grub2 to boot
into a snapshot. My results are up on:

https://copr.fedorainfracloud.org/coprs/andybe/Centos7Btrfs/

grub2-btrfs (do not use grub-btrfs, this is the version before)
yum-plugin-snapper

The grub2 plugin is tuned to snapper and is therefore in conflict with
yum-plugin-fs-snapshot (from archlinux). 

/etc/yum/pluginconf.d/snapper.conf 
[main]
enabled=1
verbose=0
configs=
update_grub2=False

If no configs specified so is tried to make a global snapshot.
Of course, comma-separated configs can be saved.


The yum-plugin-snapper has no direct dependency to yum-plugin-snapper
(optional)

There are many posts how it works for example: http://dustymabe.com/201
7/02/12/fedora-btrfssnapper-the-fedora-25-edition/

Here how it looks like:

LANG=C yum remove htop
Loaded plugins: fastestmirror, snapper
Resolving Dependencies
--> Running transaction check
---> Package htop.x86_64 0:2.0.2-1.el7 will be erased
--> Finished Dependency Resolution

Dependencies Resolved

=======================================================================
=========
 Package        Arch             Version                  Repository   
    Size
=======================================================================
=========
Removing:
 htop           x86_64           2.0.2-
1.el7              @epel           207 k

Transaction Summary
=======================================================================
=========
Remove  1 Package

Installed size: 207 k
Is this ok [y/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Erasing    : htop-2.0.2-
1.el7.x86_64                                      1/1 
  Verifying  : htop-2.0.2-
1.el7.x86_64                                      1/1 

Removed:
  htop.x86_64 0:2.0.2-
1.el7                                                     

Complete!
LANG=C snapper list
Type   | # | Pre # | Date                     | User | Cleanup |
Description     | Userdata
-------+---+-------+--------------------------+------+---------+-------
----------+---------
single | 0 |       |                          | root |         |
current         |         
pre    | 1 |       | Thu Jun 15 08:42:18 2017 | root |         | yum
remove htop |         
post   | 2 | 1     | Thu Jun 15 08:42:19 2017 | root |
number  |                 |  


Grub Menu

CentOS Linux (3.10-.......)
CentOS Linux (0-rescue ....)
CentOS Linux Snapshots

Still a small note: here would be 6 entries for 2 kernel for each
snapshot created. It can also cause the system to stop booting. This
happened to me once grub.cfg 1.1MB was large, on fedora.
If Grub2 is so installed that it looks for strange systems, a yum
installation, because of grub2-mkconfig, also take a long time.

It works as it is. The grub2 plugin needs a little bit work. But now
analyse jet.

I made ist failsafe for linux and linuxefi.


For me, it was important to know whether such a thing under centos
works, because yum-plugin-fs-snapshot is intended for several file
systems. Can be helpful or not. Just something different for me. 

Fun work :-)

Sincerely

Andy



More information about the CentOS mailing list