Skip to content

Latest commit

 

History

History
99 lines (78 loc) · 4 KB

File metadata and controls

99 lines (78 loc) · 4 KB
title part prev next showBookMenu weight path
章 20. 其他檔案系統
部 III. 系統管理
books/handbook/zfs
books/handbook/virtualization
true
24
/books/handbook/filesystems/

其他檔案系統

1. 概述

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.

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™ Extended File System (EXT).

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.

讀完這章,您將了解:

  • 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.

在開始閱讀這章之前,您需要:

  • Understand UNIX™ 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.

2. Linux™ 檔案系統

FreeBSD provides built-in support for several Linux™ file systems. This section demonstrates how to load support for and how to mount the supported Linux™ file systems.

2.1. ext2

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.

The man:ext2fs[5] driver allows the FreeBSD kernel to both read and write to ext2 file systems.

Note

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[].

To access an ext file system, first load the kernel loadable module:

# kldload ext2fs

Then, mount the ext volume by specifying its FreeBSD partition name and an existing mount point. This example mounts /dev/ad1s1 on /mnt:

# mount -t ext2fs /dev/ad1s1 /mnt