Difference between revisions of "Install/Configuration Files/zh-cn"

From Funtoo
Jump to: navigation, search
(Created page with "继续安装步骤。使用 {{c|nano -w <name_of_file>}} 来编辑文件 -- "{{c|-w}}" 指令会禁用自动换行,这样让编辑配置配置文件更顺手。你可以从...")
(Created page with "{{Warning|在重启之前编辑 {{c|/etc/fstab}} 是很重要的!你需要修改 ''fs'' 和 ''type'' 栏,让他们与你使用 {{c|gdisk}} 或 {{c|fdisk}} 创建的文件...")
Line 69: Line 69:
继续安装步骤。使用 {{c|nano -w <name_of_file>}} 来编辑文件 -- "{{c|-w}}" 指令会禁用自动换行,这样让编辑配置配置文件更顺手。你可以从示例文件中复制粘贴。
继续安装步骤。使用 {{c|nano -w <name_of_file>}} 来编辑文件 -- "{{c|-w}}" 指令会禁用自动换行,这样让编辑配置配置文件更顺手。你可以从示例文件中复制粘贴。
{{Warning|It's important to edit your {{c|/etc/fstab}} file before you reboot! You will need to modify both the "fs" and "type" columns to match the settings for your partitions and filesystems that you created with {{c|gdisk}} or {{c|fdisk}}. Skipping this step may prevent Funtoo Linux from booting successfully.}}
{{Warning|在重启之前编辑 {{c|/etc/fstab}} 是很重要的!你需要修改 ''fs'' 和 ''type'' 栏,让他们与你使用 {{c|gdisk}} {{c|fdisk}} 创建的文件系统和分区相匹配。跳过这个步骤有可能会让 Funtoo Linux 无法正确启动。}}
==== /etc/fstab ====
==== /etc/fstab ====

Revision as of 17:27, March 14, 2021

Other languages:
English • ‎español • ‎polski • ‎português do Brasil • ‎русский • ‎中文(中国大陆)‎


Install Guide, Chapter 11 < Prev Next >

正如对任何一个 Linux 发行版期盼的那样,Funtoo Linux 有一套自己的配置文件。为了确保 Funtoo Linux 成功启动,你必须编辑的文件是 /etc/fstab。其他的文件是可选的。

使用 Nano

Chroot 环境下包含的默认文本编辑器是 nano。若要编辑文本,可以按照下述方法使用 Nano:

chroot # nano -w /etc/fstab

在编辑器中,可以使用方向键移动光标,并且退格和删除这一类的按键都会像往常一样工作。可以按 Control-X 并且用 y 来回答是/否将改动保存到文件的提示来保存文件。


Here are a full list of files that you may want to edit, depending on your needs:

FileDo I need to change it?Description
/etc/fstab YES - required Mount points for all filesystems to be used at boot time. This file must reflect your disk partition setup. We'll guide you through modifying this file below.
/etc/localtime Maybe - recommended Your timezone, which will default to UTC if not set. This should be a symbolic link to something located under /usr/share/zoneinfo (e.g. /usr/share/zoneinfo/America/Montreal)
/etc/portage/make.conf Maybe - recommended Parameters used by gcc (compiler), portage, and make. Note that it is normal for this file to be empty in Funtoo Linux, as many settings have been migrated to our enhanced profile system.
/etc/conf.d/hostname Maybe - recommended Used to set system hostname. Set the hostname variable to the fully-qualified (with dots, ie. foo.funtoo.org) name if you have one. Otherwise, set to the local system hostname (without dots, ie. foo). Defaults to localhost if not set.
/etc/hosts No You no longer need to manually set the hostname in this file. This file is automatically generated by /etc/init.d/hostname.
/etc/conf.d/keymaps Optional Keyboard mapping configuration file (for console pseudo-terminals). Set if you have a non-US keyboard. See Funtoo Linux Localization.
/etc/conf.d/hwclock Optional How the time of the battery-backed hardware clock of the system is interpreted (UTC or local time). Linux uses the battery-backed hardware clock to initialize the system clock when the system is booted.
/etc/conf.d/modules Optional Kernel modules to load automatically at system startup. Typically not required. See Additional Kernel Resources for more info.
/etc/conf.d/consolefont Optional Allows you to specify the default console font. To apply this font, enable the consolefont service by running rc-update add consolefont.
profiles Optional Some useful portage settings that may help speed up intial configuration.

如果你正在安装一个英文版的 Funtoo Linux,那就可以按照原样使用大部分的配置文件。如果你在安装其他语言的版本,不必担心,我们在 Funtoo Linux Localization 页面上写出了必要的准备步骤。如有需要,还有许多友好的帮助在等着你。(参见 Getting Help

继续安装步骤。使用 nano -w <name_of_file> 来编辑文件 -- "-w" 指令会禁用自动换行,这样让编辑配置配置文件更顺手。你可以从示例文件中复制粘贴。


在重启之前编辑 /etc/fstab 是很重要的!你需要修改 fstype 栏,让他们与你使用 gdiskfdisk 创建的文件系统和分区相匹配。跳过这个步骤有可能会让 Funtoo Linux 无法正确启动。


/etc/fstab is used by the mount command which is run when your system boots. Lines in this file inform mount about filesystems to be mounted and how they should be mounted. In order for the system to boot properly, you must edit /etc/fstab and ensure that it reflects the partition configuration you used earlier in the install process. If you can't remember the partition configuration that you used earlier:

chroot #  lsblk -f
chroot # nano -w /etc/fstab
   /etc/fstab - An example fstab file
# The root filesystem should have a pass number of either 0 or 1.
# All other filesystems should have a pass number of 0 or greater than 1.
# NOTE: If your BOOT partition is ReiserFS, add the notail option to opts.
# See the manpage fstab(5) for more information.
# <fs>	     <mountpoint>  <type>  <opts>         <dump/pass>

LABEL=BOOT        /boot         vfat    noauto,noatime  1 2
#LABEL=SWAP       none          swap    sw              0 0
LABEL=FUNTOO      /             ext4    noatime         0 1
#/dev/cdrom       /mnt/cdrom    auto    noauto,ro       0 0
#UUID="14D0-1E8A" /var          ext4    noatime         0 2
#tmpfs            /run          tmpfs   rw,nodev,nosuid 0 0

If you mounted a /var or /home partition, add them to your fstab, or your system may not boot correctly.


If you're using MBR to boot, change the LABEL=BOOT line so that it says ext2 instead of vfat. Similarly, make sure that the LABEL=FUNTOO line specifies either xfs or ext4, depending on which filesystem you chose earlier on in the installation process when you created filesystems. MBR also requires a swap entry, GPT automatically loads swap, and does not require a fstab swap entry.


/etc/localtime is used to specify the timezone that your machine is in, and defaults to UTC. If you would like your Funtoo Linux system to use local time, you should replace /etc/localtime with a symbolic link to the timezone that you wish to use.

chroot # ln -sf /usr/share/zoneinfo/MST7MDT /etc/localtime

The above sets the timezone to Mountain Standard Time (with daylight savings). Type ls /usr/share/zoneinfo to list available timezones. There are also sub-directories containing timezones described by location.


USE flags define what functionality is enabled when packages are built. It is not recommended to add a lot of USE flags during installation; you should wait until you have a working, bootable system before changing your USE flags. A USE flag prefixed with a minus ("-") sign tells Portage not to use the flag when compiling. A Funtoo guide to USE flags will be available in the future. For now, you can find out more information about USE flags in the Gentoo Handbook.


If you dual-boot with Windows, you'll need to edit this file and change the value of clock from UTC to local, because Windows will set your hardware clock to local time every time you boot Windows. Otherwise you normally wouldn't need to edit this file.

chroot # nano -w /etc/conf.d/hwclock


By default, Funtoo Linux is configured with Unicode (UTF-8) enabled, and for the US English locale and keyboard. If you would like to configure your system to use a non-English locale or keyboard, see Funtoo Linux Localization.

Install Guide, Chapter 11 < Prev Next >