RPM

rpm size estimation does not account hardlinks?

Bug #1176337 reported by Elan Ruusamäe
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
RPM
Confirmed
Wishlist
Unassigned
PLD Linux
New
Undecided
Unassigned

Bug Description

# poldek -u git-core

There are 3 packages to install (2 marked by dependencies):
I git-core-1.8.2.1-1.i686
D perl-Error-0.17016-1.noarch perl-Git-1.8.2.1-1.i686
This operation will use 11.1MB of disk space.
Need to get 2.5MB of archives.
Executing rpm --upgrade -vh --root / --define _check_dirname_deps 1...
Preparing... ########################################### [100%]
error: Install/Erase problems:
        installing package git-core-1.8.2.1-1.i686 needs 61MB on the / filesystem
12:52:22 root[load: 0.22]@vagrant-pld /etc/etckeeper# df
Filesystem Type Size Used Avail Use% Mounted on
rootfs rootfs 1020M 908M 112M 90% /

now i growed disk and tried again:

# df /
Filesystem Type Size Used Avail Use% Mounted on
/dev/sys/rootfs xfs 1.4G 909M 512M 64% /

# poldek -u git-core
...
Processing dependencies...
git-core-1.8.2.1-1.i686 marks perl-Git-1.8.2.1-1.i686 (cap perl(Git))
 perl-Git-1.8.2.1-1.i686 marks perl-Error-0.17016-1.noarch (cap perl(Error))
Package git-core-1.8.2.1-1.i686 suggests installation of:
1. git-core-cvs
2. git-core-svn
3. rsync
Try to install them? (y - all, n - nothing, s - select some of)? [N/y/s] n
There are 3 packages to install (2 marked by dependencies):
I git-core-1.8.2.1-1.i686
D perl-Error-0.17016-1.noarch perl-Git-1.8.2.1-1.i686
This operation will use 11.1MB of disk space.
Need to get 2.5MB of archives.

Executing rpm --upgrade -vh --root / --define _check_dirname_deps 1...
Preparing... ########################################### [100%]
   1:perl-Error ########################################### [ 33%]
   2:perl-Git ########################################### [ 67%]
   3:git-core ########################################### [100%]

# df /
Filesystem Type Size Used Avail Use% Mounted on
/dev/sys/rootfs xfs 1.4G 919M 501M 65% /

git core is a package with files having 112 hardlinks

# rpm -q poldek rpm
poldek-0.30.0-1.rc7.2.i686
rpm-5.4.10-50.i686

Revision history for this message
Elan Ruusamäe (glen666) wrote :
Download full text (57.1 KiB)

git core is a package with files having 112 hardlinks:

# rpm -qlv git-core
drwxr-xr-x 2 root root 0 apr 8 18:31 /etc/git-core
-rw-r--r-- 1 root root 46 apr 8 18:31 /etc/git-core/gitconfig
drwxr-xr-x 2 root root 0 apr 8 18:19 /etc/git-core/templates
drwxr-xr-x 2 root root 0 apr 8 18:19 /etc/git-core/templates/branches
-rw-r--r-- 1 root root 73 apr 8 18:19 /etc/git-core/templates/description
drwxr-xr-x 2 root root 0 apr 8 18:31 /etc/git-core/templates/hooks
drwxr-xr-x 2 root root 0 apr 8 18:19 /etc/git-core/templates/info
-rw-r--r-- 1 root root 240 apr 8 18:19 /etc/git-core/templates/info/exclude
-rwxr-xr-x 112 root root 1405688 apr 8 18:31 /usr/bin/git
-rwxr-xr-x 112 root root 1405688 apr 8 18:31 /usr/bin/git-receive-pack
-rwxr-xr-x 2 root root 582036 apr 8 18:31 /usr/bin/git-shell
-rwxr-xr-x 112 root root 1405688 apr 8 18:31 /usr/bin/git-upload-archive
-rwxr-xr-x 2 root root 602516 apr 8 18:31 /usr/bin/git-upload-pack
drwxr-xr-x 2 root root 0 apr 8 18:31 /usr/lib/git-core
-rwxr-xr-x 112 root root 1405688 apr 8 18:31 /usr/lib/git-core/git
-rwxr-xr-x 112 root root 1405688 apr 8 18:31 /usr/lib/git-core/git-add
-rwxr-xr-x 1 root root 36654 apr 8 18:31 /usr/lib/git-core/git-add--interactive
-rwxr-xr-x 1 root root 22361 apr 8 18:31 /usr/lib/git-core/git-am
-rwxr-xr-x 112 root root 1405688 apr 8 18:31 /usr/lib/git-core/git-annotate
-rwxr-xr-x 112 root root 1405688 apr 8 18:31 /usr/lib/git-core/git-apply
-rwxr-xr-x 112 root root 1405688 apr 8 18:31 /usr/lib/git-core/git-archive
-rwxr-xr-x 1 root root 11427 apr 8 18:31 /usr/lib/git-core/git-bisect
-rwxr-xr-x 112 root root 1405688 apr 8 18:31 /usr/lib/git-core/git-bisect--helper
-rwxr-xr-x 112 root root 1405688 apr 8 18:31 /usr/lib/git-core/git-blame
-rwxr-xr-x 112 root root 1405688 apr 8 18:31 /usr/lib/git-core/git-branch
-rwxr-xr-x 112 root root 1405688 apr 8 18:31 /usr/lib/git-core/git-bundle
-rwxr-xr-x 112 root root 1405688 apr 8 18:31 /usr/lib/git-core/git-cat-file
-rwxr-xr-x 112 root root 1405688 apr 8 18:31 /usr/lib/git-core/git-check-attr
-rwxr-xr-x 112 root root 1405688 apr 8 18:31 /usr/lib/git-core/git-check-ignore
-rwxr-xr-x 112 root root 1405688 apr 8 18:31 /usr/lib/git-core/git-check-ref-format
-rwxr-xr-x 112 root root 1405688 apr 8 18:31 /usr/lib/git-core/git-checkout
-rwxr-xr-x 112 root root 1405688 apr 8 18:31 /usr/lib/git-core/git-checkout-index
-rwxr-xr-x 112 root root 1405688 apr 8 18:31 /usr/lib/git-core/git-cherry
-rwxr-xr-x 112 root root 1405688 apr 8 18:31 /usr/lib/git-core/git-cherry-pick
-rwxr-xr-x 1 root root 99171 apr 8 18:31 /usr/lib/gi...

Revision history for this message
Elan Ruusamäe (glen666) wrote :

rpm 4.5 is affected too:

# rpm -Uhv git-core-1.7.11.1-1.amd64.rpm
Preparing... ########################################### [100%]
        installing package git-core-1.7.11.1-1 needs 24MB on the / filesystem
# rpm -q rpm
rpm-4.5-56.amd64
# df /
Filesystem Type Size Used Avail Use% Mounted on
/dev/hdv1 ufs 1014M 870M 145M 86% /

Jeff Johnson (n3npq)
Changed in rpm:
status: New → Confirmed
importance: Undecided → Wishlist
Revision history for this message
Jeff Johnson (n3npq) wrote :

A proper fix is harder than it seems: there is no tag in metadata that
keeps track of stat(2) st->st_nlink found in the build root.

Instead, RPMTAG_FILEINODES is used to compute the no. of hardlinks.

There are bigger problems with space calculation than not accounting
for hardlink sizes, mostly due to 5% root reserved space estimation.

Finally the error message is difficult to understand because of "needs"
ised in the sense of "... needs an additional ..." amount of space beyond
what is thought to be available (with a heuristic/imperfect adjustment to
account for root reserved space).

Revision history for this message
Elan Ruusamäe (glen666) wrote :

just got hit by this again.

# df /
Filesystem Type Size Used Avail Use% Mounted on
/dev/mapper/sys-cvs xfs 1014M 845M 170M 84% /

# l
total 3,3M
-rw-r--r-- 1 root root 3,3M märts 29 07:08 git-core-2.7.3-1.x86_64.rpm

# rpm -Uhv git-core-2.7.3-1.x86_64.rpm
Preparing... ########################################### [100%]
error: Install/Erase problems:
        installing package git-core-2.7.3-1.x86_64 needs 73MB on the / filesystem

# rpm --version
rpm (RPM) 5.4.15

Revision history for this message
Elan Ruusamäe (glen666) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.