Bug 60309 - rpm -V doesn't check number of hard links
rpm -V doesn't check number of hard links
Status: CLOSED DEFERRED
Product: Red Hat Linux
Classification: Retired
Component: rpm (Show other bugs)
7.2
All Linux
low Severity medium
: ---
: ---
Assigned To: Jeff Johnson
: FutureFeature
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2002-02-25 06:40 EST by Han Holl
Modified: 2008-05-01 11:38 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2002-03-11 05:14:02 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
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 05:09 EST, Han Holl
no flags Details | Diff

  None (edit)
Description Han Holl 2002-02-25 06:40:10 EST
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 13:53:41 EST
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 05:09:18 EST
Created attachment 48093 [details]
Script to locate broken hardlinks
Comment 3 Han Holl 2002-03-11 05:13:58 EST
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 08:45:48 EST
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.