Re: mount --bind question.
From: Floyd Davidson (floyd_at_barrow.com)
Date: 09/29/03
- Next message: Toby A Inkster: "Re: mount --bind question."
- Previous message: Martin Zabadal: "Samba & roaming profiles duplicating"
- In reply to: Andy Baxter: "mount --bind question."
- Next in thread: Toby A Inkster: "Re: mount --bind question."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 28 Sep 2003 22:27:58 -0800
Andy Baxter <news2@earthsong.null.free-online.co.uk> wrote:
>Is there any advantage in using mount --bind to mount a subdirectory of a
>mounted volume somewhere else in the filesystem, rather than simply using a
>symlink?
I don't know the answer to that.
>The situation in question is I'm trying to split my filesystem between two
>hard disk partitions; one which contains everything which would be
>automatically reinstalled if I had to install from scratch, and another
>which contains all the data I've either created or downloaded.
I would *highly* suggest more than two partitions; more like one
for each of /, /boot, /usr, /var, /home and /usr/local, and then
something specific for whatever disk space you have left.
But, if you insist...
>So far I have a partition which mounts as /mnt/dat which has the home
>directories, /var (because mysql puts data there, apt caches downloaded
One point to note, no matter which way you do this, is that /tmp
and /usr/tmp should be symlinked to /var/tmp.
>.debs there, and apache is configured to use /var/www in debian, though I
>guess I could change these), and /usr/local. At the moment, these are put
>back into the right place in the filesystem through symlinks in the root
>directory tree, but I'm wondering if it would be better to use mount
>--bind?
The concept of symlinks was added to unix for the express
purpose of what you are doing. Prior to that, if you had
guessed wrong and ended up with a filesystem that someday ran
out of space, it was really a case of going back to the drawing
board (it's a royal pain to repartition and restore everything
from backup, and prone to horror stories if the backups turned
out to be bad for some reason).
But, you have the basic idea correct. The only suggestion I
would make is that you not use /mnt/dat as the point to mount
the second partition. Putting a number of directories in /mnt
seems to be something some people do these days, but if you do
that at least make them all *temporary* mount points, not
permanent ones. Personally I use things like /mnt, /mnta, and
/mntb for most temporary mounts such as floppies, cdroms, etc.
(That should pin down, for old timers at least, just how long
I've been using unix.)
There have been a number of ways people traditionally mount
extra disk space, or "utility" partitions that are not directly
in the standard directory tree. One is the use /usr1, /usr2,
/usr3, ... and so on. Another (which I use) is /u1, /u2, /u3,
and so on. Typically some directories that are often mounted as
separate filesytems might instead just be symlinks to
directories like /u2/home or /u1/local (for /usr/local), and so
on. Large packages such as TeX, XEmacs, X11R6 and so on might
actually be linked to directories on these filesystems.
>A problem with this seems to be that there isn't an option I can put in
>fstab to do this, so I'd have to write a custom init script to do it.
Welll, I haven't tried it, but you should be able to use "bind" as
an option, just like "user" or "ro", in the fourth field of your
/etc/fstab file.
That does sound interesting, and it also provides a clean way to
see what you've done too, because df is going to report all such
mounts.
-- Floyd L. Davidson <http://web.newsguy.com/floyd_davidson> Ukpeagvik (Barrow, Alaska) floyd@barrow.com
- Next message: Toby A Inkster: "Re: mount --bind question."
- Previous message: Martin Zabadal: "Samba & roaming profiles duplicating"
- In reply to: Andy Baxter: "mount --bind question."
- Next in thread: Toby A Inkster: "Re: mount --bind question."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|