Re: Incorrect "no room" message on nfs-mounted /var/lib/dpkg
On Mon, 17 Nov 1997, David Gaudine wrote:
>
> I installed the Debian 1.3.1 base system from diskettes, on a system that
> has only 32 megs disk space (not counting the swap partition).
> I copied /usr and /var/lib/dpkg to a larger system (this one) and did
> NFS mounts;
>
> Filesystem 1024-blocks Used Available Capacity Mounted on
> /dev/hda1 31724 7096 22990 24% /
> annette:/linuxsrv 474227 263166 186567 59% /linuxsrv
> annette:/linuxsrv/huey_usr
> 474227 263166 186567 59% /usr
> annette:/linuxsrv/huey_dpkg
> 474227 263166 186567 59% /var/lib/dpkg
>
> I then tried to complete the installation by using dselect to install
> the default list of packages by ftp. Everything proceeds as expected
> until it's ready to download the packages. Then, after the list of
> required packages, I get
>
> Approximate total space required: 33224k
> Available space in debian: 59%k
>
> and it refuses to download more than two or three packages. This is my
> second attempt at the installation, the first time the message was
>
> Available space in debian: k
>
> If I do the installation without using NFS mounts, the available space
> is displayed correctly, but is too small to be useful.
>
> Any ideas? How does dpkg-ftp determine the available disk space?
> If all else fails I'll get a CDROM and try again, which I've avoided
> so far mainly because I'd have to use NFS to access the cdrom, and
> probably run into another set of problems.
I looked into it and I know why this goes wrong. The install script runs
the 'df' command on /var/lib/dpkg and then uses awk to take the fourth
element of any line containing a slash (/). In your case, the output of
'df /var/lib/dpkg' would be:
Filesystem 1024-blocks Used Available Capacity Mounted on
annette:/linuxsrv/huey_dpkg
474227 263166 186567 59% /var/lib/dpkg
And the result after piping through awk:
<empty line here>
59%
This is where is goes wrong, obviously. I think this is a bug in dpkg-ftp.
The quick fix you can apply is to change /usr/lib/dpkg/methods/install,
but you must be very careful if this script is also used on the nfs
server, because it is likely to break dpkg-ftp on the server. I admit it
is a quick-and-dirty fix, but here it is:
Change the line
$avsp = `df -k $::dldir| awk '/\\// { print \$4}'`;
to
$avsp = `df -k $::dldir| awk '/\\// { print \$3}'`;
Again: WARNING, you should know what you are doing and not complain if
dpkg-ftp stops working on the server. It probably will until you change it
back.
Remco
--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-user-request@lists.debian.org .
Trouble? e-mail to templin@bucknell.edu .
Reply to: