Meniu

The structure of the file system on Linux

One of the first aspects of Linux that a new user comes in contact with is the structure of the file system, or more clearly, the way and place the executables, system or configuration files are placed. Being a system derived from UNIX, there are two specific features:

It is a system called "hierarchical"

There is only one "root" from which all directories start and which is always mounted. Or in short, in Linux there is no what on Windows are called "drives" (system disks). If you have multiple HDDs or partitions on the same disk they will not appear separately but will be mounted (integrated) in the system.

It has a structure based on the function of the files, not subordinated to the programs

You will not find specific directories for installed programs. The components of a program are distributed in the system according to their role (libraries in a library directory or executables in an executable directory).

Here it should be noted that this aspect (of sorting files by function), which should make it easier to manage a system, actually gives a lot of headaches, somewhat dividing the Linux world into distributions or as they are called "distros". Why? Because each distribution, keeping the basic idea, created a slightly different directory structure. For example, you will not be able to install an RPM for KDE on Mandriva if it was compiled for SUSE because the two distributions have different KDE locations (SUSE is in / eight and Mandriva is in / usr). However, if you compile packages from sources, these problems are avoided.

For a long time, Linux did not have a standardized system for locating files. This creates, first and foremost, difficulties for program developers. It was very difficult to launch an application that would compile on multiple systems, since they were fundamentally different. In early 1995, work began on the Linux Filesystem Hierarchy Standard (FHS), which is still used today.

The main directories you find in the root of the system.

/ bin

essential system programs that should always be available, they can be used to repair other partitions for example if you have problems

/ boot

contains the system kernel and files needed for the boot process

/ dev (devices)

- contains all devices in the system. Here you can find the entries corresponding to some active components of the computer that in linux are represented in the form of files. Knowing these inputs is quite useful in certain situations. Some of the most important devices are

hdX - HDD IDE, CD-ROMs
sdX - HDD SCSI, portable media storage drives (card readers, flashes)
scdX - CD-ROM SCSI or emulated SCSI
fdX - floppy disk drives
ttyX - serial port inputs (mouse , IR receivers, etc.)
lpX - inputs on the printer parallel port

/ etc

contains configuration files. The most important files that you find here and that you will work with quite often are

/ etc / fstab - inputs corresponding to storage media with information about the mount point and related options
/etc/lilo.conf - configuration of the LILO boot manager
/etc/grub.conf - configuration of the GRUB boot manager
/etc/modules.conf - options for the various modules of the system
/ etc / inittab - file from which you can set the runlevel to start the system or its reaction to the command CTRL + ALT + DEL
/etc/X11/xorg.conf - system settings X (graphical interface)
/ etc /rc.d/rc.local - file in which you can enter certain options (commands) to be run at system boot
/etc/rc.d/rcX.d/ - directories corresponding to the different execution levels (X represents the level) in which you will find symbolic links to the processes that will be run at the start of the respective levels
/etc/modprobe.preload - file in which you can enter the modules you want to be loaded at boot

/ home

in it you will find the personal files of the system users in the form of directories bearing their names

/ lib (libraries)

system libraries. Note that in / lib / modules / you will find the system modules you have ("drivers")

/ mnt (mounted)

contains directories where the various storage devices are mounted. For Mandrake, directories are generally created automatically during installation

/ cdrom - for CD-ROM
/ floppy - for FDD
/ win_x - FAT or NTFS partition

You can also create new mount points to use, and to automate the process modify / etc / fstab

/ process (processes)

is a virtual file system that contains information about the system and how it runs. From here you can get some information about the system, analyzing the respective files.

/ sbin (binary system)

are executables considered more important, they being generally accessible to the system administrator. In / usr / sbin / you will find such a directory that contains less important system executables

/ tmp (temporary)

directory with temporary files of running applications. It is not recommended to delete files from it.

/ usr

contains most of the system, here you will find documentation, libraries, executables, etc. of the system or installed by users. The most important directories are

/ usr / bin - executables of installed programs. You will also find
/ usr / local / bin - executables for user installed programs (usually from sources)
/ usr / lib - program libraries
/ usr / share - here you can find files considered "independent" such as icons, fonts, and so on Also here you will find the directory / doc, where is the documentation for the programs installed by the system.
/ usr / man - contains the man (manuals) for various commands
/ usr / doc - directory where you will find the documentation for programs installed by the user in general. The system places its documentation for programs in / usr / share / doc
/ usr / src - here you will find the kernel sources

/cousin

contains logs, files with variable data that the system constantly changes at boot or when it executes certain commands (for example, it prints something to the printer), passing here the information about the process that took place.

/ Lost & Found

Here you will find files resulting from the corrections of the file system structure. It will have what the system considers fragments of lost files that you can try to repair by copying them to their locations or reinstalling the program that generates them.

More information about the structure of the Linux file system can be found in the "Filesystem Hierarchy Standard" document which can be downloaded from http://www.pathname.com/fhs/

John Doe

Articole publicate de la contributori ce nu detin un cont pe gnulinux.ro. Continutul este verificat sumar, iar raspunderea apartine contributorilor.
  • | 340 articole

Nici un comentariu inca. Fii primul!
  • powered by Verysign