[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Linking a directory



On Fri, Nov 08, 2002 at 09:57:24AM -0600, Aaron Cronkright wrote:
> my /home partition is 96% full.  However my /usr partition has plenty
> of space to spare. What I have done is created a directory under /usr
> and copied all of the contents of the customer's home directory to it.
> Example: cp -R /home/userdir/* /usr/ftp/userdir/
> 
> Now, my challenge is trying to provide a link in the /home directory
> to the new directory such as: ln -d /usr/ftp/userdir/ /home/userdir so
> I don't have to configure 30+ workstations on the LAN to point at a
> new share.

Just "ls -s /usr/ftp/userdir /home/userdir" would work, but I have a
better idea.  Assuming the box in question is running a 2.4.x kernel,
you can use "mount --bind /usr/ftp/userdir /home/userdir".  Then there
is no symlink.  Add the following to /etc/fstab so it works on boot:

    /home/userdir    /usr/ftp/userdir    none    bind    0 0

Of course, the *real* answer for the future is to use LVM so that you
can just use e2fsadm to shrink /usr and grow /home.  (Since they are
adjacent partitions, you could do it now without LVM, but it is
*really* painful.)

One other thought...  You'd get a little bit of space back if you
unmounted /home and did "tune2fs -r 0 /dev/sda3" to set the reserved
block count to 0 on that filesystem.

Steve
-- 
steve@silug.org           | Southern Illinois Linux Users Group
(618)398-7360             | See web site for meeting details.
Steven Pritchard          | http://www.silug.org/

-
To unsubscribe, send email to majordomo@silug.org with
"unsubscribe silug-discuss" in the body.