Difference between revisions of "Install/Creating Filesystems/zh-cn"

From Funtoo
Jump to navigation Jump to search
(Updating to match new version of source page)
(15 intermediate revisions by one other user not shown)
Line 2: Line 2:
== Creating Filesystems ==
== Creating Filesystems ==
</includeonly><noinclude><languages/>
</includeonly><noinclude><languages/>
= Install Guide: Creating Filesystems =
= 安装指南:创建文件系统 =


{{InstallNavigation|num=5|prev=GPT Partitioning|next=Mounting Filesystems}}</noinclude>
{{InstallNavigation|num=5|prev=GPT Partitioning|next=Mounting Filesystems}}</noinclude>


{{Note|本节同时覆盖 BIOS ' UEFI 安装两种方法。不要跳过!}}
{{Note|本节同时覆盖 BIOS UEFI 安装两种方法。不要跳过!}}


Before your newly-created partitions can be used, the block devices that were created in the previous step need to be initialized with filesystem ''metadata''. This process is known as ''creating a filesystem'' on the block devices. After filesystems are created on the block devices, they can be mounted and used to store files.
Before your newly-created partitions can be used, the block devices that were created in the previous step need to be initialized with filesystem ''metadata''. This process is known as ''creating a filesystem'' on the block devices. After filesystems are created on the block devices, they can be mounted and used to store files.
Line 14: Line 14:
{{console|body=###i## mkfs.ext2 /dev/sda1}}
{{console|body=###i## mkfs.ext2 /dev/sda1}}


If you're using GPT partitions for UEFI, or installing for Raspberry Pi, you'll want to create a vfat filesystem on your first partition. This will be {{c|mmcblk0p1}} in the case of Raspberry Pi:
如果在 UEFI 中使用 GPT 分区,或者为 Raspberry Pi 安装,需要在第一个分区上创建一个 vfat 文件系统。在 Raspberry Pi 的情况下,这将是 {{c|mmcblk0p1}}


{{console|body=###i## mkfs.vfat -F 32 /dev/sda1}}
{{console|body=###i## mkfs.vfat -F 32 /dev/sda1}}


Now, let's create a swap partition. This partition will be used as disk-based virtual memory for your Funtoo Linux system.
现在,创建一个交换分区。Funtoo Linux 会将此分区用于基于磁盘的虚拟内存空间。


You will not create a filesystem on your swap partition, since it is not used to store files. But it is necessary to initialize it using the {{c|mkswap}} command. Then we'll run the {{c|swapon}} command to make your newly-initialized swap space immediately active within the live CD environment, in case it is needed during the rest of the install process:
由于交换分区不是用来存储文件的,因此无需对于交换分区创建文件系统。但是需要使用 {{c|mkswap}} 将其初始化。由于之后的安装过程中需要交换分区,所以要运行 {{c|swapon}} 命令使交换分区立即在 Live CD 环境生效:


{{console|body=
{{console|body=
Line 27: Line 27:
}}
}}


==== Root Filesystem ====
==== 根目录文件系统 ====


Now, we need to create a root filesystem. This is where Funtoo Linux will live. We generally recommend ext4 or XFS root filesystems.  
Now, we need to create a root filesystem. This is where Funtoo Linux will live. We generally recommend ext4 or XFS root filesystems.  
Line 33: Line 33:


{{TableStart}}
{{TableStart}}
<tr><th>Filesystem</th><th>Recommended as root file system?</th><th>Additional tools required to emerge</th></tr>
<tr><th>文件系统</th><th>推荐作为根文件系统?</th><th>安装所需的额外工具</th></tr>
<tr><td>ext4</td><td>Yes</td><td>None</td></tr>
<tr><td>ext4</td><td></td><td></td></tr>
<tr><td>XFS</td><td>Yes</td><td>{{c|sys-fs/xfsprogs}}</td></tr>
<tr><td>XFS</td><td></td><td>{{c|sys-fs/xfsprogs}}</td></tr>
<tr><td>reiserfs</td><td>Yes -- will likely need to enable kernel support</td><td>{{c|sys-fs/reiserfsprogs}}</td></tr>
<tr><td>reiserfs</td><td>是——可能需要启用内核支持</td><td>{{c|sys-fs/reiserfsprogs}}</td></tr>
<tr><td>zfs</td><td><span style="font-weight: bold; color: #f88">No</span> - advanced users only</td><td>{{c|sys-fs/zfs}}</td></tr>
<tr><td>zfs</td><td><span style="font-weight: bold; color: #f88"></span> - 仅限高级用户</td><td>{{c|sys-fs/zfs}}</td></tr>
<tr><td>btrfs</td><td><span style="font-weight: bold; color: #f88">No</span> - advanced users only</td><td>{{c|sys-fs/btrfs-progs}}</td></tr>
<tr><td>btrfs</td><td><span style="font-weight: bold; color: #f88"></span> - 仅限高级用户</td><td>{{c|sys-fs/btrfs-progs}}</td></tr>
{{TableEnd}}
{{TableEnd}}


{{Important|'''We do not recommend users set up ZFS or BTRFS as their root filesystem.''' This is much more complex and usually not
<div class="mw-translate-fuzzy">
necessary. Instead, choose XFS or ext4. ''We do support ZFS or BTRFS as non-root filesystems'' and this is much, much easier to configure. See [[ZFS]] and [[BTRFS]] after you are done setting up your Funtoo Linux system to configure ZFS or BTRFS for
{{Important|'''我们不建议用户将 ZFS BTRFS 设置为他们的根文件系统。'''这会复杂得多,而且通常没有
additional secondary storage.}}
必要。相反,选择 XFS 或 ext4。''我们确实支持 ZFS BTRFS 作为非 root 文件系统'',这在配置上要简单得多。在完成设置 Funtoo Linux 系统后,看 [[ZFS]] [[BTRFS]] 来配置 ZFS 或 BTRFS,用于
额外的二级存储。}}
</div>


If you're not sure, choose ext4. Here's how to create a root ext4 filesystem:
如果不确定,就选择 ext4。下面是如何创建一个根目录 ext4 文件系统:


{{console|body=###i## mkfs.ext4 /dev/sda3}}
{{console|body=###i## mkfs.ext4 /dev/sda3}}


...and here's how to create an XFS root filesystem, if you prefer to use XFS instead of ext4:
……这里是如何创建一个 XFS 根目录文件系统,如果你喜欢使用 XFS 而不是 ext4:


{{console|body=###i## mkfs.xfs /dev/sda3}}
{{console|body=###i## mkfs.xfs /dev/sda3}}


Your filesystems (and swap) have all now been initialized, so that that can be mounted (attached to your existing directory heirarchy) and used to store files. We are ready to begin installing Funtoo Linux on these brand-new filesystems.
你的文件系统(包括交换分区)现在已经初始化了,这样就可以挂载他们(附加到现有的目录层次结构中)并且用来存储文件。我们已经准备好在崭新的分区上安装 Funtoo Linux。


==== Additional Filesystems ====
==== Additional Filesystems ====


{{Note|This can be very useful for Raspberry Pi systems!}}
{{Note|这对树莓派系统非常有用!}}


You may want to create additional filesystems for various parts of your Funtoo filesystem tree. It is not uncommon to place {{c|/home}} or {{c|/var}} on separate filesystems.
You may want to create additional filesystems for various parts of your Funtoo filesystem tree. It is not uncommon to place {{c|/home}} or {{c|/var}} on separate filesystems.

Revision as of 04:53, December 13, 2021

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

安装指南:创建文件系统

Install Guide, Chapter 5 < Prev Next >
   Note

本节同时覆盖 BIOS 和 UEFI 安装两种方法。不要跳过!

Before your newly-created partitions can be used, the block devices that were created in the previous step need to be initialized with filesystem metadata. This process is known as creating a filesystem on the block devices. After filesystems are created on the block devices, they can be mounted and used to store files.

Let's keep this simple. Are you using legacy MBR partitions? If so, let's create an ext2 filesystem on /dev/sda1:

root # mkfs.ext2 /dev/sda1

如果在 UEFI 中使用 GPT 分区,或者为 Raspberry Pi 安装,需要在第一个分区上创建一个 vfat 文件系统。在 Raspberry Pi 的情况下,这将是 mmcblk0p1

root # mkfs.vfat -F 32 /dev/sda1

现在,创建一个交换分区。Funtoo Linux 会将此分区用于基于磁盘的虚拟内存空间。

由于交换分区不是用来存储文件的,因此无需对于交换分区创建文件系统。但是需要使用 mkswap 将其初始化。由于之后的安装过程中需要交换分区,所以要运行 swapon 命令使交换分区立即在 Live CD 环境生效:

root # mkswap /dev/sda2
root # swapon /dev/sda2

根目录文件系统

Now, we need to create a root filesystem. This is where Funtoo Linux will live. We generally recommend ext4 or XFS root filesystems. Keep in mind that some filesystems will require additional filesystem tools to be emerged prior to rebooting. Please consult the following table for more information:

文件系统推荐作为根文件系统?安装所需的额外工具
ext4
XFSsys-fs/xfsprogs
reiserfs是——可能需要启用内核支持sys-fs/reiserfsprogs
zfs - 仅限高级用户sys-fs/zfs
btrfs - 仅限高级用户sys-fs/btrfs-progs
   Important

我们不建议用户将 ZFS 或 BTRFS 设置为他们的根文件系统。这会复杂得多,而且通常没有 必要。相反,选择 XFS 或 ext4。我们确实支持 ZFS 或 BTRFS 作为非 root 文件系统,这在配置上要简单得多。在完成设置 Funtoo Linux 系统后,看 ZFSBTRFS 来配置 ZFS 或 BTRFS,用于 额外的二级存储。

如果不确定,就选择 ext4。下面是如何创建一个根目录 ext4 文件系统:

root # mkfs.ext4 /dev/sda3

……这里是如何创建一个 XFS 根目录文件系统,如果你喜欢使用 XFS 而不是 ext4:

root # mkfs.xfs /dev/sda3

你的文件系统(包括交换分区)现在已经初始化了,这样就可以挂载他们(附加到现有的目录层次结构中)并且用来存储文件。我们已经准备好在崭新的分区上安装 Funtoo Linux。

Additional Filesystems

   Note

这对树莓派系统非常有用!

You may want to create additional filesystems for various parts of your Funtoo filesystem tree. It is not uncommon to place /home or /var on separate filesystems.

For Raspberry Pi, you may not have a lot of spare room on the card depending on the capacity of your microSD card, and it may make a lot of sense to put the entire /var filesystem on an external hard drive or solid state disk. This will not only ensure you don't run out of disk space, but can also improve performance since writes to the microSD card typically aren't that fast.

To do this, you will want to use fdisk or gdisk to create a partition on your external drive, and then use the mkfs.xfs or mkfs.ext4 commands to create a filesystem on the new partition. We will mount this new filesystem in the next step prior to extracting the stage3 tarball.

Install Guide, Chapter 5 < Prev Next >