As some of you may know I usually run a Dual boot system, but hey! forget about Windows, I run a Dual boot system with two Linux Distributions, Debian is the sticky one, and for now the other one is Gentoo, before it was Fedora, Mandriva, Ubuntu and Sabayon.

I have to say, that my favorite Distros are Debian and Gentoo, I am just starting with Gentoo, but it is just great!, well enough of blah, blah, I will later write a post about my experiences with Linux Distributions, now I want to let you know how to share the cache of Polipo between two Linux Distros, (in this case Debian and Gentoo), but can work (I am almost sure) between any others.

Maybe this do not have too many practical applications, but for me here in Bolivia where ADSL is expensive, I do not have a real broadband connection, and need to optimize my cache :).

So lets start.

First thing is to move polipo cache to its own partition so you can mount it on each Linux of the dual boot system.

Once that is done, you have to be sure of this:

  1. The same userid run polipo in both distros
  2. The user who runs polipo in both Linux distributions must belong to the same group id
  3. All the files in Polipo cache should belong to that userID and groupID

Number 1

That was the first problem I have to face with, here is how this was in my two Linux.

Polipo was run by user proxy with userID=13 on Gentoo it was polipo with userID=103

I fixed it, using usermod command, I changed on both systems to the same userID in my case 1004 was free on both so I run:

sudo usermod -u 1004 polipo

on the Gentoo and

sudo usermod -u 1004 proxy

on the Debian.

Number 2

Next it was time to solve the groupID problem, (actually I think this was not needed but I anyway did it). Here is how it was.

On the Debian There was a group named proxy with groupIP 13 and on Gentoo there was a group named polipo with groupID 1004.

So I left it as it was on Gentoo, and change on Debian the ID of proxy gruop by editing by hand the /etc/group file, there should be a better way.

Number 3

Now, it is time to make all files belong to the same user and group, so I did this on any of the Distros, and this is only needed once, on any of them (Debian or Gentoo).

sudo chown polipo:polipo /media/sdc5/polipo/ -R

Finishing Now just configure polipo on both systems the same, I mean the cache time should be the same, also the size where the files is trunked, otherwise it will work differently in both Distros, also, you need to add this new partition to /etc/fstab of both, this is the line I added on both of them
/dev/sdc5       /media/sdc5     ext3 defaults           0       2
and have this line on both Distros' /etc/polipo/config files.
diskCacheRoot=/media/sdc5/polipo/
Of course change it according to your needs, and now start enjoying the cached files no matter which Distro you are working on, hope this may help someone, or at least let you see how flexible is Linux