Subject: Re: filesystem hierarchy
To: None <port-macppc@netbsd.org>
From: Jeff Fry <jefffry@compuserve.com>
List: port-macppc
Date: 04/03/2004 06:10:53
On Friday, April 2, 2004, at 11:46 PM, Kirill Levchenko wrote:

> I will give it a shot. You may also find the NetBSD guide useful. It 
> can be found on the Documentation and FAQs page:
>
> 	http://www.netbsd.org/Documentation/

Thanks. I've been working my way through the Guide for several days 
now. That's how I got "sidetracked" with hier(7) and the filesystem 
hierarchy stuff. :-)


> I don't know how well you are familiar with Unix in general, so this 
> may be something you already know. In Unix, file systems (e.g., drive 
> partitions, network file systems, special file systems like kern) are 
> "mounted" at certain points in the root file system. You can think of 
> it as replacing a particular directory with the root of the mounted 
> file system. In your case, it looks like the root file system comes 
> from the a partition, and then /usr comes from g. Put another way, the 
> file system on partition a is your root file system, and the file 
> system on g is mounted at /usr. If you have other partitions (e.g., 
> from other disks), you can mount them at any point you want. Mounting 
> a file system is done using the mount command, and at startup, 
> /etc/fstab is read and all the file systems specified there are 
> mounted. It looks like you also have /kern, which I will mention 
> later. If this concept of mount points still doesn't make sense, it's 
> okay; it will eventually. Just remember, unlike MacOS or Windows, 
> another disk/partition/cdrom need not appear "on the desktop" or "My 
> Computer", but can be anywhere in the file system you want.

I have limited experience working with Mac OS X's (10.2.8) Darwin 
(BSD). I'm currently reading several books, on-line documentation, 
etc., trying to learn about BSD/Unix. I understand the basic premise of 
the partitions, as explained in the NetBSD/macppc Partitioning HOW_TO. 
Your explanation has shed additional light on the subject for me.


> > hier(7) describes /dump/ "online dump(8) repository". I
> > don't have this directory. Would I need to create this
> > myself, if I desired to save a 'dump' or 'rdrump' to this
> > drive (which may not make sense)?
>
> I think is for doing network backups from other machines. That is, the 
> backups from other machines on your network are put in your dump 
> directory. You don't need to worry about this unless you are at the 
> point where you're setting up a network and want to make backups.

Not yet, but I hope to eventually use the NetBSD machine as a server on 
my LAN.


> I have a feeling hier has not been updates in a long time :)

That seems to be an accurate assumption. :-)


> /kern is a special type of file system which gives you access to 
> kernel information as regular files. (see mount_kernfs(8)) Have a 
> look. Try, for example, "cat /kern/hz" This should tell you your 
> processor speed. Recall that I said a file system can be mounted at 
> any point. Well, you can have this kern file system (i.e., the 
> directory containing these special files) anywhere you want, not 
> necessarily /kern, though that is the convention. For example, you 
> could create "/foo" and mount the kern file system there. You can have 
> it mounted in two different places if you want.
>
> The /usr/src/sys/kern directory contains the kernel sources. If you 
> download the source (or get it from CD-ROM), this is where it will 
> reside. It is related to the kern file system in name only.

Ok, thanks. It's starting to make sense to me.

I suppose that I'm getting tripped up by the lack of clarity and 
consistency in, and the general lack of organization of, the NetBSD and 
Unix documentation. The documentation seems to be written by and for 
people who already understand the subject matter, which is not very 
helpful for the inexperienced person who is trying to learn about the 
BSD/Unix system. Hopefully, a couple of the books that I've purchased 
might explain things in terms that a new Unix user can understand and 
grasp.


> > hier(7) describes /amd/ "home directories mount point". I
> > don't have this directory.
>
> You only need it (and would have to create it) if you intend to use 
> amd. Amd is the automounter daemon, which is a special program which 
> automatically mounts file systems for you. Recall that you have to 
> mount file systems either at startup by including them in your 
> /etc/fstab, or manually using the mount command. Since this was not 
> always convenient, amd was created to mount and unmount systems 
> automatically when needed. (Think of network file systems) You won't 
> need to run amd on a basic system.

Thanks for the clarification.


> People care and want to help, but it takes time to write a useful 
> reply. It may be better to post your questions to the netbsd-help 
> mailing list, as (1) there are probably more people reading it, and 
> (2) port-macppc is typically for issues specific to NetBSD on 
> PowerMacs or PowerMac clones.

OK, thanks.


> If you have further questions, I would be happy to answer them as best 
> as I can, time permitting.

I greatly appreciate your assistance. You have already added clarity.

At this point I should probably further explore the available 
documentation that I have access to, and see if it makes more sense as 
I go along. I knew that installing and learning to use NetBSD would 
come with a steep learning curve. It's frustrating trying to make sense 
of documentation that's written for those who already know the subject 
matter well. Unfortunately, the lack of a well-defined, organized 
"roadmap" for new users to follow, while attempting to learn about the 
NetBSD system, adds further confusion and frustration, and makes the 
journey that much more difficult and time-consuming. I'll soldier on. 
:-)

Thanks,
Jeff