Книга: Embedded Linux Primer: A Practical, Real-World Approach

6.1.2. File System Layout

6.1.2. File System Layout

Where space is a concern, many embedded systems developers create a very small root file system on a bootable device (such as Flash memory) and later mount a larger file system from another device, perhaps a hard disk or network NFS server. In fact, it is not uncommon to mount a larger root file system right on top of the original small one. You'll see an example of that when we examine the initial ramdisk (initrd) later in this chapter.

A simple Linux root file system might contain the following top-level directory entries:

.

|

|--bin

|--dev

|--etc

|--lib

|--sbin

|--usr

|--var

|--tmp

Table 6-1 details the most common contents of each of these root directory entries.

Table 6-1. Top-Level Directories

Directory Contents
bin Binary executables, usable by all users on the system[47]
dev Device nodes (see Chapter 8, "Device Driver Basics")
etc Local system-configuration files
lib System libraries, such as the standard C library and many others
sbin Binary executables usually reserved for superuser accounts on the system
usr A secondary file system hierarchy for application programs, usually read-only
var Contains variable files, such as system logs and temporary configuration files
tmp Temporary files

The very top of the Linux file system hierarchy is referenced by the forward slash character (/) by itself. For example, to list the contents of the root directory, one would type this:

$ ls /

This produces a listing similar to the following:

root@coyote:/# ls /
bin dev etc home lib mnt opt proc root sbin tmp usr var
root@coyote:/#

This directory listing contains directory entries for additional functionality, including /mnt and /proc. Notice that we reference these directory entries preceded by the forward slash, indicating that the path to these top-level directories starts from the root directory.

Оглавление книги


Генерация: 0.039. Запросов К БД/Cache: 0 / 0
поделиться
Вверх Вниз