I am new to Linux, but I'm a fairly experienced Windows user. Despite trawling the internet for hours, buying three different books on Linux, and grilling two of my 'Linux boffin' mates, I still feel I don't fully understand the way Linux partitions and mount points work!
To put this in perspective, I am a C++ programmer, so I have no difficulty getting my head around the idea things like symbolic links, by analogy to pointers in C, or the concept of all my drives/partitions being 'virtually' mounted on a single 'tree'.
So, here are some specific questions, which will hopefully highlight the areas I don't fully understand:
----------
1. In my Linux Administration book, the 'special directories' (boot, home, var etc) are referred to as 'partitions' in quite a few places. Is the writer using the word in a different sense to that of the
"physical, low-level subdivisions of my hard disc"? Or is he just assuming that they have been installed on unique physical partitions, ergo he's using the word 'partition' and 'directory' interchangeably? I do understand that it is possible, at installation time, to allot each of these special directories its own (physical) disc partition; what I don't understand is whether there is a second meaning of the word 'partition' which means "one of these special directories, irrespective of whether it is just a directory within the root (/) partition, or a directory allocated to a physical partition all of its own".
2. When installing SuSE, and trying to set up the physical disc partitions and mounts, I can choose a mount point (e.g. "/" [root], "/home", or "/boot", or "/user") for each partition -- cool. So it seems there is a kind of one-to-one relationship, where each partition can be (optionally) allocated one of the 'special' directories. I have read lots of things about giving certain special directories, such as var, their own partition -- again, cool. E.g. I understand that this can prevent a DOS attack filling up the hard disc with log files. Just for absolute clarity, is there no other way to do this other than allocating var to its own physical partition? I.e. does Linux have no provision for the special 'virtual' directories to have 'virtual size limits', even if several such directories exist on the same disc partition? Or should I think of them as 'virtual directories' rather than 'virtual disc partitions'?
3. Is it normal practice to put other 'special' directories in their own partitions? E.g. on Windows people often put their Program Files on a separate hard disc from Windows itself (e.g. "C:\Windows", "E:\Program Files") for better performance. I can see that this is possible on Linux, by creating a dedicated partition on the second hard disc, and setting the mount point to "/usr" at installation time. Is this the orthodox way to go about it? I can't find any examples of people doing this on the internet, which makes me think maybe it's an odd thing to do in Linux!
4. Am I correct in my understanding that, should I *not* allocate a given 'special' directory to its own partition (e.g. if none of my partitions have the mount point set to "/home") it will instead just be placed within
"whichever partition has the 'root' (/) mount point"? I.e. is the rule essentially
"if a mount point is allocated to a specific partition, put it there, but if not, stick it in the same partition as all the other unspecified mount points"?
5. Assuming I'm understanding everything correctly so far, it seems as though every "special" directory is either (i) on a physical partition of its own, or (ii) in the same partition as all the other "unallocated" special directories. Does this mean it's impossible to have a truly arbitrary distribution of directories across partitions? E.g. it would seem logical (and more space-efficient) to put "/lib", which I understand means "program library files", on the same partition as "/usr" (as it were, "Program Files"). Is this impossible? (it doesn't seem to be possible using the SuSE installer)
6. If what I've just described ISN'T possible at installation time, is it possible to achieve the same effect by physically copying the directories to the partitions where I want them, then changing the boot-time "mountings" so that the special directory "pointers" are transparently linked to the physical directory locations? E.g. if "/var" was originally on partition 1 (say, within the root), but I wanted to move it to partition 2, could I copy var and all its contents to partition 2, then re-mount "/var" so that it pointed to the copy on partition 2? (and then delete the original, redundant directory.) Basically I'm checking my assumption that the mountings work like "pointers" that can be reassigned.
----------
Er, that should do for now! Sorry about the length of my post.
I wish my Linux books had more diagrams and more example scenarios showing what is and isn't possible! I know this isn't rocket science but I'm finding it rather frustrating to get my head around.