[pacman-dev] Pacman Disk Space Issues

Teran McKinney sega01 at go-beyond.org
Fri Feb 20 09:29:11 EST 2009


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Hey,

I've personally ran into this before, but don't think that it is worth
"fixing" in the current Pacman setup. User error is usually the cause of
this, since an admin should always have adequate disk space before
installing new packages. Preventing this is difficult, like Brendan
said, available disk space may be taken by other causes when Pacman is
running. Not to mention, some users like to split the filesystem into a
multitude of partitions.

However, I do have one unlikely suggestion that *could* combat this
without much difficulty. I was thinking of this more to (partially)
solve the issue of package updates being cut short by a hard shutdown.
Basically, packages would be extracted to /var/lib/pacman/extract (or
similair), and if extraction has not errored, files would be moved to
their corresponding locations. This would keep the new, possibly
incompatible files out of the system until they can almost instantly be
moved over, except in the case of /var, or others being on different
partitions. This has the drawback that the user must have roughly
installed size*2 disk space free, since the old package and new package
would both have to be extracted at once (I personally think this is
almost a non-issue). The current Pacman implementation may already
require that much free disk space, but I'm not sure.

An alternative to the above is to create directories in the folders
that the package extracts to, such as .pacextract in /bin. This would
insure that all mounted partitions get a fast rename/move, mitigating
potential data loss and allowing for perfect disk space checking. It
could be done so that the .pacextract feature only runs on the bottom 2
or 3 directories (/usr, /usr/local, but not /usr/share/man/man8, which
would have .pacextract/man8 in /usr/share/man), or on a predetermined
set of directories in pacman.conf. I think my explanation might be a
little confusing, so I will write it out in approximate psuedo-shell
script.

mkdir /usr/bin/.pacextract
tar xf xz-4.999.8beta-1.pkg.tar.gz -C /usr/bin/.pacextract (with other
flags so that tar only extracts the archive contents of /usr/bin)
mv /usr/bin/.pacextract/* /usr/bin && rm -r /usr/bin/.pacextract

The simpler (extract to /var/lib/pacman/extract) method does not offer
the fast move when multiple partitions are used and perfect disk space
utilization checking, but would be easier to code. Anyways, this
idea is quite experimental. I do think it would thoroughly solve the
disk space without too much difficulty, but I personally wouldn't use it
soley for that.

Cheers,
Teran
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.10 (GNU/Linux)

iF4EAREIAAYFAkmevj0ACgkQPsLC06eiyfHnKAD9H0nTW2EU8Z46rjh3PvZD+LT2
mjUUCvhBtuX6xyQANoIA/ipz7RN87qtEJT+N2J295GcqNQ66PUKbppcrM85qh6eL
=LgkR
-----END PGP SIGNATURE-----


More information about the pacman-dev mailing list