Bug 60309

Summary: rpm -V doesn't check number of hard links
Product: [Retired] Red Hat Linux Reporter: Han Holl <han.holl>
Component: rpmAssignee: Jeff Johnson <jbj>
Status: CLOSED DEFERRED QA Contact:
Severity: medium Docs Contact:
Priority: low    
Version: 7.2Keywords: FutureFeature
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2002-03-11 10:14:02 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Script to locate broken hardlinks none

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:
Always

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

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.

Cheers,

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.