Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am a relatively new student of Linux. To make better
sense of the Linux file system tree structure. I want to know why
certain sub directories are named what are and what files are typically held inside and what these files do if anything. The tree structure
would make more sense when the meaning of the sub directories are known.
Examples include the following; rc.d, x11, x11r6, init.d, initab, ect.
A lot of your questions are answered in the Linux Filesystem Hierarchy. When reading it, beware that it is an ideal. In particular a lot of software does not conform to the /opt, /etc/opt and /var/opt usage, opting (ha!) instead for /usr/local/* directories.
A lot of it is history and tradition going back to the early days of Unix. Some of it relates to the development of Unix and Linux as true multi-user systems.
For practical purposes as a user, you need to concern yourself with
/root--that's the root partition where the root (admin) user and her files reside. Some distros, such as Ubuntu, do not give you direct access to /root (meaning you cannot log in as "root"). Others, such as Slackware, do.
/home/[username]--that's where users' personal files are. It's sort of equivalent to the Windows C:\\Documents and Settings, but, once you get the hang of it, much easier to access, use, and configure.
For instance, I usually use the Fluxbox window manager (http://www.fluxbox.org) rather than Gnome or KDE. My Fluxbox menu resides in a hidden file in my /home/[username] folder (specifically /home/[username]/.fluxbox--the period before the directory name makes it "hidden"). I can configure the menu by opening the menu file into a text editor, making the changes I want, then saving the file. Those changes affect only my login, not anyone else's.
/usr--that's where programs and related files installed by the user (usr) reside (this will include programs installed by the distribution at time of installation). Executables go into /usr/bin or, sometimes, /usr/sbin or /usr/local/bin ("bin" is short for "binary"). Libraries, help fiiles, and documentation go into other subdirectories under /usr.
/opt--some programs install to /opt rather than to /usr.
/etc--that's where configuration and boot information goes. For example, the hosts file is normally somewhere in /etc.
Most of the other directories (/var, /bin, /sbin, and so on) are of interest to persons who write programs and troubleshoot installations, but not to day-to-day users. The OS takes care of what goes there.
The exact structure of the /etc directory can vary from one distribution to another. For example, Slackware has an /etc/rc.d subdirectory; the boot scripts go there. Ubuntu puts the scripts in /etc/ but has not /etc/rc.d subdirectory. Everything is in /etc, but it's organized differently.
For practical purposes as a user, you need to concern yourself with
/root--that's the root partition where the root (admin) user and her files reside. Some distros, such as Ubuntu, do not give you direct access to /root (meaning you cannot log in as "root"). Others, such as Slackware, do.
/home/[username]--that's where users' personal files are. It's sort of equivalent to the Windows C:\\Documents and Settings, but, once you get the hang of it, much easier to access, use, and configure.
For instance, I usually use the Fluxbox window manager (http://www.fluxbox.org) rather than Gnome or KDE. My Fluxbox menu resides in a hidden file in my /home/[username] folder (specifically /home/[username]/.fluxbox--the period before the directory name makes it "hidden"). I can configure the menu by opening the menu file into a text editor, making the changes I want, then saving the file. Those changes affect only my login, not anyone else's.
/usr--that's where programs and related files installed by the user (usr) reside (this will include programs installed by the distribution at time of installation). Executables go into /usr/bin or, sometimes, /usr/sbin or /usr/local/bin ("bin" is short for "binary"). Libraries, help fiiles, and documentation go into other subdirectories under /usr.
/opt--some programs install to /opt rather than to /usr.
/etc--that's where configuration and boot information goes. For example, the hosts file is normally somewhere in /etc.
Most of the other directories (/var, /bin, /sbin, and so on) are of interest to persons who write programs and troubleshoot installations, but not to day-to-day users. The OS takes care of what goes there.
The exact structure of the /etc directory can vary from one distribution to another. For example, Slackware has an /etc/rc.d subdirectory; the boot scripts go there. Ubuntu puts the scripts in /etc/ but has not /etc/rc.d subdirectory. Everything is in /etc, but it's organized differently.
Hey frankbell,
I wanted to say thanks because that information helps me to understand my own distro more (Mandriva One 2009 RC1 KDE). But, now I have another question which you may be able to answer: I was in the Install/Remove Software area earlier, and I removed excess apps that I did not need and then installed those that I did. However, it said that I only had 3.4 GBs of space total, and that I now have 0 MBs/GBs left.
After reviewing what you had written, I went into disk manager and viewed which partitions I had created about a year ago, and I did not find the /opt or the /usr partitions.
Instead, I have /boot, /root, /home, and /swap. The /swap is the smallest partition, at 3.8 GBs, so I assume that all my software has been getting installed there, since the /boot and /root partitions are 10 GBs each, and the /home partition is 20 GBs.
I feel I should also mention that /boot, /root and /home are all ext3 partitions, not sure if this makes a difference or not...
Is there any way (short of formatting the partitions) that I can decrease the size of those three partitions to increase the size of my /swap partition, that you can think of, so that I can install more software on my Linux partition?
You should read my links above (post #5).
The swap partition (note no leading '/') is used by the OS as extra 'virtual RAM' when it runs out of real RAM'.
You seem to be confusing partitions with top level dirs.
Note that the 'root' partition (& root dir) is just '/'.
/root is the home dir for the root user; 2 very different things.
All dirs are referenced from (ie are children of) the '/' dir.
So, swap is not part of the normal disk/dir structure.
Try
fdisk -l
(lower case L there)
and
cat /etc/fstab
as the root user.
Also, to check space use
df -k
'top' will show RAM and swap usage (swap usage is dynamic of course).
Examples include the following; rc.d, x11, x11r6, init.d, initab, ect.
rc.d, init.d, and initab all are to do with the boot process. x11 and x11r6 will hold configuration files for the graphical environment.
Quote:
Originally Posted by HmNtr
Instead, I have /boot, /root, /home, and /swap. The /swap is the smallest partition, at 3.8 GBs, so I assume that all my software has been getting installed there,
No. The swap partition is used for virtual memory. Your software will be in your / partition. If you're right that it's 10 GB, then that's not really large enough.
Quote:
Is there any way (short of formatting the partitions) that I can decrease the size of those three partitions
Not really. While it's easy enough to shrink an ext3 partition, it's not easy to use the remaining space.
The computer treats your disk like a big line. At the moment, it's something like this.
BOOT------|ROOT------|SWAP|HOME----------------
(The order may be different - the output of fdisk -l will tell you)
If you were to resize the boot and home partitions, you'd end up with something like this (dots are free space):
BOOT|......|ROOT------|SWAP|HOME------|..........
Now you've got two separate chunks of free space. Neither can be added to your root partition, since a partition can only be extended into free space directly after it.
@ HmNtr : please start a new thread for your "running out of file system space" problem. That would avoid confusion and make this thread more useful to people wanting to find out about Linux file system etymology.
@ HmNtr : please start a new thread for your "running out of file system space" problem. That would avoid confusion and make this thread more useful to people wanting to find out about Linux file system etymology.
That's just it though, isn't it? I just learned not only about the etymology of the file system, but more about how the file system works in general from one post within this thread...that to me was useful, as I am sure that it would be to any others who read this as well.
I had read this thread and had been able to (moderately) rectify the issue that I was having, because of the great info herein.
You should read the File System Hierarchy that everyone has mentioned. Another good thing to do is to boot a computer from a LiveCD version of Linux, open a command line and type ls -R / >>fs.txt This will output a system wide directory listing and all files located in each directory and then save the output to a file called fs.txt. You can then view fs.txt to see how the file system works and what files are in each directory.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.