Sunday, December 19, 2010

Resolve Linux root file system directory tree

Directory tree can be divided into smaller parts, each part can own disk or partition.

Main part is the root,/usr,/var and/home file system. Each section has a different purpose. Each machine has a root file system that contains the system boot and make other file system can mount the necessary file, the root file system there should be a single-user state to be enough content. Should also include repair a damaged system, recovery, backup, and other tools. The/usr file system contains all commands, library, man pages and other general actions required does not change the file. /Usr should not have the general use of the file you want to modify. This allows this in the file system through a network share so that it can be more effective, because this saves disk space (/usr easily is hundreds of megabytes), and easy to manage (when upgrading the application, only the main/usr needs to change, without having to change each machine) even if the file system on your local disk, or read-only mount to reduce system crash file system damage. The/var file system contains the changes file, such as the spool directory (mail, news, printer, etc), log files, formattedmanualpages and staging file. Traditionally/var has everything in the/usr down somewhere, but it is impossible to read-only/usr installed. /Home file system that contains the user's home directory, that is, all on the actual data. A large/home may be divided into a number of file system, you will need to add one level beneath names such as/home/staff/home/students, etc. Although the different sections above is called a file system, but they do not have to be a true separation of file system. If the system is small, single-user system, but users want simple, can be easily placed on a file system. According to the disk capacity and different purposes allocated space, directory tree can also be assigned to a different file system. It is important to use the standard name, even if/var and/usr partitions, the same first name/var/adm/messages/usr/lib/libc.a and must be capable of working, for example the file under the/var moved to/usr/var and symbols as/usr/var/var. Unix file structure in accordance with the purpose to group files, i.e. all the commands in one place, all the data in another place, all the documents in one place, and so on. Another approach is to group under program files belongs to, i.e. all Emacs files in a directory, all TeX file in another, and so on. The latter method is difficult to share files (program directory often contain static shareable and unshareable file dynamically), sometimes difficult to find (for example man pages in a very large number of places, the man program find them extremely difficult). The root file system root file system in General should be relatively small, because including strict file and a small infrequently changing file system does not easily damaged. Damage to the root file system for normal means that unless a particular way (for example from a floppy disk) the system will not boot. Root generally does not contain any files, in addition to possible standard system boot image, usually called/vmlinuz. All other files in a subdirectory of the root file system. /Bin: boot-start the desired command or normal user can use the command (may be in boot startup). /Bin/sbin: similar, but not for ordinary users, although if necessary and permitted use. /Etc: specific machine configuration files. /Root: root user's home directory. /Lib: root file system on the required shared libraries. /Lib/modules: kernel loadable module, especially those who recover from a corrupted system boot required (such as network and file system drivers). /Dev: device files. /Tmp: temporary file. Boot start running programs should use/var/tmp instead/tmp, because the former might have more space on disk. /Boot: the boot loader (bootstraploader) use of documents, such as LILO. Core image is often here, not in the root directory. If you have a lot of core image, this directory may become very large, you may use a separate file systems better. Another reason is to ensure that core image must be on the first IDE hard disk 1024 cylinders. /Mnt: System Administrator temporary mount point of the installation. The program does not support installation to/mnt automatically. /Mnt can be divided into subdirectories (for example/mnt/dosa may be using the MSDOS file system floppy drive, and may use/mnt/exta ext2 file system with the floppy drive). /Proc,/usr,/var,/home: other file system mount point.

No comments:

Post a Comment