Hiding 'bind' partitions

Craig Hagerman craighagerman at gmail.com
Sun Sep 3 16:57:53 UTC 2006


On 9/4/06, Eamonn Sullivan <eamonn.sullivan at gmail.com> wrote:
> On 9/3/06, Craig Hagerman <craighagerman at gmail.com> wrote:
> > On 9/4/06, Eamonn Sullivan <eamonn.sullivan at gmail.com> wrote:
> >
> > > On 9/3/06, Craig Hagerman <craighagerman at gmail.com> wrote:
> > > > Hi,
> > > >
> > > > I have /home and /usr on a separate partition from /. I have /etc/fstab
> > set
> > > > up like this:
> > > >
> > > > /mnt/home  /home           none    bind            0       0
> > > > /mnt/usr     /usr                none    bind
> >  0       0
> > > >
> > > > This makes them 'appear' to be at /home and /usr respectively. My
> > problem is
> > > > that when I do a find or locate I end up getting duplicate results.
> > e.g.:
> > > >
> > > > /usr/local/java
> > > > /mnt/usr/local/java
> > > >
> > > > Are the same file, but the file system thinks they are separate
> > locations.
> > > > How can I make the /mnt/home and /mnt/usr directories hidden?
> > >
> > > Just out of curiosity, why mount them in two places (/mnt/home and
> > > /home, for example). Why not just mount them once (/home)? I'm sure
> > > I'm missing a good reason for this, so just tell me to go away...
> > >
> > > -Eamonn
> >
> >
> > Ummm.... come to think of it I can't remember why I did that. I think I
> > was/am confused about the correct way to have filesystem directories on
> > another partition. I'll change my question to asking what the correct way to
> > do this is.
> >
> >  Craig
>
> Normally, you can do something like this in /etc/fstab
>
> /dev/hda1     /           ext3       defaults,errors=remount-ro    0       1
> /dev/hda2    /home    ext3       defaults,errors=remount-ro    0       0
> /dev/hda3    /usr       ext3       defaults,errors=remount-ro     0      0
>
> Or something very similar. Sorry, I don't have a live example to paste
> here because at the moment my / (and everything under) is the whole
> drive and /mount/backup is a second hard drive. Someone might be able
> to give you a better example.
>
> -Eamonn
>

Oh - I wrote the above from memory and made a typo. The two
directories are on a single partition like this:  /mnt/hda3/home
/mnt/hda3/usr  I guess I did things with the bind because I didn't
know now to mount a directory (not a partition) on the root
filesystem.




More information about the ubuntu-users mailing list