Handbook:Parts/Installation/System/zh-cn

关于 fstab
Under Linux, all partitions used by the system must be listed in. This file contains the mount points of those partitions (where they are seen in the file system structure), how they should be mounted and with what special options (automatically or not, whether users can mount them or not, etc.)

创建/etc/fstab文件
The file uses a table-like syntax. Every line consists of six fields, separated by whitespace (space(s), tabs or a mixture). Each field has its own meaning:


 * 1) 第一个字段是对分区的描述，也就是设备文件的路径
 * 2) 第二个字段是分区挂载点，也就是分区应该挂载到的地方
 * 3) 第三个字段给出分区所用的文件系统
 * 4) 第四个字段给出的是挂载分区时mount命令所用的挂载选项. 由于每个文件系统都有自己的挂载选项，我们建议你阅读mount手册（man mount）以获得所有挂载选项的列表. 多个挂载选项之间是用逗号分隔的.
 * 5) 第五个字段是给dump使用的，用以决定这个分区是否需要dump. 一般情况下，你可以把该字段设为0（零）.
 * 6) 第六个字段是给fsck使用的，用以决定系统非正常关机之后文件系统的检查顺序. 根文件系统应该为1，而其它的应该为2（如果不需要文件系统自检的话可以设为0）.

In the remainder of the text, we use the default block device files as partition.

Partition labels and UUIDs
Users who have gone the GPT route have a couple more 'robust' options available to define partitions in. Partition labels and partition UUIDs can be used on GPT formatted devices to uniquely identify the block device's partition(s). Labels and UUIDs can be quickly and easily viewed nicely in the terminal by running the command:

While not always true for labels, using a UUID to identify a partition in provides a guarantee that the bootloader will not be confused when looking for a certain partition, even if the block device file were to change. Using the older default block device files for defining the partitions in  is risky for systems that are restarted often and have SATA block devices added and removed regularly.

The naming for block device files depends on a number of factors (such as how and in what order the disks are attached to the system). With this being stated, unless one intends to constantly fiddle with the disk ordering, using default block device files is a simple and straightforward approach.

Add the rules that match the previously decided partitioning scheme and append rules for devices such as CD-ROM drive(s), and of course, if other partitions or drives are used, for those too.

Below is a more elaborate example of an file:

When  is used in the third field, it makes the  command guess what the filesystem would be. This is recommended for removable media as they can be created with one of many filesystems. The  option in the fourth field makes it possible for non-root users to mount the CD.

To improve performance, most users would want to add the  mount option, which results in a faster system since access times aren't registered (those are not needed generally anyway). This is also recommended for solid state drive (SSD) users, who should also enable the  mount option (ext4 and btrfs only for now) which makes the   command work.

Double-check the file, save and quit to continue.

主机名、域名信息
用户必须要做的事情之一就是命名自己的机器. 尽管这看上去很容易，但是很多用户觉得为他们的Linux机器起一个合适的名字是很难的. 为了加快事情的进度，你应该知道你所命名的所有名字都是可以在今后重新修改的. 因此，你可以简单命名你的系统为 tux，域名为 homenetwork.

Second, if a domain name is needed, set it in. This is only necessary if the ISP or network administrator says so, or if the network has a DNS server but not a DHCP server. Don't worry about DNS or domain names if the system uses DHCP for dynamic IP address allocation and network configuration.

如果你有一个NIS域（如果你不知道这是什么，就说明你没有），你也需要定义一个：

配置网络
在Gentoo Linux安装时,网络已经配置. 然而,这是安装的安装光盘本身的配置,并不是新的系统环境的网络配置. 现在你所要设置的是Gentoo系统的永久网络配置.

All networking information is gathered in. It uses a straightforward yet perhaps not intuitive syntax. But don't fear, everything is explained below. A fully commented example that covers many different configurations is available in.

首先安装:

系统默认使用DHCP. 如果使用DHCP的话，你需要安装一个DHCP客户端. 这个将在稍后的安装必要的系统工具部分介绍.

If the network connection needs to be configured because of specific DHCP options or because DHCP is not used at all, then open :

Set both config_eth0 and routes_eth0 to enter IP address information and routing information:

To use DHCP, define config_eth0 :

Please read for a list of all available options. Be sure to also read up on the DHCP client man page if specific DHCP options need to be set.

If the system has several network interfaces, then repeat the above steps for config_eth1, config_eth2 , etc.

现在保存配置并退出.

在启动时自动启用网络链接
为了在启动时自动激活网络接口，你必须添加这些到default运行级别.

If the system has several network interfaces, then the appropriate files need to be created just like we did with.

If after booting the system we find out that the assumption about the network interface name (which is currently documented as ) was wrong, then execute the following steps to rectify this:


 * 1) Update the  file with the correct interface name (like   instead of  ).
 * 2) Create new symbolic link (like ).
 * 3) Remove the old symbolic link.
 * 4) Add the new one to the default runlevel.
 * 5) Remove the old one using.

hosts 文件
Next inform Linux about the network environment. This is defined in and helps in resolving host names to IP addresses for hosts that aren't resolved by the nameserver.

Save and exit the editor to continue.

可选：启用PCMCIA
PCMCIA用户首先应该安装软件包.

Root 密码
Set the root password using the command.

The root Linux account is an all-powerful account, so pick a strong password. Later an additional regular user account will be created for daily operations.

配置引导和启动
Gentoo (at least when using OpenRC) uses to configure the services, startup, and shutdown of a system. Open up and enjoy all the comments in the file. Review the settings and change where needed.

Next, open to handle keyboard configuration. Edit it to configure and select the right keyboard.

Take special care with the keymap variable. If the wrong keymap is selected, then weird results will come up when typing on the keyboard.

Finally, edit to set the clock options. Edit it according to personal preference.

If the hardware clock is not using UTC, then it is necessary to set  in the file. Otherwise the system might show clock skew behavior.