Merge pull request #94 from flsf/master

补充翻译Choosing a Journaling File System
This commit is contained in:
Xingyu.Wang 2013-10-07 17:56:30 -07:00
commit 6b1e354c31
2 changed files with 264 additions and 262 deletions

View File

@ -1,262 +0,0 @@
选择一个日志文件系统
================
通俗的说,计算机的文件系统就是一个像磁盘这样的存储设备如何存储、检索以及管理文件的方式。文件系统需要记录的不仅是文件本身每一个字节,及其在存储设备上的位置,还要存储文件相关的信息。比如,也要存储每个文件的名字、文件存放的层次结构(目录),还有文件的元数据,像文件的修改时间等。
虽然在linux上可以使用许多不同的文件系统但是绝大多数用户很少去关注使用哪一个它们通常都被忽视了。选择使用什么样的文件系统视情况而定要考虑的相关因素包括兼容性、性能、还原能力、使用的介质、存储介质的大小和数量、特性还有安全考虑等。
日志文件系统是一种特殊类型的文件系统,它记录一个被称为日志的追踪文件。日志可以让系统能够修复在异常终止时出现的不一致情况。它通过追踪之前提交到主文件系统的更改。在计算机非正常关机的情况下,任何数据丢失都可被重建。因此,这种文件系统不太可能遭受破坏,并且可以使文件系统快速恢复工作。
为了深入了解日志文件系统的使用,我们整理出一个首选列表。
现在,让我们讨论一下手边的日志文件系统。
- [ext3][1] 许多流行的Linux发行版默认的文件系统
- [XFS][2] 为高性能和大文件设计的文件系统
- [Btrfs][3] 校检copy-on-write(写入时复制)文件系统
- [ext4][4] 由ext3增加许多显著特性和扩展进化而来的文件系统
###ext3
ext3, or third extended filesystem, is a journaled file system that is commonly used by the Linux kernel. The journaling capability means no more waiting for fsck's or worrying about metadata corruption.
It is the default file system for many popular Linux distributions, including Debian. ext3 was originally released in September 1999.
Ext3 partitions contain a used space of 5% for special reasons by default. The main reason is so root can log in even when the filesystem becomes full.
> **ext3**
> 0.9.18
> Price : Free to download
> Size : 13.8KB
> License : GNU GPL
> Developer : Stephen Tweedie
> Website : ftp://ftp.kernel.org/
> System Requirements :
> Support Sites : [FAQ][5], [Mailing List][6]
> Selected Reviews:
Features include:
- Simple, robust, and extensible
- In-kernel and userspace code has been extensively tested
-Adds features to ext2:
- A journal - improves reliability and eliminates the need to check the file system after an unclean shutdown
- Various journal modes: Journal, Ordered, and Writeback
- Automatic recover when the filesystem is remounted
- All VFS operations (including quota) should be journaled
- Add data updates are also journaled
- Online file system growth
- HTree indexing for larger directories
- Extended attribute blocks and large inodes
- Online filesystem resize reservations
- Hash-indexed directories
- Journal file/device present
- File type in directory entries
- Journal recovery required
- Reduced block group backups
- Reduced superblock backups
- Files larger than 2GiB in size
- Easy conversion of ext2 file systems without needing to backup, recover and format the partition
- Unix permission, ACLs and arbitrary security attributes
###XFS
XFS is a 64-bit, high-performance journaling file system with guaranteed filesystem consistency created by Silicon Graphics, Inc. It was the default file system in IRIX releases 5.3 and onwards and later ported to the Linux kernel.
XFS combines advanced journaling technology with full 64-bit addressing and scalable structures and algorithms.
XFS has been maintained in the official Linux kernel kernel trees starting with Linux 2.4. All modern Linux distributions include support for XFS.
> **XFS**
> Price : Free to download
> License : GNU GPL v2
> Developer : Silicon Graphics Inc.
> Website: http://oss.sgi.com/projects/xfs/
> System Requirements
> Support Sites: http://XFS.org, [FAQ][7], [Mailing Lists][8]
> Selected Reviews:
Features include:
- Quick Recovery - restarts very quickly after an unexpected interruption, regardless of the number of files it is managing
- Fast Transactions - provides the advantages of journaling while minimizing the performance impact of journaling on read and write data transactions
- Massive scalability - supports a maximum file system size of 8 exbibytes minus one
- Efficient Allocations - implements extremely sophisticated space management technique
- Excellent Bandwidth - capable of delivering very close to the raw I/O performance that the underlying hardware can provide
- Provides journaling for file system metadata, where file system updates are first written to a serial journal before the actual disk blocks are updated
- Supports filesystem growth for mounted volumes, allows filesystem "freeze" and "thaw" operations to support volume level snapshots, and provides an online file defragmentation utility
- Implements fully journaled extended attributes
- Supports the ACL semantics and interfaces described in the draft POSIX 1003.1e standard
- NFS Compatibility
- Uses the Open Source Samba server to export XFS filesystems to Microsoft Windows systems
- Data Management API (DMAPI/XDSM) allows implementation of hierarchical storage management software with no kernel modifications
- Supports the notion of a "realtime subvolume" - a separate area of disk space where only file data is stored
###Btrfs
Btrfs (B-Tree File System) is a Copy on Write file system for Linux. Copy On Write (COW) is an optimization technique for maintaining a copy of a collection of data, handling resources when multiple tasks are using the same data.
The aim of this journaling file system is to bring more efficient storage management and better data integrity features to Linux.
Btrfs is notable for implementing advanced features whilst maintaining fault tolerance, scalability and reliability. The file system has been in development since 2007 and its code base has now reached a level of maturity that its disk format should not change. The code base is under heavy development.
Btrfs debuted in the Linux 2.6.29 released. Btrfs can handle up to 2 64 inodes, less a few hundred for special items.
> **Btrfs**
> Price : Free to download
> License : GNU GPL
> Developer : Oracle Corporation
> Website : http://btrfs.wiki.kernel.org
> System Requirements
> Support Sites: [A Beginner's Guide to Btrfs][9], [How I Use the Advanced Capabilities of Btrfs][10], [Getting Started with the Btrfs File System][11]
> Selected Reviews: [Josef Bacik][12]
Features include:
- Scalable, 64-bit file system that can span large volumes to provide files and file systems as large as 16 exabytes
- Integrated volume management
- Online file system defragmentation - defragging can occur while the drive is mounted or online
- Offline filesystem check
- Online volume growth and shrinking
- Online block device addition and removal
- Online balancing (movement of objects between block devices to balance load)
- Offline filesystem check
- Uses a B-tree structure to store data types and point to information stored on disk
- Online data scrubbing for finding errors and automatically fixing them for files with redundant copies
- Delayed allocation to allow for better disk allocation
- Space-efficient packing of small files
- Space-efficient indexed directories
- Subvolumes (separate internal filesystem roots)
- Transparent compression (zlib and LZO)
- Simple to use writable snapshots, read-only snapshots. Snapshots show up as normal directories under the snapshotted directory
- Send/receive (saving diffs between snapshots to a binary stream)
- Data integrity:
- Built-in RAID support (RAID0, RAID1, RAID5, RAID6 and RAID10). Data scrubbing can be used, particularly with RAID 1
- Fault isolation and checksum algorithms - fault isolation is achieved by storing metadata separately from user data
- Checksums on data and all metadata (CRC-32C). Option to turn off data checksumming
- Even on a single device, metadata is duplicated and maintained in two locations for redundancy
- Rebuild times
- Encryption
- File cloning (copy-on-write on individual files, or byte ranges thereof)
- In-place conversion (with rollback) from ext3/4 to Btrfs
- File system seeding
- SSD (Flash storage) awareness (TRIM/Discard for reporting free blocks for reuse) and optimizations
- File Striping, File Mirroring, File Striping+Mirroring, Striping with Single and Dual Parity implementations
- Hierarchical per-subvolume quota
- Extent based file storage
- Provides minimal user tuning to guard against misuse
###ext4
The ex4, or fourth extended file system, is a journailing file system for Linux which evolved from ext3. It is marked stable in Linux kernel 2.6.28.
ext4 adds many notable features particularly extents - a single descriptor for a range of contiguous blocks, as opposed to the traditional block mapping scheme used by ext2 and ext3. This represents an efficient way to represent large files, as well as utilising CPU more efficiently, and with fewer metadata IOs. This also makes for quicker file system checks, which becomes more beneficial as the file system grows in size.
> **ext4**
> Price : Free to download
> License : GNU GPL
> Developer :Mingming Cao, Andreas Dilger, Alex Zhuravlev (Tomas), Dave Kleikamp, Theodore Ts'o, Eric Sandeen, others
> Website : http://ext4.wiki.kernel.org
> System Requirements
> Support Sites : [Wiki][13], [FAQ][14], [Kernel Newbies][15]
> Selected Reviews:
Features include:
- Extended attribute blocks and large inodes
- Extent-based disk format
- Online Defragmentation
- Online filesystem resize reservations
- Hash-indexed directories
- Journal file/device present
- File type in directory entries
- Journal recovery required
- Files allocated with extent format
- Support for more than 2^32 filesystem blocks
- Flexible block group metadata location
- Reduced block group backups
- Reduced superblock backups
- Files larger than 2GiB in size
- Group descriptor checksums and sparse inode table
- Over 32000 subdirectories
- Inode-features
- Larger inodes
- Inode reservation
- Nanosecond timestamps and creation time
- Files larger than 2TiB in size
- Journal checksumming - checksums the journal data to know if the journal blocks are failing or corrupted
- Option to turn off journaling
- Persistent preallocation
- Backward compatible with ext2 and ext3
- Allocation schemes:
- Persistent pre-allocation
- Delayed allocation
- Multi-block allocation
- Stripe-aware allocation
- Extended attributes
- Quota journaling
- Implements discard/TRIM
---
via: http://www.linuxlinks.com/article/20130927180305497/JournalingFileSystems.html
本文由 [LCTT][] 原创翻译,[Linux中国][] 荣誉推出
译者:[flsf][] 校对:[Caroline][]
[LCTT]:https://github.com/LCTT/TranslateProject
[Linux中国]:http://linux.cn/portal.php
[flsf]:http://linux.cn/space/flsf01
[Caroline]:http://linux.cn/space/14763
[1]:ftp://ftp.kernel.org/pub/linux/kernel/people/sct/ext3/
[2]:http://oss.sgi.com/projects/xfs/
[3]:http://btrfs.wiki.kernel.org/
[4]:https://ext4.wiki.kernel.org/index.php/Main_Page
[5]:http://batleth.sapienti-sat.org/projects/FAQs/ext3-faq.html
[6]:https://listman.redhat.com/archives/ext3-users/
[7]:http://xfs.org/index.php/XFS_FAQ
[8]:http://xfs.org/index.php/XFS_email_list_and_archives
[9]:http://www.howtoforge.com/a-beginners-guide-to-btrfs
[10]:http://www.oracle.com/technetwork/articles/servers-storage-admin/advanced-btrfs-1734952.html
[11]:http://www.oracle.com/technetwork/articles/servers-storage-admin/gettingstarted-btrfs-1695246.html
[12]:http://static.usenix.org/publications/login/2012-02/openpdfs/Bacik.pdf
[13]:https://ext4.wiki.kernel.org/index.php/Main_Page
[14]:https://ext4.wiki.kernel.org/index.php/Frequently_Asked_Questions
[15]:http://kernelnewbies.org/Ext4

View File

@ -0,0 +1,264 @@
选择一个日志文件系统
================
通俗的说,计算机的文件系统就是一个像磁盘这样的存储设备如何存储、检索以及管理文件的方式。文件系统需要记录的不仅是文件本身每一个字节,及其在存储设备上的位置,还要存储文件相关的信息。比如,也要存储每个文件的名字、文件存放的层次结构(目录),还有文件的元数据,像文件的修改时间等。
虽然在linux上可以使用许多不同的文件系统但是绝大多数用户很少去关注使用哪一个它们通常都被忽视了。选择使用什么样的文件系统视情况而定要考虑的相关因素包括兼容性、性能、还原能力、使用的介质、存储介质的大小和数量、特性还有安全考虑等。
日志文件系统是一种特殊类型的文件系统,它记录一个被称为日志的追踪文件。日志可以让系统能够修复在异常终止时出现的不一致情况。它通过追踪之前提交到主文件系统的更改。在计算机非正常关机的情况下,任何数据丢失都可被重建。因此,这种文件系统不太可能遭受破坏,并且可以使文件系统快速恢复工作。
为了深入了解日志文件系统的使用,我们整理出一个首选列表。
现在,让我们讨论一下手边的日志文件系统。
- [ext3][1] 许多流行的Linux发行版默认的文件系统
- [XFS][2] 为高性能和大文件设计的文件系统
- [Btrfs][3] 校检copy-on-write(写入时复制)文件系统
- [ext4][4] 由ext3增加许多显著特性和扩展进化而来的文件系统
###ext3
ext3, 或者叫第三扩展文件系统,它是一个通常被用于Linux内核的日志文件系统.日志功能意味着不会有更多的对fsck的等待和对元数据损坏的担心.
它是许多流行的Linux发行版的默认文件系统,包括Debian.ext3 最初发布时间是1999年9月.
Ext3 因为特殊原因在默认情况下包含了5%的使用空间.主要原因是保证超级用户(root)甚至在文件系统已满的情况下能够登录.
> **ext3**
> 0.9.18
>价格 : 免费下载
> 大小 : 13.8KB
> 协议 : GNU GPL
> 开发者 : Stephen Tweedie
> 网站 : ftp://ftp.kernel.org/
> 系统依赖
> 支持 : [FAQ][5], [邮件列表][6]
> 选择评论 :
特性包括:
- 简单, 健壮, 可扩展
- 内核和用户空间代码已广泛测试
- ext2上增加的特性
- 日记 - 提高可靠性,并消除异常关机后需要检查文件系统
- 各种日志模式:日志,有序,写回
- 文件系统被重新安装时自动恢复
- 所有的VFS业务包括配额都会记录
- 添加数据更新日志
- 在线文件系统增长
- Htree为更大的目录索引
- 扩展属性块和大量的inode
- 在线文件系统的大小预先调整
- 哈希索引目录
- 日志文件/设备现状
- 目录项中的文件类型
- 日志恢复依赖
- 减少的块组备份
- 减少超级块的备份
- 文件可大于2GiB
- 易于自ext2迁移文件系统而不需要备份恢复和格式化分区
- UNIX权限 ACL和任意的安全属性
###XFS
XFS 是一个64位,高性能的日志文件系统,由Silicon Graphics公司为保证文件系统一致性创建的IRIX5.3和以后版本的默认文件系统后来又移植到Linux内核.
XFS结合先进的日志技术和完整的64位寻址还有可扩展的数据结构和算法。
XFS从Linux2.4开始一直保持在官方Linux内核内核树。所有现代的Linux发行版都包含支持XFS。
> **XFS**
> 价格 : 免费下载
> 协议 : GNU GPL v2
> 开发者 : Silicon Graphics Inc.
> 网站 : http://oss.sgi.com/projects/xfs/
> 系统依赖
> 支持 : http://XFS.org, [FAQ][7], [邮件列表][8]
> 选择评论 :
特性包括:
- 快速恢复 - 意外中断后,重新启动非常快,不受管理文件的数量影像
- 快速事务 - 提供优越的日志同时尽量减少日志在读取和写入数据事务时对性能的影响
- 大规模的可扩展性 - 支持最大文件系统为8艾字节减1
- 有效配置 - 实现极其复杂的空间管理技术
- 出色的带宽 - 能够提供非常接近底层的I/O性能能够提供底层硬件
- 提供日志文件系统元数据,在实际磁盘块更新前首先写入一个连续的日志来更新文件系统
- 支持文件系统的挂载卷增长,使文件系统的“冻结”和“解冻”操作支持卷级快照,并提供了一个在线的文件碎片整理工具
- 实现完全日志扩展属性
- 支持ACL语义和在POSIX 1003.1e标准草案接口描述
- NFS兼容性
- 使用开源的Samba服务导出XFS文件系统到Microsoft Windows系统
- 数据管理APIDMAPI/XDSM的允许实施不修改内核的分层存储管理软件
- 支持“实时子卷”的概念 - 一个独立的区域只有文件数据存储的磁盘空间
###Btrfs
Btrfs(B-树文件系统)是一个Linux写入时复制(Copy on Write)文件系统。写入时复制(COW)是维护数据集合的副本和使用相同数据处理多个任务时管理资源的优化技术(译者注:用于保留某些数据的原始副本的一种技术。在写入操作修改数据时,会复制数据的原始副本)。
这个日志文件系统的目的是给Linux带来更高效的存储管理和更好的数据完整性功能。
Btrfs显著实现高级特性同时保持容错性可扩展性和可靠性。这个文件系统自2007年以来一直在开发它的基本代码现在已经到达了一个成熟的水平其磁盘格式应该不会改变。基本代码在稳重的发展。
Btrfs 首次亮相在Linux2.6.29发布时。Btrfs可以处理多达264个inode少了几百特殊项。
> **Btrfs**
> 价格 : 免费下载
> 协议 : GNU GPL
> 开发者 : Oracle Corporation
> 网站 : http://btrfs.wiki.kernel.org
> 系统依赖
> 支持 : [Btrfs初学者指南][9], [我如何使用Btrfs先进的功能][10], [Btrfs文件系统入门][11]
> 选择评论: [Josef Bacik][12]
特性包括:
- 可扩展, 64位文件系统能够跨越卷提供文件和文件系统大到16艾字节.
- 整体卷管理
- 在线文件系统的碎片整理 - 整理磁盘碎片当驱动挂载或在线时
- 脱机文件系统检查
- 在线卷增长和收缩
- 在线块设备的添加和删除
- 在线平衡(移动对象在块设备之间来平衡负载)
- 使用B-树结构来存储数据类型和存储在磁盘上的信息点
- 在线数据擦除发现错误和自动修复文件冗余副本
- 延迟分配以便更好的磁盘分配
- 空间高效的打包小文键
- 空间高效的索引目录
- 子卷(单独的内部文件系统root)
- 明晰的压缩(zlib和LZO)
- 简单的使用可写快照,只读快照。快照显示为正常的目录,该目录下生成快照
- 发送/接收(以二进制流保存快照之间的差别)
- 数据一致性:
- 内置RAID支持(RAID0RAID1RAID5RAID6和RAID10) 。可用于数据擦除特别是RAID 1
- 故障隔离和校验和算法 - 从用户数据分开存储的元数据实现故障隔离
- 校验数据和元数据CRC- 32C 。可以选择关闭数据校验和
- 即使在一个单一的设备,元数据被复制在两个位置中保持冗余
- 重建时间
- 加密
- 文件克隆(在个人文件写入时复制,或字节范围)
- 原地迁移ext3/4到BTRFS(回滚)
- 文件系统seeding
- SSD 闪存认知TRIM /丢弃报告重用的空闲块)和优化
- 文件条带化,文件镜像化,文件条带化+镜像化,单双奇偶校验实现条带化
- 每个子卷分层配额
- 基于扩展的文件存储
- 提供了用户最低限度的调整,以防范滥用
###ext4
ext4或第四扩展文件系统是一个Linux日志文件系统由ext3演变而来。它在Linux内核2.6.28显著稳定。
ext4的增加了许多显著特性 - 一个单一的为了一系列连续的块描述而不是传统的使用ext2和ext3块映射体系。这代表一个有效的方式来表示大文件以及更高效的CPU 利用,并以更少的元数据的输入输出(IO)。这也使文件系统检查更快,更加有利的是:文件系统规模的增长。
> **ext4**
> 价格 : 免费下载
> 协议 : GNU GPL
> 开发者 :Mingming Cao, Andreas Dilger, Alex Zhuravlev (Tomas), Dave Kleikamp, Theodore Ts'o, Eric Sandeen, others
> 网站 : http://ext4.wiki.kernel.org
> 系统依赖
> 支持 : [Wiki][13], [FAQ][14], [内核新手][15]
> 选择评论:
特性包括:
- 扩展属性块和大量的inode
- 基于扩展的磁盘格式
- 在线碎片整理
- 在线文件系统的大小预先调整
- 哈希索引目录
- 日志文件/设备现状
- 目录项中的文件类型
- 日志恢复依赖
- 文件分配扩展格式
- 支持超过2^32个文件系统块
- 灵活的块组元数据的位置
- 减少的块组备份
- 减少超级块的备份
- 文件可大于2GiB
- 组描述符校验和稀疏inode表
- 超过32000个子目录
- inode特性
- 更大的inode
- inode的预订
- 纳秒级时间戳和创建时间
- 文件可大于2TiB
- 日志校验 - 校验日志数据当知道日志块发生故障或损坏
- 可以选择关闭日志
- 持久预分配
- 向后兼容ext2和ext3
- 分配方案:
- 持久预分配
- 延迟分配
- 多块分配
- 条纹感知分配
- Implements discard/TRIM
- 扩展属性
- 配额日志
- 实现 discard/TRIM(译者注:任务相关教学法)
---
via: http://www.linuxlinks.com/article/20130927180305497/JournalingFileSystems.html
本文由 [LCTT][] 原创翻译,[Linux中国][] 荣誉推出
译者:[flsf][] 校对:[Caroline][]
[LCTT]:https://github.com/LCTT/TranslateProject
[Linux中国]:http://linux.cn/portal.php
[flsf]:http://linux.cn/space/flsf01
[Caroline]:http://linux.cn/space/14763
[1]:ftp://ftp.kernel.org/pub/linux/kernel/people/sct/ext3/
[2]:http://oss.sgi.com/projects/xfs/
[3]:http://btrfs.wiki.kernel.org/
[4]:https://ext4.wiki.kernel.org/index.php/Main_Page
[5]:http://batleth.sapienti-sat.org/projects/FAQs/ext3-faq.html
[6]:https://listman.redhat.com/archives/ext3-users/
[7]:http://xfs.org/index.php/XFS_FAQ
[8]:http://xfs.org/index.php/XFS_email_list_and_archives
[9]:http://www.howtoforge.com/a-beginners-guide-to-btrfs
[10]:http://www.oracle.com/technetwork/articles/servers-storage-admin/advanced-btrfs-1734952.html
[11]:http://www.oracle.com/technetwork/articles/servers-storage-admin/gettingstarted-btrfs-1695246.html
[12]:http://static.usenix.org/publications/login/2012-02/openpdfs/Bacik.pdf
[13]:https://ext4.wiki.kernel.org/index.php/Main_Page
[14]:https://ext4.wiki.kernel.org/index.php/Frequently_Asked_Questions
[15]:http://kernelnewbies.org/Ext4