Making ports in alternative areas

Jerry McAllister jerrymc at clunix.cl.msu.edu
Fri Oct 21 15:42:37 PDT 2005


> 
> I'm running low on disc space on my /usr partition and I would like to  
> compile a program from the ports that is rather large. I have enough space  
> once it's compiled, it's just the work that I don't have enough space for.  
> how can I get the port to do it's work in a different area on a different  
> partition?

Do you have enough space on another partition to move the whole
ports tree over there?   That would be nicest.   But, the principle
is the same even if you only move that directory.

Make a directory in the larger partition.   If it is for all of ports
I might suggest calling it usr.ports
Tar up the stuff you want to move.
Unroll it in the new roomier space.
Create a symlink to the new space.
You can tar to a pipe and untar from that pipe, but if there is room
I prefer to go to and from a file.   It improves my confidence.

  cd /bigplace
  mkdir usr.ports

  cd /usr/ports
  tar cvf /bigplace/ports.tar *

  cd /bigplace/usr.ports
  tar xvf ../ports.tar

Look at things and make sure it is OK.  Then make links and clean up.

  cd /usr
  mv ports ports.old
  ln -s /bigplace/usr.ports ports
  rm -rf ports.old
  rm /bigplace/ports.tar

Voila, it is in a new place.
You can do essentially the same with a subdirectory of /usr/ports.
Just think out carefully what you are moving where and how you
want the link to be.   

////jerry

> 


More information about the freebsd-questions mailing list