Mailinglist Archive: opensuse (1355 mails)

< Previous Next >
Re: [opensuse] zypper dup very busy defragging btrfs, when there is nobtrfs partition...
On 2018-06-07 17:49, Richard Brown wrote:
On 7 June 2018 at 14:37, Carlos E. R. <robin.listas@xxxxxxxxxxxxxx> wrote:

zypper dup of one 42.3 system to 15.0 on a VBox guest.

After this question:

1904 packages to upgrade, 607 to downgrade, 762 new, 291 to remove, 8 to
change vendor, 8 to change arch.
Overall download size: 1.97 GiB. Already cached: 0 B. After the operation,
additional 1.3 GiB will be used.
Continue? [y/n/...? shows all options] (y):
Do you agree with the terms of the license? [yes/no] (no): yes

The system gets busy for minutes with, and later with
btrfs-defrag-pl, but there are no btrfs partitions at all:


sda sda 512 0 0 20G disk
├─sda1 sda1 512 0 0 7M part
├─sda2 sda2 512 0 0 4G part swap swap_1
├─sda3 sda3 512 0 0 10G part ext4 Main
└─sda4 sda4 512 0 0 6G part xfs Home
sdb sdb 512 0 0 20G disk
├─sdb1 sdb1 512 0 0 4G part swap swap_2
├─sdb2 sdb2 512 0 0 12G part ext4 Usr
└─sdb3 sdb3 512 0 0 4G part crypto_LUKS
└─cr_sdb3 dm-0 512 0 0 4G crypt xfs
sdc sdc 512 0 0 20G disk
└─sdc1 sdc1 512 0 0 4.9G part reiserfs Reiserfs

I can understand testing for btrfs then exiting, but it takes minutes at
100% CPU.

Very strange

It is strange.

I understant that the tool is installed and that it gets called, but
should exit instantly.

"btrfs-defrag-pl" probably related to "", which
is provided by the btrfsmaintenance package

Maybe the name got trimmed on the right side, I copy pasted from "top".

No package requires btrfsmaintenance, but it is recommended by
btrfsprogs and the minimal_base pattern

The python script itself is a zypper plugin running after rpm commit,
to defrag the rpmdb folder specifically

In this case, it ran before "zypper dup" starts the real job.

The script itself checks that the filesystem containing the rpmdb is btrfs

Snipping the relevant lines from the script:

PATH=subprocess.check_output(["rpm", "--eval", "%_dbpath"],
def fstype(path):
ret=qx('stat -f --format=%T "'+path+'"')
return ret.rstrip()
if fstype(PATH) != 'btrfs':

So the questions now are

Q1 where does your system think it's rpmdb is located? Run "rpm --eval
%_dbpath" to give the exact same answer that the script will get

I'll find that out later, because now the upgrade to 15.0 finished. But
it is a VM with a snapshot to revert to 42.3. We are investigating a
crash in systemd while upgrading, and needs doing the upgrade several
times to try catch a coredump and detailed logs (not yet successfully).

So later I'll revert and find out where it was.

Q2 why does the script think it's btrfs? Run "stat -f --format=%T
$ANSWER_TO_Q1" to give the exact same answer to the script

At this moment, after the upgrade finished (not yet rebooted):

Eleanor-423:~ # rpm --eval %_dbpath
Eleanor-423:~ # stat -f --format=%T /usr/lib/sysimage/rpm
Eleanor-423:~ #

Q3 if Q2 doesn't say it's btrfs, then you've found a legitimate bug
with the plugin in the btrfsmaintenance package that justifies a bug
report with this debugging information to make it very clear that the
return isn't being called as expect when the filesystem is not btrfs

I'll tell you after reverting the upgrade. :-)

Cheers / Saludos,

Carlos E. R.
(from 42.3 x86_64 "Malachite" at Telcontar)

< Previous Next >
Follow Ups