filetree, differences, mountpoints and filesystem typesLinux is organized around files in a tree arrangement. The top of the tree is called "the root" and is designated "/". Everything is attached to the tree at some point. Hard drives are "mounted" to specified points in the tree. So are CD drives, USB thumb drives. Even network process use special files called "sockets". By using tools like devfs, Linux systems can keep track of UUID numbers for hard drives and USB thumbdrives and always make them available in the same location.
The / section of the RHEL tree looks like
The regularity of the Linux filetree is essential in the boot up process. There is a standard form of the tree described by the Filesystem Hierarchy Standard
User data is typically stored in their home directory which is in
/homefor users with local accounts. Users with network accounts may have their home directories in
/usr/local/usersor even in
What about the other directories?
Some, such as
/sysare not storing real "files".
/procis a way to look inside the kernel and see the processes that are running and what a lot of internal values are.
/devis where the system keeps track of all the physical and virtual devices.
/sysis similar to
/procbut provides information about the in-kernel status to userspace objects like devices, busses and loaded modules.
/etcis the directory that should be looked at first for system configuration. Every application, process, device and account is configured here (unless it's non-standard and done in
/usr/local/etc- more on
/usr/locallater). RedHat system will usually put configuration data for start up processes in the
/etc/sysconfigdirectory and kernel level parameters in
/etc/sysctl.conffile. Other configuration files in
/etcinclude passwd, group, shadow and gshadow ( these control local usernames, passwords and group affiliations), skel (which provides the default startup new user environment), resolve.conf (for storing the DNS servers for network name resolving), and everything else from a2ps (an ascii to postscript converter)to zshrc (configuration for the z-shell environment). There are some special directories in
/etcthat are used to decide what runs when during system start up and shutdown. These are the rc* directories. rc1.d, rc2.d, rc3.d, through rc6.d .
rcis for "runtime configuration". The numbers refer to different runlevels. Putting a specific process into the correct
rc*directory can be done manually (they are just symlinks) but it's more efficient to use the chkconfig command
Difference between Linux and Microsoft filesystemsMicrosoft system were designed around the home user machine. So it's designed around drives. Add a new drive and your system may not boot again! Or your CD burner is no longer drive D: but it's now drive E: and your USB thumbdrive changes drive letters also depending on whether your external back up drive is plugged in as well.
Linux systems don't automatically reconfigure what you already have just because you add a new part to your system.
Mount pointsOK. So you have to tell it where to IT:mount that new 4TB drive array you grabbed from craigslist for $50.
Drives that are always mounted when the system boots up are configured in the
/etc/fstabfile (think:file system table). For example here's a typical desktop system here at GTRI: Yikes! What is this mess?! It's really pretty simple once you learn the meaning of the different columns. The source is where in the filetree the device file is located for that source.
/dev/VolGroup70/LvRootis a volume group that hold the
swapspace. So clearly the mount point is the place in the filetree that device is found for use by something other than the
mountcommand. The format is the filesystem type. In the first line example, it is ext3. The parameters column defines how to perform the mount. defaults means the following options are used: The remaining two fields are used by the dump process (a very basic back-up tool) and the fsck (file system check) process respectively. A dump field of 0 means no dump needed. An fsck field other than 0 directs the fsck process to the order to perform a filesystem check. 0 means no check.
- ext2 : older format that did not support a rapid filesystem recover process called journalling.
- ext3 : modern format that supports journalling by tracking open files with a write log journal that is written to first, then the actual file is written to and the journal entry is deleted. Very useful if the system goes down without first performing a write buffer flush operation.
- ext4 : new replacement for ext3 that is faster and solves some issues with ext3. Both ext3 and ext4 use journals but ext4 has greatly expanded filesystem size limits (exabytes) and file sizes (16 terabytes). See http://en.wikipedia.org/wiki/Ext4 for a good overview of ext4 improvements over ext3.
- swap : swap is special filesystem space used to park memory that has not been used in a while when the kernel needs more memory than it has available. It is similar to "virtual RAM" in that is uses the much slower hard drive space. When a server is thrashing it is constantly swapping memory back and forth from swap space. The system gets slower and slower until an overly large process is killed off and the swap space is no longer in heavy use. NOTE: if there is a drive error in the swap space partition and the kernel tries to access that data, the system will typically crash.
- nfs : There are 3 versions of the Network File System: nfs, nfsv3 and nfsv4. the ancient nfs should never be used as it's totally insecure and very buggy. nfsv3 addressed the security issues but left the instability issues. nfsv4 is both fairly securable and quite stable. With nfs, a file server can provide a common data storage area across a LAN (or WAN with v4 and vpn tunneling).
Filesystem quizLIN:page top
- What are all of the /dev/names for your CD drive pointing to?
- What are the different names for the hard drive(s) in your system?
- What is the hardware device and filesystem type of the /boot partition?