LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 01-04-2012, 04:44 PM   #1
jorran
Member
 
Registered: Dec 2011
Location: Iowa
Distribution: RHEL 5.X
Posts: 54

Rep: Reputation: Disabled
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
 
Old 01-04-2012, 05:32 PM   #2
Cultist
Member
 
Registered: Feb 2010
Location: Chicago, IL
Distribution: Slackware64 14.1
Posts: 777

Rep: Reputation: 101Reputation: 101
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.
 
Old 01-04-2012, 06:44 PM   #3
jorran
Member
 
Registered: Dec 2011
Location: Iowa
Distribution: RHEL 5.X
Posts: 54

Original Poster
Rep: Reputation: Disabled
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.
 
Old 01-04-2012, 06:53 PM   #4
Cultist
Member
 
Registered: Feb 2010
Location: Chicago, IL
Distribution: Slackware64 14.1
Posts: 777

Rep: Reputation: 101Reputation: 101
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)
 
Old 01-04-2012, 07:08 PM   #5
jorran
Member
 
Registered: Dec 2011
Location: Iowa
Distribution: RHEL 5.X
Posts: 54

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Cultist View Post
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?
 
Old 01-04-2012, 07:14 PM   #6
Cultist
Member
 
Registered: Feb 2010
Location: Chicago, IL
Distribution: Slackware64 14.1
Posts: 777

Rep: Reputation: 101Reputation: 101
Quote:
Originally Posted by jorran View Post
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.
 
Old 01-04-2012, 07:22 PM   #7
jorran
Member
 
Registered: Dec 2011
Location: Iowa
Distribution: RHEL 5.X
Posts: 54

Original Poster
Rep: Reputation: Disabled
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...
 
Old 01-04-2012, 07:30 PM   #8
Gomer_X
LQ Newbie
 
Registered: Jan 2012
Location: Ohio
Distribution: Debian, CentOS, Fedora, LFS
Posts: 24

Rep: Reputation: Disabled
Quote:
Originally Posted by jorran View Post
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.
 
Old 01-04-2012, 07:33 PM   #9
Cultist
Member
 
Registered: Feb 2010
Location: Chicago, IL
Distribution: Slackware64 14.1
Posts: 777

Rep: Reputation: 101Reputation: 101
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.
 
Old 01-04-2012, 07:41 PM   #10
jorran
Member
 
Registered: Dec 2011
Location: Iowa
Distribution: RHEL 5.X
Posts: 54

Original Poster
Rep: Reputation: Disabled
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!
 
Old 01-04-2012, 07:44 PM   #11
Cultist
Member
 
Registered: Feb 2010
Location: Chicago, IL
Distribution: Slackware64 14.1
Posts: 777

Rep: Reputation: 101Reputation: 101
Quote:
Originally Posted by jorran View Post
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
 
Old 01-05-2012, 09:32 AM   #12
jorran
Member
 
Registered: Dec 2011
Location: Iowa
Distribution: RHEL 5.X
Posts: 54

Original Poster
Rep: Reputation: Disabled
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?

Last edited by jorran; 01-05-2012 at 10:04 AM.
 
Old 01-05-2012, 10:32 AM   #13
Cultist
Member
 
Registered: Feb 2010
Location: Chicago, IL
Distribution: Slackware64 14.1
Posts: 777

Rep: Reputation: 101Reputation: 101
Quote:
Originally Posted by jorran View Post
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).
 
Old 01-05-2012, 11:07 AM   #14
salasi
Senior Member
 
Registered: Jul 2007
Location: Directly above centre of the earth, UK
Distribution: SuSE, plus some hopping
Posts: 3,885

Rep: Reputation: 774Reputation: 774Reputation: 774Reputation: 774Reputation: 774Reputation: 774Reputation: 774
Quote:
Originally Posted by jorran View Post
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 View Post
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.
 
Old 01-05-2012, 11:15 AM   #15
jorran
Member
 
Registered: Dec 2011
Location: Iowa
Distribution: RHEL 5.X
Posts: 54

Original Poster
Rep: Reputation: Disabled
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?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy Folder Hierarchy 1veedo Linux - General 1 07-02-2010 01:00 PM
APT Repository Hierarchy baking-a-77 Linux - Software 0 02-19-2009 03:50 PM
Why are so many dirs used in solaris hierarchy? wrapster Solaris / OpenSolaris 4 06-19-2008 03:13 AM
[SOLVED] Distribution Hierarchy Mustafa^Qasim Linux - Newbie 2 02-24-2007 09:16 PM
#include hierarchy Mistro116@yahoo.com Programming 2 11-27-2005 11:50 AM


All times are GMT -5. The time now is 02:25 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration