Do you mean that I can have an independent partition on the drive, /data, yet mount it as if it were part of /home/jan, my home directory?
Yes, sort of. The point is that the drive may be your data drive, but /data (with the slash) is a mountpoint, not a drive. If you have several partitions on the drive you can mount any one of them on /data, or /home/jan/data, or /home/jan/my_videos, or actually wherever you want. (With certain exceptions, as for instance under the /proc directory.)
The beauty of Linux/Unix is that you can transparently mount any partition anywhere, and it's just seen as another folder.
But the data partition doesn't become the /data folder (with the slash) unless you mount it there. (You could give it the label "data", and that it would retain wherever you mount it, but you wouldn't see the label in the file hierarchy.)
The slash in /data actually stands for the root directory (/) and indicates that /data is a subdirectory directly under / -- regardless of whether it's just an ordinary folder or a mountpoint for a partition. (Similarly /home/jan/data would be a subdirectory under a subdirectory under a subdirectory under / -- whether it's an ordinary directory or a mountpoint.)
(Note that the root directory is the same as the / directory. The /root directory is something else: the root user's home directory. Slashes are important.)
Can I also do this with /usr and local/usr, which is where my ham radio logging program installs itself (the install has been wrong, so it installs in one of those locations, but all references are to the other location, so I copy it there). In other words, can I create a /usr partition, but mount it elsewhere.
A partition won't be a /usr partition unless it's mounted on /usr. (Although, if you want to confuse people, you may of course
label it "usr", wherever you mount it. The label won't be seen in the filesystem hierarchy though -- except partially if the partition is automounted by HAL.) In your case the easier solution would probably be creating a few symbolic links that would make the system believe that /usr/local/<whatever> is /user/<whatever>.
Is there a reason not to mount either of these under /home/jan?
Well, for that they'd have to be on a separate partition. Even if your present /usr directory is on a partition of its own you have to mount it under /usr or the system won't find it, but if a
subdirectory of /usr is on its own partition you could sometimes give it a mountpoint somewhere else.
You can mount any existing partition anywhere -- under /usr, or anywhere else. But you can't mount
a part of the /usr partition, or a
part any other partition, somewhere else. You
can mount a subdirectory of /usr somewhere else, but only if that directory is on a separate partition.
In other words, you can only mount whole partitions. But I think you could achieve what you want to achieve using symbolic links.
Would this change the internal references in the logging program, making them all wrong? For example, if I were to mount the partition /usr/xlog as /home/jan/usr/xlog, would all the references in xlog still be looking for /usr/xlog, or would they find the correct files in the right place?
That actually depends on how the program was written, on whether it uses relative or absolute addressing. This is true for symlinks too.
Now that I look at it, I am asking whether it is only OK to get away with this mounting scheme when you either manually look in the right place for data files or you have program control over where the program looks. That would mean that it is not OK to mount actual programs in other than the exact place where they look for themselves.
Usually true. But note that if you want to change how you access a folder or a file you don't have to mount them in strange places. As I said, you could simply create a few symlinks.
I feel I've confused you enough. But that was an awful lot of questions.
[/quote]