2

I'm trying to update opensuse from version 11.4 to 12.1. The required download size is more than 1.0 GB, but my filesystem /var is precisely 1.0 GB, that's why zypper stops while downloading .rpm packages because of lack of space in /var.

What solutions are there to this problem?

Decado
  • 1,949
  • 11
  • 17
user1088224
  • 131
  • 1
  • 3

2 Answers2

3

Increase the space in /var by re-sizing things.

Figure out where the download is going to /var/tmp,/var/cache/, or somewhere else. Mount-bind or symlink it over to somewhere else with enough space while you do the upgrade (you may have to copy some files over.

If you had lots of space in /srv and no space in /var, and the downloads go to /var/cache, then you might do something like this.

lsof -n | grep '/var/cache'
# stop anything using that folder
rsync -va /var/cache /srv/tmp_var_cache/
mount -o bind /srv/tmp_var_cache /var/cache/
# restart anything you stopped.
Zoredache
  • 128,755
  • 40
  • 271
  • 413
  • Thanks a lot for the answer! Downloading (.rpm packages) is going to /var/cache. I made rsync and mount, but /srv/tmp_var_cache has the same size as /var (1.0 GB) :) i.e. we got two input points for /var. And I tried updating, but got the same problem again( – user1088224 Dec 22 '11 at 14:04
1

I'm sorry, while the idea is sound (use space in /srv instead of in /var), the suggested solution is majorly wrong.

mount  --bind 

makes a directory alternatively available in a new place. It's effectively a hard link for a directory (that also doesn't need to stay in the same filesystem, as hard links have to do). You still don't get any more space in either /var/cache or /srv/tmp_var_cache with that, as they're the same thing after the mount --bind.

What you want is use /srv/tmp_var_cache instead of /var/cache. And you only need to do this for package management, that is /var/cache/zypp, not for the whole of /var/cache, and you can just use a symbolic link, not a mount --bind. Therefore the solution is like this:

# move content (will take a while)
mv /var/cache/zypp /srv/tmp_var_cache_zypp
# Create pointer
ln -s /srv/tmp_var_cache_zypp /var/cache/zypp

If you wanted to use mount --bind, what you need is

# move content (as above)
# create mount point
mkdir /var/cache/zypp
# mirror directory
mount --bind /srv/tmp_var_cache_zypp /var/cache/zypp

You need to run the mount --bind after every reboot and before the automatic update check starts, or there'll be hell's bells. I'd try the symlink first...

Of course the other thing to look at is whether to just change the location of the package cache in /etc/zypp/zypp.conf ...

Jenny D
  • 27,358
  • 21
  • 74
  • 110
Volker
  • 11
  • 2