Bug 60309 - rpm -V doesn't check number of hard links
Summary: rpm -V doesn't check number of hard links
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: rpm   
(Show other bugs)
Version: 7.2
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Jeff Johnson
QA Contact:
Keywords: FutureFeature
Depends On:
TreeView+ depends on / blocked
Reported: 2002-02-25 11:40 UTC by Han Holl
Modified: 2008-05-01 15:38 UTC (History)
0 users

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2002-03-11 10:14:02 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Script to locate broken hardlinks (1.27 KB, patch)
2002-03-11 10:09 UTC, Han Holl
no flags Details | Diff

Description Han Holl 2002-02-25 11:40:10 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.8+) Gecko/20020208

Description of problem:
If files in a rpm that ought to be hardlinks are accidentally
copied to separate files, rpm -V ought to report this.
In a directory tree like /usr/lib/locale this can cost as
much as 80Mb. (Hard links are evil).

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

How reproducible:

Steps to Reproduce:
1.cd /bin; rm zcat; cp gzip zcat
2.rpm -V gzip

Actual Results:  No errors

Expected Results:  It would be nice if rpm could warn about the
numer of hard links for gzip, gunzip and zcat that are wrong.

Additional info:

Comment 1 Jeff Johnson 2002-03-09 18:53:41 UTC
An rpm header does not carry the number of
hard links as an explicit tag value. That
means nlinks has to be computed. Since
both the build side and the install side
of rpm permit "partial hard link sets"
(i.e. only some of the hard links are
actually installed), this becomes a
large and intensive calculation.

Not worth the effort at the moment.

Comment 2 Han Holl 2002-03-11 10:09:18 UTC
Created attachment 48093 [details]
Script to locate broken hardlinks

Comment 3 Han Holl 2002-03-11 10:13:58 UTC
Sounds reasonable.
But how about a script like the one I've attached that will
locate files that _ought_ to be hardlinks according to the
RPM database ?
Maybe sich a script could be linked to with something like
rpm --check-hardlinks ?
I still feel that broken hardlinks can cost you a lot of diskspace,
and the may potentially mess up upgrades.


Han Holl

Comment 4 Jeff Johnson 2002-03-11 13:45:48 UTC
The script looks OK, but has little to do with
rpm package management IMHO.

You can add to the rpm command line if you
wish, see /usr/lib/rpm/rpmpopt-X.Y.Z for
numerous examples. Basically you need to put
your script in /usr/lib/rpm/check-hardlinks
and add to /etc/popt a line like
	rpm exec --check-hardlinks check-hardlinks
to be invoked as
	rpm --check-hardlinks

FWIW, packages managed by rpm do not have broken
hard links. Also, since there are numerous issues
with "partial hard link" sets and the management
thereof, so I'd rather not add the script to rpm's
default configuration at this time.

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