diff --git a/documentation/content/zh-tw/books/handbook/filesystems/_index.adoc b/documentation/content/zh-tw/books/handbook/filesystems/_index.adoc index 252e4f366fd0..bce2fc00a154 100644 --- a/documentation/content/zh-tw/books/handbook/filesystems/_index.adoc +++ b/documentation/content/zh-tw/books/handbook/filesystems/_index.adoc @@ -1,10 +1,12 @@ --- -title: 章 20. 其他檔案系統 +title: 章 23. 其他檔案系統 part: 部 III. 系統管理 prev: books/handbook/zfs next: books/handbook/virtualization +description: 本章介紹 FreeBSD 支援的其他檔案系統 +tags: ["filesystem", "ext2", "ext3", "ext4", "ext2fs", "FAT", "exFAT", "NTFS", "HFS", "HFS+", "Apple", "Microsoft", "Linux"] showBookMenu: true -weight: 24 +weight: 27 params: path: "/books/handbook/filesystems/" --- @@ -17,7 +19,7 @@ params: :icons: font :sectnums: :sectnumlevels: 6 -:sectnumoffset: 20 +:sectnumoffset: 23 :partnums: :source-highlighter: rouge :experimental: @@ -50,51 +52,169 @@ endif::[] [[filesystems-synopsis]] == 概述 -File systems are an integral part of any operating system. They allow users to upload and store files, provide access to data, and make hard drives useful. Different operating systems differ in their native file system. Traditionally, the native FreeBSD file system has been the Unix File System UFS which has been modernized as UFS2. Since FreeBSD 7.0, the Z File System (ZFS) is also available as a native file system. See crossref:zfs[zfs,Z 檔案系統 (ZFS)] for more information. +檔案系統是所有作業系統的基礎元件,讓使用者能夠儲存、管理和存取資料,使硬碟、隨身碟及 USB 儲存裝置等設備能在日常使用中發揮作用。不同的作業系統各有其原生檔案系統。 -In addition to its native file systems, FreeBSD supports a multitude of other file systems so that data from other operating systems can be accessed locally, such as data stored on locally attached USB storage devices, flash drives, and hard disks. This includes support for the Linux(TM) Extended File System (EXT). +FreeBSD 傳統上使用 Unix File System (UFS) 作為原生檔案系統,後續改良為 UFS2。FreeBSD 也支援以進階功能、穩健性和可靠性聞名的 Z File System (ZFS)。詳情請參考 crossref:zfs[zfs,Z 檔案系統 (ZFS)]。 -There are different levels of FreeBSD support for the various file systems. Some require a kernel module to be loaded and others may require a toolset to be installed. Some non-native file system support is full read-write while others are read-only. +除了原生檔案系統之外,FreeBSD 也廣泛支援其他作業系統的檔案系統。這些檔案系統的支援程度不一,有些需要載入核心模組,有些則需要安裝額外的 Userland 工具。 -讀完這章,您將了解: +在開始閱讀這章之前,您需要: -* The difference between native and supported file systems. -* Which file systems are supported by FreeBSD. -* How to enable, configure, access, and make use of non-native file systems. +* 熟悉 UNIX(R) 概念及 crossref:basics[basics,FreeBSD 基礎]。 +* 能夠在 FreeBSD 上 crossref:ports[ports,安裝軟體]。 +* 對 crossref:disks[disks,磁碟]、儲存裝置及 FreeBSD 的裝置命名慣例有基本認識。 -在開始閱讀這章之前,您需要: +讀完這章,您將了解: -* Understand UNIX(TM) and crossref:basics[basics,FreeBSD basics]. -* Be familiar with the basics of crossref:kernelconfig[kernelconfig,kernel configuration and compilation]. -* Feel comfortable crossref:ports[ports,installing software] in FreeBSD. -* Have some familiarity with crossref:disks[disks,disks], storage, and device names in FreeBSD. +* 原生檔案系統與支援的檔案系統之間的差異。 +* FreeBSD 支援哪些檔案系統及其支援程度。 +* 如何啟用、設定、存取及使用非原生檔案系統。 [[filesystems-linux]] -== Linux(TM) 檔案系統 - -FreeBSD provides built-in support for several Linux(TM) file systems. This section demonstrates how to load support for and how to mount the supported Linux(TM) file systems. +== Linux(R) 檔案系統 -=== ext2 +FreeBSD 內建對幾種 Linux(R) 檔案系統的支援。本節說明如何載入支援模組及掛載所支援的 Linux(R) 檔案系統。 -Kernel support for ext2 file systems has been available since FreeBSD 2.2. In FreeBSD 8.x and earlier, the code is licensed under the GPL. Since FreeBSD 9.0, the code has been rewritten and is now BSD licensed. +[[ext]] +=== Extended File System (EXT) -The man:ext2fs[5] driver allows the FreeBSD kernel to both read and write to ext2 file systems. +自 FreeBSD 2.2 起,核心便已支援 Extended File System (EXT)。man:ext2fs[5] 驅動程式讓 FreeBSD 核心能讀寫 ext2、ext3 及 ext4 檔案系統。 -[NOTE] +[WARNING] ==== -This driver can also be used to access ext3 and ext4 file systems. The man:ext2fs[5] filesystem has full read and write support for ext4 as of FreeBSD 12.0-RELEASE. Additionally, extended attributes and ACLs are also supported, while journalling and encryption are not. Starting with FreeBSD 12.1-RELEASE, a DTrace provider will be available as well. Prior versions of FreeBSD can access ext4 in read and write mode using package:sysutils/fusefs-ext2[]. +目前尚不支援日誌 (Journalling) 及加密功能。 ==== -To access an ext file system, first load the kernel loadable module: +要存取 ext 檔案系統,請指定其 FreeBSD 分割區名稱及現有的掛載點來掛載 ext 磁碟區。以下範例將 [.filename]#/dev/ada1s1# 掛載到 [.filename]#/mnt#: + +[source,shell] +.... +# mount -t ext2fs /dev/ada1s1 /mnt +.... + +[[filesystems-windows]] +== Windows(R) 檔案系統 + +FreeBSD 支援 FAT、exFAT 和 NTFS 檔案系統,可存取 Windows 格式的儲存裝置。 + +[[fat]] +=== FAT 檔案系統 + +FAT 檔案系統簡單且穩定。雖然在效能、可靠性和擴展性上不如現代的替代方案,但由於各種作業系統都支援它,因此成為裝置間交換資料的常見選擇。 + +要存取 FAT 檔案系統,請指定其 FreeBSD 分割區名稱及現有的掛載點來掛載 FAT 磁碟區。以下範例將 [.filename]#/dev/ada0s1# 掛載到 [.filename]#/mnt#: + +[source,shell] +.... +# mount -t msdosfs /dev/ada0s1 /mnt +.... + +[[ex-fat]] +=== exFAT 檔案系統 + +exFAT (Extended File Allocation Table) 是一種針對快閃儲存裝置(如 USB 隨身碟和 SD 卡)設計的輕量檔案系統。它支援大檔案,並廣泛用於各種平台,很適合外接儲存裝置使用。 + +要在 FreeBSD 上使用 exFAT,請安裝 package:filesystems/exfat[] 套件、載入 FUSE 核心模組,然後掛載檔案系統,步驟如下: + +安裝 exFAT 套件: + +[source,shell] +.... +# pkg install fusefs-exfat +.... + +使用 FUSE 檔案系統前,先載入 man:fusefs[5] 核心模組: + +[source,shell] +.... +# kldload fusefs +.... + +使用 man:sysrc[8] 讓模組在開機時自動載入: + +[source,shell] +.... +# sysrc kld_list+=fusefs +.... + +指定 FreeBSD 分割區名稱及現有的掛載點來掛載 exFAT 磁碟區。以下範例將 [.filename]#/dev/ada0s1# 掛載到 [.filename]#/mnt#: + +[source,shell] +.... +# mount.exfat /dev/ada0s1 /mnt +.... + +[[using-ntfs]] +=== NTFS 檔案系統 + +NTFS 是 Microsoft(R) 開發的穩健檔案系統,廣泛用於 Windows 作業系統。FreeBSD 透過 package:filesystems/ntfs[] 套件提供完整的 NTFS 讀寫支援,方便存取和修改 NTFS 格式的儲存裝置。 + +要在 FreeBSD 上使用 NTFS,請安裝 package:filesystems/ntfs[] 套件、載入 FUSE 核心模組,然後掛載檔案系統,步驟如下: + +安裝 NTFS 套件: + +[source,shell] +.... +# pkg install fusefs-ntfs +.... + +使用 FUSE 檔案系統前,先載入 man:fusefs[5] 核心模組: + +[source,shell] +.... +# kldload fusefs +.... + +使用 man:sysrc[8] 讓模組在開機時自動載入: + +[source,shell] +.... +# sysrc kld_list+=fusefs +.... + +指定 FreeBSD 分割區名稱及現有的掛載點來掛載 NTFS 磁碟區。以下範例將 [.filename]#/dev/ada0s1# 掛載到 [.filename]#/mnt#: + +[source,shell] +.... +# ntfs-3g /dev/ada0s1 /mnt +.... + +[[filesystems-macos]] +== MacOS(R) 檔案系統 + +FreeBSD 支援 MacOS(R) 檔案系統,包括 HFS/HFS+,可存取 Apple(R) 系統格式化的儲存裝置。 + +[[hfs]] +=== HFS/HFS+ 檔案系統 + +HFS/HFS+ 是 APFS 之前 MacOS 使用的主要檔案系統,常見於較舊的 Mac 裝置和外接磁碟。FreeBSD 透過 package:filesystems/hfsfuse[] 套件提供 HFS/HFS+ 的唯讀支援。 + +要在 FreeBSD 上使用 HFS/HFS+,請安裝 package:filesystems/hfsfuse[] 套件、載入 FUSE 核心模組,然後掛載檔案系統,步驟如下: + +安裝 HFS/HFS+ 套件: + +[source,shell] +.... +# pkg install fusefs-hfsfuse +.... + +使用 FUSE 檔案系統前,先載入 man:fusefs[5] 核心模組: + +[source,shell] +.... +# kldload fusefs +.... + +使用 man:sysrc[8] 讓模組在開機時自動載入: [source,shell] .... -# kldload ext2fs +# sysrc kld_list+=fusefs .... -Then, mount the ext volume by specifying its FreeBSD partition name and an existing mount point. This example mounts [.filename]#/dev/ad1s1# on [.filename]#/mnt#: +指定 FreeBSD 分割區名稱及現有的掛載點來掛載 HFS/HFS+ 磁碟區。以下範例將 [.filename]#/dev/ada0s1# 掛載到 [.filename]#/mnt#: [source,shell] .... -# mount -t ext2fs /dev/ad1s1 /mnt +# hfsfuse /dev/ada0s1 /mnt ....