Bug 1471095 - "Unknown command" when trying to run 'thin_trim'
"Unknown command" when trying to run 'thin_trim'
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: device-mapper-persistent-data (Show other bugs)
Unspecified Unspecified
unspecified Severity medium
: rc
: ---
Assigned To: Joe Thornber
Jakub Krysl
: Regression
Depends On:
Blocks: 1469559
  Show dependency treegraph
Reported: 2017-07-14 08:18 EDT by Jakub Krysl
Modified: 2018-04-10 09:18 EDT (History)
8 users (show)

See Also:
Fixed In Version: device-mapper-persistent-data-0.7.3-1.el7
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2018-04-10 09:17:29 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Proposed patch to reinstate trim and show_duplicates to rpm (4.84 KB, patch)
2017-07-17 07:49 EDT, Alasdair Kergon
no flags Details | Diff

External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2018:0776 None None None 2018-04-10 09:18 EDT

  None (edit)
Description Jakub Krysl 2017-07-14 08:18:53 EDT
Description of problem:
When trying to run 'thin_trim' I get: 
Unknown command 'thin_trim'
This tool is in "rpm -ql device-mapper-persistent-data" and there is a working manpage for it.
This was working in RHEL 7.3 (0.6.3-1.el7.x86_64)

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:

Actual results:
Unknown command 'thin_trim'

Expected results:
Usage: thin_trim [options] --metadata-dev {device|file} --data-dev {device|file}

Additional info:
Comment 3 Alasdair Kergon 2017-07-14 09:54:30 EDT
Comment 4 Jonathan Earl Brassow 2017-07-14 13:04:56 EDT
I consider this to be a 7.5 + 7.4.z bug - not a 7.4 blocker.

We currently don't have a way to activate sub-LVs (metadata and data areas) in LVM that would make it simple to use tools like thin_repair/thin_trim manually.  Thus the number of people impacted by this before we can get a 7.4.z fix out for it would be very small.

Priority may be higher if other dmpd tools were affected, like 'thin_repair', 'thin_dump', etc.
Comment 5 Mike Snitzer 2017-07-14 13:52:57 EDT
thin_show_duplicates also doesn't working.

# for bin in `rpm -ql device-mapper-persistent-data | grep /usr/sbin`; do $bin ; done 2>&1 | grep "Unknown command"
Unknown command 'thin_show_duplicates'
Unknown command 'thin_trim'
Comment 6 Mike Snitzer 2017-07-14 14:15:01 EDT
Seems the quickest "fix" is to update the spec file to %configure using --enable-dev-tools.

Reassigning to Peter to see if he could enable that configure flag and respin for 7.5 (and 7.4.z).  Peter what do you think?
Comment 8 Alasdair Kergon 2017-07-14 19:51:15 EDT
Just changing the flag is insufficient.

Also needs: BuildRequires: ncurses-devel

Installed (but unpackaged) file(s) found:

Should those be shipped too?

Alternatively - the smallest fix - is perhaps just to adjust the #ifdef selection in the source file so that thin_trim and thin_show_duplicates work again.
Comment 10 Alasdair Kergon 2017-07-17 07:49 EDT
Created attachment 1299797 [details]
Proposed patch to reinstate trim and show_duplicates to rpm
Comment 14 Marian Csontos 2017-07-17 09:16:07 EDT
Oh, I see! It's the links are there, but support is not compiled.
Comment 15 Jakub Krysl 2017-07-18 02:58:16 EDT
Check BZ1469178, it is about thin_show_duplicates. It was filed before this and is related to this as thin_show_duplicates got added here. The difference between trim and show_duplicates bug is, show _duplicates is not a regression plus it is also missing a manpage.
There is a part duplicity and I believe it should be resolved based on how this bug will be solved.
Comment 16 Marian Csontos 2017-07-19 05:04:14 EDT
IMO the question is shall we drop them or keep pushing forward basically an useless patch?

Given it is not easy to use these, the simplest fix is to remove the "dangling" symlinks.

If we ever decide to ship these binaries, shall we move them to a subpackage?

As for ZStream eligibility, shall we wait for a request from customer? It does not work in Rawhide, and no one complained yet.

According to commit message 5f879237f5738ec1a66a5ab80eb60bda12256030:

    This builds tools that I want to keep in the same code base, but not
    intended for general release.

thin_trim moved to dev-tools in 03499560152967392a6ee6c1e418d21083eda5e9.

I am submitting a pull request to Joe, to install the symlinks only if configured so rpmdiff would spot the change.
Comment 17 Marian Csontos 2017-09-22 04:40:14 EDT
thin_trim moved to devtools in commit fd02dfa5bf65c5ba127a3da0aad853a88ace47fd and back in f7d79339e8da664d82f32e276a38744f050be9be. Joe, is that intentional?
Comment 18 Marian Csontos 2017-09-22 04:43:30 EDT
thin_show_duplicates half is Bug 1469178
Comment 22 Jakub Krysl 2017-10-09 05:02:07 EDT
Fixed in device-mapper-persistent-data-0.7.3-1.el7.
Comment 25 errata-xmlrpc 2018-04-10 09:17:29 EDT
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.


Note You need to log in before you can comment on or make changes to this bug.