Skip site navigation (1)Skip section navigation (2)
Date:      26 Mar 2002 10:44:44 -0600
From:      James McNaughton <jtm63@enteract.com>
To:        Annelise Anderson <andrsn@andrsn.stanford.edu>
Cc:        Nick Lozinsky <nl3481@wi.rr.com>, "P.B. Ruiter" <pruiter@indigored.com>, Peter Leftwich <Hostmaster@Video2Video.Com>, FreeBSD Questions <FreeBSD-Questions@FreeBSD.ORG>
Subject:   Re: /usr/home on separate disk?
Message-ID:  <86vgbjjn2b.fsf@jamestown.21stcentury.net>
In-Reply-To: <Pine.BSF.4.10.10203260136170.99653-100000@andrsn.stanford.edu>
References:  <Pine.BSF.4.10.10203260136170.99653-100000@andrsn.stanford.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
Annelise Anderson <andrsn@andrsn.stanford.edu> writes:

> On Tue, 26 Mar 2002, Nick Lozinsky wrote:
> 
> > No, no, no...when you are trying to link a device from /dev, you just specify
> > the device, so do this:
> > 
> > ln -sf /dev/ad1s1e /usr/home
> > 
> > "P.B. Ruiter" wrote:
> > 
> > > I tried
> > >
> > > ln -sf /dev/ad1s1e/usr/home /dev/ad0s1g/usr/home
> > >
> > > which is an Operation Not Supported. How can I distinguish /usr/home on ad1
> > > from /usr/home on ad0?
> > >
> > > ----- Original Message -----
> > > From: "Peter Leftwich" <Hostmaster@Video2Video.Com>
> > > To: "P.B. Ruiter" <pruiter@indigored.com>
> > > Cc: "FreeBSD Questions" <FreeBSD-Questions@FreeBSD.Org>
> > > Sent: Tuesday, March 26, 2002 1:30 AM
> > > Subject: Re: /usr/home on separate disk?
> > >
> > > | On Tue, 26 Mar 2002, P.B. Ruiter wrote:
> > > | > Hi, I just installed a new freebsd box with two ide drives. As I intend
> > > to use this as dedicated file/print/samba server on a mixed small office
> > > network, I thought it a good idea to dedicate one drive to /usr/home. I
> > > installed 4.5-Release as such with default settings for drive 0 and a single
> > > slice /usr/home on drive 1 (and swap on both).
> > > | > Filesystem  1K-blocks     Used    Avail Capacity  Mounted on
> > > | > /dev/ad0s1a    128990    31748    86924    27%    /
> > > | > /dev/ad0s1f    257998        4   237356     0%    /tmp
> > > | > /dev/ad0s1g   9044900   786382  7534926     9%    /usr
> > > | > /dev/ad1s1e  19099614       20 17571626     0%    /usr/home
> > > | > /dev/ad0s1e    257998      738   236622     0%    /var
> > > | > I realize there is already a /usr/home under /usr. How do I get rid of
> > > this and point it to my /usr/home on ad1s1e? I tried rmdir /home within
> > > /usr - this only gave me a busy reply. Please help...
> > > | > Pieter
> > > |
> > > | Assuming both drives are mounted okay, and I don't know much about Samba -
> > > | especially if it "honors" or "comprehends" symbolic links, but you could
> > > | always do something like `ln -sf /dev/ad1s1e /dev/....` etc.
> > > |
> > > | man ln
> > > |
> > > | Hope this helps in no small way ;-)
> > > |
> 
> When you mount /usr/home on the other drive (e) it makes the previous
> /home on /usr inaccessible, as far as I know, but does not destroy it.
> You can experiment by putting a unique file in your /usr/home on
> ad1s1e.
> Without ad1s1e mounted, you should be able to get to the /usr/home on
> ad0s1g.  You could try mv'ing the home to a new name to see if you still
> see it after /usr/home is mounted (thus enable you to move some stuff if
> you like).  Once you start playing with fstab, though, it is good to have
> a strategy for getting back in and fixing things in case you get into an
> unbootable situation, e.g., home directory does not exist. The symbolic
> link for home (to /usr/home) should work for either situation and need
> not be changed, it seems to me.
> 
> I have a couple systems where I use /usr/local (including /usr/local/home)
> as a separate file system, so the various ports as well as my home
> directory get installed there and the base systems stays relatively
> in its original state (and can thus be upgraded from scratch without
> disturbing home directories or installed software.  It depends on what
> you want to do.
> 
> 	Annelise
> 
> -- 
> Annelise Anderson
> Author of: 		 FreeBSD: An Open-Source Operating System for Your PC
> Available from:	 BSDmall.com and amazon.com
> Book Website:    http://www.bittreepress.com/FreeBSD/introbook/	

The answer is simpler than anything I've read so far. According to the
original poster's df output:

Filesystem  1K-blocks     Used    Avail Capacity  Mounted on
/dev/ad0s1a    128990    31748    86924    27%    /
/dev/ad0s1f    257998        4   237356     0%    /tmp
/dev/ad0s1g   9044900   786382  7534926     9%    /usr
/dev/ad1s1e  19099614       20 17571626     0%    /usr/home
/dev/ad0s1e    257998      738   236622     0%    /var

the filesystem on ad1s1e is mounted on /usr/home and no further action
is necessary. This is exaclty what you want. The directory /usr/home
on ad0s1g is the _mount_ _point_ for the file system on ad1s1e.

If this file system was created during installation, then that should
be good as is. However, if file hierachies were created on disk 0
under /usr/home prior to the second disk being newfsed and mounted,
there may be inaccessible files under /usr/home which reside on disk
0. If this is the case and you want access to all the files (from both
disk 0 and disk 1) you can use the union option for mount. Read the
man page for mount for details.

Alternately, you can "mkdir /usr/home2 ; mount /dev/ad2s1e
/usr/home2". But this may complicate things.

Best wishes..

Jim


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?86vgbjjn2b.fsf>