Welcome to Linux Forums! With a comprehensive Linux Forum, information on various types of Linux software and many Linux Reviews articles, we have all the knowledge you need a click away, or accessible via our knowledgeable members.
Find the answer to your Linux question:
New to Linux Forums? Register here for free!
    Linux Forums > GNU Linux Zone > Linux Newbie > getting my head around Linux file systems, partitions and mount points

Forgot Password?
 Linux Newbie   If you're new to the wonderful world of Linux, start here!

Site Navigation
Linux Articles
Linux Forums
Linux Downloads
Linux Hosting
Free Magazines
Job Board
IRC Chat
RSS Feeds


Linux Forum Topics
Linux Forums
Your Distro
Linux Resources
GNU Linux Zone
The Community
Reply
 
Thread Tools Display Modes
Old 09-30-2006   #1 (permalink)
Just Joined!
 
Join Date: May 2006
Posts: 13
Question getting my head around Linux file systems, partitions and mount points

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.
LiquidEyes is offline  


Reply With Quote
Old 09-30-2006   #2 (permalink)
Super Moderator
 
devils casper's Avatar
 
Join Date: Jun 2006
Location: Chandigarh, India
Posts: 21,058
Send a message via Yahoo to devils casper
Hi !

you already answered most of stuff in questions only..

1-2-5. --- you can install filesystem in ONE partition under / (root) or install all these folders ( parts of File System ) in different partitions. e.g. /home as folder under root or a separate partition for Home. separate partitions acts as a folder under root. there is no size limit for folder or partition but you can assign 'quotas' for folders.

3. it depends... i usually create separate partition for home only....

4. again... its on you.. best option is... go with installer defaults.

6. its possible but setting all pointers is not easy task.





casper
__________________
It takes a lot of time to be a genius, you have to sit around so much doing nothing, really doing nothing. - Gertrude Stein
New Users: Read This First
devils casper is offline   Reply With Quote
Old 09-30-2006   #3 (permalink)
Just Joined!
 
Join Date: May 2006
Posts: 13
Quote:
Originally Posted by devils_casper
there is no size limit for folder or partition but you can assing 'quotas' for folders.
If you can assign quotas, why would anyone want to create a separate partition? Or is that 'dated' advice?

Quote:
6. its possible but setting all pointers is not easy task.
What's so difficult? Is the problem that there are lots of 'hard links' everywhere that explicitly expect the files to be on the same physical disc?

Presumably 'soft links' (pointing to the moved folder) would not be affected by doing what I described? (because /var is /var, regardless of which disc it's on?)
LiquidEyes is offline   Reply With Quote
Old 09-30-2006   #4 (permalink)
Super Moderator
 
devils casper's Avatar
 
Join Date: Jun 2006
Location: Chandigarh, India
Posts: 21,058
Send a message via Yahoo to devils casper
Quote:
If you can assign quotas, why would anyone want to create a separate partition? Or is that 'dated' advice?
i already wrote "it depends on you". you can set quota for user's home or create new partition. Linux is full of choices.

Quote:
What's so difficult? Is the problem that there are lots of 'hard links' everywhere that explicitly expect the files to be on the same physical disc?
yes ! you have to assign new links.... soft links are not a problem...



casper
__________________
It takes a lot of time to be a genius, you have to sit around so much doing nothing, really doing nothing. - Gertrude Stein
New Users: Read This First
devils casper is offline   Reply With Quote
Old 09-30-2006   #5 (permalink)
Just Joined!
 
Join Date: May 2006
Posts: 13
Quote:
Originally Posted by devils_casper
i already wrote "it depends on you". you can set quota for user's home or create new partition. Linux is full of choices.
What I mean is: what are the pros and cons of quotas versus separate partitions, if both have the same effect of limiting space?

I can only think of 'cons' of having separate partitions, which is why I asked "why would anybody do it that way rather than using quotas?"
LiquidEyes is offline   Reply With Quote
Old 09-30-2006   #6 (permalink)
Super Moderator
 
devils casper's Avatar
 
Join Date: Jun 2006
Location: Chandigarh, India
Posts: 21,058
Send a message via Yahoo to devils casper
if you have a separate Home partition then during Linux Upgrade, you wont have any problem. its safe to have Home on separate partition. you can recover data easily. in case, Home partition runs out of space, you can attach new disk and mount home on that.




casper
__________________
It takes a lot of time to be a genius, you have to sit around so much doing nothing, really doing nothing. - Gertrude Stein
New Users: Read This First
devils casper is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Free Magazines
Run Your Own Web Server Using Linux & Apache - Free 191 Page Preview
Learn about everything you'll need to build and maintain your Linux servers, and to deploy Web applications to them.
subscribe
Open Source Security Myths Dispelled
Dispel the five major myths surrounding Open Source Security and gain the tools necessary to make a truly informed decision for your IT organization
subscribe
InformationWeek
InformationWeek is the only newsweekly you'll need to stay on top of the latest developments in information technology.
subscribe



All times are GMT. The time now is 07:18 AM.






© 2000 - 2009 - All Rights Reserved - Property of  MAS Media

Content Relevant URLs by vBSEO 3.3.0 RC2