[lug] Linking one partition to another for more room

D. Stimits stimits at idcomm.com
Mon Dec 10 15:16:26 MST 2001


rm at fabula.de wrote:
> 
> On Mon, Dec 10, 2001 at 08:37:11AM -0700, Dhruva B. Reddy wrote:
> > Have you tried:
> >
> > $ mv /var/cache /usr/local/var-cache # Or whatever you want to call it
> > $ ln -s /usr/local/var-cache /var/cache
> 
> something i wouldn't do on a running server ...
> 'mv' over partition boundaries will copy/delete files. Any process
> that has a file descriptor of a file in /var/cache ... open will happily
> read write to the open file and not to the newly create one in /usr/local/var...

He could do this with other than the entire var-cache.
cd /usr/local
mkdir var
cd var
mkdir cache
cd cache
mkdir redcarpet
cd /var/cache/redcarpet
mv packages /usr/local/var/cache/redcarpet/
ln -s /usr/local/var/cache/redcarpet/packages .

Then cd to /usr/local/var/ and be sure permissions of this directory
matches /var/, then the same for matching /usr/local/var/cache/, and
/usr/local/var/cache/redcarpet/

Some var traffic might be reduced during this by running "init 2" to
close down a few things, doing this job, then going back to either
regular multiuser console mode (init 3) or gui mode (init 5).

D. Stimits, stimits at idcomm.com

> 
> > I've never tried this myself.  Is there any reason this wouldn't work?
> 
> It will probably work fine for desktop machines, but i would be rather
> carefull with servers (the story behind this: a file will only get deleted
> by the OS once the last file descriptor pointing to is closed - hence there
> is no 'delete' command/function, only an unlink one. One commom trick, esp.
> for server processes, to keep a 'private' file is to open it and the unlink it
> without closing the file descriptor. The file will disapear from directory
> listings and will be unaccessible to other processes but is still available for
> access by the creating process).
> 
>  Ralf
> 
> >
> > Dhruva
> >
> > On Mon, Dec 10, 2001 at 07:13:09AM -0700, quoth BOF:
> > > Hello,
> > >
> > > How can I link one partition to another where I have more disk space?
> > >
> > > I was trying to download Ximian yesterday and its installation file
> > > insisted on placing the files into /var/cache and its .rpm files into
> > > /var/cache/redcarpet/packages. I had no control over this, as the
> > > installation file was a binary file. My /var partition is very small and
> > > I soon ran out of room.
> > >
> > > There is lotsa room on my /usr/local partition. Is there a way to link
> > > /var/cache and its subdirectory /var/cache/redcarpet/packages to a
> > > directory on /usr/local to allow the download and then fake out the
> > > installation program so that it will install?
> > >
> > > Thanx.
> > >
> > > BOF
> > _______________________________________________
> > Web Page:  http://lug.boulder.co.us
> > Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug
> _______________________________________________
> Web Page:  http://lug.boulder.co.us
> Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug



More information about the LUG mailing list