kdave / btrfsmaintenance

Scripts for btrfs maintenance tasks like periodic scrub, balance, trim or defrag on selected mountpoints or directories.
GNU General Public License v2.0
900 stars 79 forks source link

[defrag-plugin] Retrieve database path from RPM #39

Closed super7ramp closed 6 years ago

super7ramp commented 6 years ago

Recently, openSUSE has changed location of its RPM database from /var/lib/rpm to /usr/lib/sysimage/rpm (#38).

/var/lib/rpm still exists but it's now a link to /usr/lib/sysimage/rpm.

It looks like btrfs fi defragment -r doesn't follow links, no defragmentation is performed on the real location.

This commit fixes this by performing defragmentation on the real database location retrieved from rpm --eval %_dbpath.

super7ramp commented 6 years ago

Added a commit to fix cron symlink removals upon rpm package update (related to boo#904518).

kdave commented 6 years ago

Merged, thanks.