1A-File System Structure and Maintenance

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

File System Structure and Maintenance

File systems break files down into two logical categories:

 Shareable vs. unsharable files


 Variable vs. static files

Shareable files can be accessed locally and by remote hosts.


Unsharable files are only available locally.
Variable files, such as documents, can be changed at any time.
Static files, such as binaries, do not change without an action from the system
administrator.

The following directories, or symbolic links to directories, are required in /.


Directory Description
bin Essential command binaries
boot Static files of the boot loader
dev Device files
etc Host-specific system configuration
lib Essential shared libraries and kernel modules
media Mount point for removeable media
mnt Mount point for mounting a filesystem temporarily
opt Add-on application software packages
sbin Essential system binaries
srv Data for services provided by this system
tmp Temporary files
usr Secondary hierarchy
var Variable data
Each directory listed above is specified in detail in separate subsections below. /usr and /var
each have a
complete section in this document due to the complexity of those directories.

home User home directories (optional)


root Home directory for the root user (optional)

The /proc/ Directory


The /proc/ directory contains special files that either extract information from the kernel
or send information to it. Examples of such information include system memory, CPU
information, and hardware configuration.

Within the /proc/ directory, one can find a wealth of information detailing the system
hardware and any processes currently running. In addition, some of the files within the
/proc/ directory tree can be manipulated by users and applications to communicate
configuration changes to the kernel.

Examples
To change the host name
#cat /proc/sys/kernel/hostname
#echo www.example.com > /proc/sys/kernel/hostname

cat /proc/sys/net/ipv4/ip_forward
Returns either 0 or 1.
A 0 indicates that the kernel is not forwarding network packets.
Using the echo command to change the value of the ip_forward file to 1 immediately
turns packet forwarding on.

The /sys/ Directory


The /sys/ directory utilizes the new sysfs virtual file system specific to the kernel. With
the increased support for hot plug hardware devices in the kernel, the /sys/ directory
contains information similar to that held by /proc/, but displays a hierarchical view of
device information specific to hot plug devices.

You might also like