LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Hierarchy (https://www.linuxquestions.org/questions/linux-newbie-8/hierarchy-922075/)

jorran 01-04-2012 04:44 PM

Hierarchy
 
I know the basic hierarchy:
/
/bin
/boot
/dev
/etc

and so on...

my question is - are their specific ways to mount these?

As in, should mount /bin, /boot. /dev, /etc and so on all on their own.. or how are they grouped together?

I am also interested to know what the standard size is to set each one that I mount..

I have looked on here: http://tldp.org/LDP/Linux-Filesystem-Hierarchy/html/

That gave me great detail for the hierarchy but nothing on sizes and what goes where exactly.

any suggestions where else to look. I keep looking but no luck yet.

Thank you

Cultist 01-04-2012 05:32 PM

It all depends on your partitioning scheme. Most people just have three partitions - / (root), /home, and swap. Except for /home, / contains all of those directories, and they don't have to be mounted - they're all grouped together and become available when / is mounted (usually at startup). Of course, you could have a separate partition for every one of those, but it isn't normally necessary or helpful.

So as for mounting, you'll generally only have two things to mount - / and /home, and both of which are typically automounted at system boot.

jorran 01-04-2012 06:44 PM

Any suggestion on the standard size of these partitions? I am just trying to get together a standard so if we decide to rebuild we rebuild them all the same exact way.

Cultist 01-04-2012 06:53 PM

It depends on how much space is available. My computer has two harddrives of 500gb each, so I use one drive just for root and swap and the other just for /home.

But depending on you distro and what exactly will be done with the drive (and of course how much space is available), go with 30gb at a very minimum, and maybe 100gb for a reasonable workstation (unless you plan to have a lot of high space apps in root). Give all the rest of the drive to /home, which is where all of your user settings and personal files will be saved.

For your swap partition, size it to anywhere between half and double the amount of ram on the computer.

This is assuming a 3 partition setup like the one I described in my first post (root, /home, swap)

jorran 01-04-2012 07:08 PM

Quote:

Originally Posted by Cultist (Post 4566321)
It depends on how much space is available. My computer has two harddrives of 500gb each, so I use one drive just for root and swap and the other just for /home.

But depending on you distro and what exactly will be done with the drive (and of course how much space is available), go with 30gb at a very minimum, and maybe 100gb for a reasonable workstation (unless you plan to have a lot of high space apps in root). Give all the rest of the drive to /home, which is where all of your user settings and personal files will be saved.

For your swap partition, size it to anywhere between half and double the amount of ram on the computer.

This is assuming a 3 partition setup like the one I described in my first post (root, /home, swap)

Available space is not an issue - we are working with 8tb of files being viewed by thousands of customers every hour.. the distro ranges from RHEL 5.2 - 5.5.

I understand what root and /home are - what is swap for?

Cultist 01-04-2012 07:14 PM

Quote:

Originally Posted by jorran (Post 4566336)
Available space is not an issue - we are working with 8tb of files being viewed by thousands of customers every hour.. the distro ranges from RHEL 5.2 - 5.5.

I understand what root and /home are - what is swap for?

Swap is virtual memory. Its the space used to hold excess data from the ram, and where the ram content is stored when a computer is put into hibernation/sleep.

jorran 01-04-2012 07:22 PM

So would you say the website I posted is pretty accurate?

http://tldp.org/LDP/Linux-Filesystem-Hierarchy/html/

its a little confusing at first simply because it doesnt say if everything listed is under /, /home or swap...

Gomer_X 01-04-2012 07:30 PM

Quote:

Originally Posted by jorran (Post 4566354)
So would you say the website I posted is pretty accurate?

Yes, but it doesn't have anything to do with partitioning. The Linux filesystem is monolithic. It's one big filesystem, but it can be made up of many parts and partitions. If you want, you can mount a CD as a directory.

Swap isn't part of the filesystem, so it won't be in the hierarchy. The filesystem hierarchy and how you partition and mount drives are unrelated.

Cultist 01-04-2012 07:33 PM

its accurate, but it isn't telling you the information you're looking for.

A linux install is, at its simplest level, a collection of folders each containing various directories and files. everything in a linux install is mounted at / (the root filesystem).

Where partitions and mounting come into play is just based on what actual harddrive and partition contain the individual directories.
To use the 3-partition setup I gave above, you would only actually mount / and /home. All of the directories in that webpage (/etc, /var, /usr, /sbin, and so forth) except for /home are located on the / partition, and so would automatically be there when / is mounted. The /home partition is mounted on its own alongside the / partition, but the /home directory will still appear where it needs to appear (in the root directory.

Its hard to explain in easy terms what I'm trying to say. My point is, all of the directories in the hierarchy are located in the same place in the install, but can be physically located on different partitions or drives, depending on how it was originally installed. No matter how many or how few partitions you have, the user will always see the filesystem hierarchy in the way it should be - root directory, containing /etc, /home, /var.

I think this is what you're asking for, anyway. I may have misunderstood your question.

jorran 01-04-2012 07:41 PM

I think you explained it!

Everything is under /.
But /home is partitioned out - yet still accessible through / because it is still apart of / even though /home is mounted "seperately"


Let me know if thats the basic understanding? That makes sense to me but then again imma noob!

I really appreciate your help!

Cultist 01-04-2012 07:44 PM

Quote:

Originally Posted by jorran (Post 4566381)
I think you explained it!

Everything is under /.
But /home is partitioned out - yet still accessible through / because it is still apart of / even though /home is mounted "seperately"


Let me know if thats the basic understanding? That makes sense to me but then again imma noob!

I really appreciate your help!

sounds like you've got it

jorran 01-05-2012 09:32 AM

is /swap the same as /var?

The Root Directory / - separate partition mounted first that contains all directories with standard space available of 100GB unless you plan to have a lot of high space apps in the root directory.
1) /bin
2) /boot
3) /dev
4) /etc – contains all system related configuration files
5) /home – separate partition can get large and used for storing downloads, compiling, installing and running programs, your mail, images, sound files etc… size is dependent upon how many users.
6) /Initrd
7) /lib
8) /lost+found
9) /media
10) /opt
11) /proc
12) /root – home directory of system administrator
13) /sbin
14) /usr
15) /var
16) /srv
17) /tmp


Does this look correct?

Cultist 01-05-2012 10:32 AM

Quote:

Originally Posted by jorran (Post 4566908)
is /swap the same as /var?
...
Does this look correct?

Your hierarchy is correct, but swap is not mounted in the hierarchy - its a separate partition that is only referenced by the system and is usually inaccessible to the user. /var is where system logs and such are stored (or anything that is changed by the system on a regular basis).

salasi 01-05-2012 11:07 AM

Quote:

Originally Posted by jorran (Post 4566381)
Everything is under /.
But /home is partitioned out - yet still accessible through / because it is still apart of / even though /home is mounted "seperately"

I think that the only thing that you have to do now is clean up the descriptions/language a little, but you have the basics:

Don't confuse the file system hierarchy and mount points.
  • The FSH describes a structure of what goes where (although there can be minor differences about what goes in certain directories) but says essentially nothing about mount points
  • If you have a partition, that could, potentially, be mounted at any point in the FSH; so, for example, you might want a separate /home partition, or you might not. If you have a separate /home partition, then that is a section of space on the disk that is dedicated to that use and is mounted on the mount point /home. If you don't, any space used for /home comes out of the space for the 'parent' area
  • Whatever separate partitions you do or do not have mounted on whatever mount points, at a simple user level, it doesn't make any difference to the structure; if you save a file to /home, it gets saved to /home, irrespective of whether that is a separate partition, or not, and everything looks the same to an average user. There can be considerations about partitions running out of disk space, or performance and so on, but to the typical user, these things should be more-or-less transparent

Quote:

Originally Posted by jorran (Post 4566381)
is /swap the same as /var?

No; they are unrelated. swap (not /swap...try to cd to /swap, and you'll get an error message about the directory not existing) is part of the virtual memory subsystem and is also used for suspend and resume, if you use those, and really doesn't contain 'files' in a useful sense (it contains fragments that have been swapped out, rather than whole files, with their accompanying permissions, modification times and other metadata). /var does contain files, with all the metadata stuff, but those files relate to the current the status of the system and its applications.

jorran 01-05-2012 11:15 AM

If I have 8TB of data/files being looked though each and every day by thousands of customers would best practice be to partition out /, /home and swap and only mount / and /home?

Should I have another partition for tmp? var? or anything besides those two? Or is it completely up to me?

I can have a home partition and mount it to /home - that way all data stays on that partition
I can have a / partition and mount it to / - that way all data stays there
etc...

Thats how I understand it right?


All times are GMT -5. The time now is 03:20 PM.