热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

全面指南:RedHatEnterpriseLinux6中的Ext3文件系统详解

第五章详细探讨了RedHatEnterpriseLinux6中的Ext3文件系统。5.1节介绍了如何创建Ext3文件系统,包括必要的命令和步骤,以及在实际操作中可能遇到的问题和解决方案。此外,还涵盖了Ext3文件系统的性能优化和维护技巧,为用户提供全面的操作指南。

Chapter 5. The Ext3 File System

5.1. Creating an Ext3 File System
5.2. Converting to an Ext3 File System
5.3. Reverting to an Ext2 File System
The ext3 file system is essentially an enhanced version of the ext2 file system. These improvements provide the following advantages:
Availability
After an unexpected power failure or system crash (also called an  unclean system shutdown), each mounted ext2 file system on the machine must be checked for consistency by the  e2fsck program. This is a time-consuming process that can delay system boot time significantly, especially with large volumes containing a large number of files. During this time, any data on the volumes is unreachable.
It is possible to run  fsck -n on a live filesystem. However, it will not make any changes and may give misleading results if partially written metadata is encountered.
If LVM is used in the stack, another option is to take an LVM snapshot of the filesystem and run  fsck on it instead.
Finally, there is the option to remount the filesystem as read only. All pending metadata updates (and writes) are then forced to the disk prior to the remount. This ensures the filesystem is in a consistent state, provided there is no previous corruption. It is now possible to run  fsck -n.
The journaling provided by the ext3 file system means that this sort of file system check is no longer necessary after an unclean system shutdown. The only time a consistency check occurs using ext3 is in certain rare hardware failure cases, such as hard drive failures. The time to recover an ext3 file system after an unclean system shutdown does not depend on the size of the file system or the number of files; rather, it depends on the size of the  journal used to maintain consistency. The default journal size takes about a second to recover, depending on the speed of the hardware.

Note

The only journaling mode in ext3 supported by Red Hat is  data=ordered (default).
Data Integrity
The ext3 file system prevents loss of data integrity in the event that an unclean system shutdown occurs. The ext3 file system allows you to choose the type and level of protection that your data receives. With regard to the state of the file system, ext3 volumes are configured to keep a high level of data consistency by default.
Speed
Despite writing some data more than once, ext3 has a higher throughput in most cases than ext2 because ext3's journaling optimizes hard drive head motion. You can choose from three journaling modes to optimize speed, but doing so means trade-offs in regards to data integrity if the system was to fail.
Easy Transition
It is easy to migrate from ext2 to ext3 and gain the benefits of a robust journaling file system without reformatting. Refer to  Section 5.2, “Converting to an Ext3 File System” for more information on how to perform this task.
The Red Hat Enterprise Linux 6 version of ext3 features the following updates:
Default Inode Sizes Changed
The default size of the on-disk inode has increased for more efficient storage of extended attributes, for example, ACLs or SELinux attributes. Along with this change, the default number of inodes created on a file system of a given size has been decreased. The inode size may be selected with the  mke2fs -I option or specified in  /etc/mke2fs.conf to set system wide defaults for  mke2fs.

Note

If you upgrade to Red Hat Enterprise Linux 6 with the intention of keeping any ext3 file systems intact, there is no need to remake the file system.
New Mount Option:  data_err
A new mount option has been added:  data_err=abort. This option instructs ext3 to abort the journal if an error occurs in a file data (as opposed to metadata) buffer in  data=ordered mode. This option is disabled by default (set as  data_err=ignore).
More Efficient Storage Use
When creating a file system (that is,  mkfs),  mke2fs will attempt to "discard" or "trim" blocks not used by the file system metadata. This helps to optimize SSDs or thinly-provisioned storage. To suppress this behavior, use the  mke2fs -K option.
The following sections cover creating and tuning ext3 partitions. For ext2 partitions, skip the partitioning and formatting sections below and go directly to  Section 5.2, “Converting to an Ext3 File System”.

⁠5.1. Creating an Ext3 File System

After installation, it is sometimes necessary to create a new ext3 file system. For example, if a new disk drive is added to the system, you may want to partition the drive and use the ext3 file system.
The steps for creating an ext3 file system are as follows:

Procedure 5.1. Create an ext3 file system

  1. Format the partition with the ext3 file system using  mkfs.
  2. Label the file system using  e2label.

⁠5.2. Converting to an Ext3 File System

The  tune2fs command converts an  ext2 file system to  ext3.

Note

A default installation of Red Hat Enterprise Linux uses ext4 for all file systems. However, to convert ext2 to ext3, always use the  e2fsck utility to check your file system before and after using  tune2fs. Before trying to convert ext2 to ext3, back up all file systems in case any errors occur.
In addition, Red Hat recommends creating a new ext3 file system and migrating data to it, instead of converting from ext2 to ext3 whenever possible.
To convert an  ext2 file system to  ext3, log in as root and type the following command in a terminal:
# tune2fs -j block_device
block_device contains the ext2 file system to be converted.
A valid block device can be one of two types of entries:
A mapped device
A logical volume in a volume group, for example,  /dev/mapper/VolGroup00-LogVol02.
A static device
A traditional storage volume, for example,  /dev/sdbX, where  sdb is a storage device name and  X is the partition number.
Issue the  df command to display mounted file systems.

⁠5.3. Reverting to an Ext2 File System

In order to revert to an ext2 file system, use the following procedure.
For simplicity, the sample commands in this section use the following value for the block device:
/dev/mapper/VolGroup00-LogVol02

Procedure 5.2. Revert from ext3 to ext2

  1. Unmount the partition by logging in as root and typing:
    # umount /dev/mapper/VolGroup00-LogVol02
  2. Change the file system type to ext2 by typing the following command:
    # tune2fs -O ^has_journal /dev/mapper/VolGroup00-LogVol02
  3. Check the partition for errors by typing the following command:
    # e2fsck -y /dev/mapper/VolGroup00-LogVol02
  4. Then mount the partition again as ext2 file system by typing:
    # mount -t ext2 /dev/mapper/VolGroup00-LogVol02 /mount/point
    In the above command, replace  /mount/point with the mount point of the partition.

    Note

    If a  .journal file exists at the root level of the partition, delete it.
To permanently change the partition to ext2, remember to update the  /etc/fstab file, otherwise it will revert back after booting.

推荐阅读
  • 本文简要介绍了 MacOS 系统的分区与引导机制。通过详细解析系统分区结构和引导加载过程,帮助用户更好地理解 MacOS 的启动流程。文章还涵盖了不同版本 MacOS 的分区特点,以及如何在遇到引导问题时进行故障排除。对于希望深入了解 MacOS 内部运作机制的用户来说,本文提供了丰富的技术细节和实用建议。 ... [详细]
  • JVM参数设置与命令行工具详解
    JVM参数配置与命令行工具的深入解析旨在优化系统性能,通过合理设置JVM参数,确保在高吞吐量的前提下,有效减少垃圾回收(GC)的频率,进而降低系统停顿时间,提升服务的稳定性和响应速度。此外,本文还将详细介绍常用的JVM命令行工具,帮助开发者更好地监控和调优JVM运行状态。 ... [详细]
  • 技术日志:深入探讨Spark Streaming与Spark SQL的融合应用
    技术日志:深入探讨Spark Streaming与Spark SQL的融合应用 ... [详细]
  • 提升工作效率:掌握这些技巧,IDEA 使用效率翻倍 | IDEA 高效操作指南
    提升工作效率:掌握这些技巧,IDEA 使用效率翻倍 | IDEA 高效操作指南 ... [详细]
  • 内网渗透技术详解:PTH、PTT与PTK在域控环境中的应用及猫盘内网穿透配置
    本文深入探讨了内网渗透技术,特别是PTH、PTT与PTK在域控环境中的应用,并详细介绍了猫盘内网穿透的配置方法。通过这些技术,安全研究人员可以更有效地进行内网渗透测试,解决常见的渗透测试难题。此外,文章还提供了实用的配置示例和操作步骤,帮助读者更好地理解和应用这些技术。 ... [详细]
  • OpenCV 2.4.9 源码解析:级联分类器的错误率与尺寸分析 ... [详细]
  • NVIDIA最新推出的Ampere架构标志着显卡技术的一次重大突破,不仅在性能上实现了显著提升,还在能效比方面进行了深度优化。该架构融合了创新设计与技术改进,为用户带来更加流畅的图形处理体验,同时降低了功耗,提升了计算效率。 ... [详细]
  • 欢迎来到Netgen新时代:探索网络生成技术的无限可能
    欢迎进入Netgen的新时代:探索网络生成技术的无限潜力。本文将详细介绍如何编译下载的Netgen源代码,生成Netgen程序,并提供开发所需的库nglib。此外,还将探讨Netgen在现代网络设计与仿真中的应用前景,以及其在提高网络性能和可靠性方面的关键作用。 ... [详细]
  • RancherOS 是由 Rancher Labs 开发的一款专为 Docker 设计的轻量级 Linux 发行版,提供了一个全面的 Docker 运行环境。其引导镜像仅 20MB,非常适合在资源受限的环境中部署。本文将详细介绍如何在 ESXi 虚拟化平台上安装和配置 RancherOS,帮助用户快速搭建高效、稳定的容器化应用环境。 ... [详细]
  • 在Python 3环境中,当无法连接互联网时,可以通过下载离线模块包来实现模块的安装。具体步骤包括:首先从PyPI网站下载所需的模块包,然后将其传输到目标环境,并使用`pip install`命令进行本地安装。此方法不仅适用于单个模块,还支持依赖项的批量安装,确保开发环境的完整性和一致性。 ... [详细]
  • 本文探讨了将PEBuilder转换为DIBooter.sh的方法,重点介绍了如何将DI工具集成到启动层,实现离线镜像引导安装。通过使用DD命令替代传统的grub-install工具,实现了GRUB的离线安装。此外,还详细解析了bootice工具的工作原理及其在该过程中的应用,确保系统在无网络环境下也能顺利引导和安装。 ... [详细]
  • Linux学习精华:程序管理、终端种类与命令帮助获取方法综述 ... [详细]
  • 深入RTOS实践,面对原子操作提问竟感困惑
    在实时操作系统(RTOS)的实践中,尽管已经积累了丰富的经验,但在面对原子操作的具体问题时,仍感到困惑。本文将深入探讨RTOS中的原子操作机制,分析其在多任务环境下的重要性和实现方式,并结合实际案例解析常见的问题及解决方案,帮助读者更好地理解和应用这一关键技术。 ... [详细]
  • 解决 Bash 环境下 MySQL 命令未找到问题的多种方法及专业建议
    在 Bash 环境中,安装 MySQL 后若遇到 `mysql` 命令未找到的问题,通常是因为系统默认搜索路径 `/usr/bin` 中没有包含该命令。为解决此问题,可以采取多种方法,如更新系统 PATH 环境变量、创建符号链接或手动指定 MySQL 安装路径。此外,建议检查 MySQL 服务是否已正确启动,并确保相关配置文件无误,以确保命令执行顺利。 ... [详细]
  • Redis客户端使用指南与学习笔记
    本书基于Redis 3.0版本编写,虽然与后续版本存在一些差异,但仍详细介绍了Redis服务器的一对多客户端连接机制。书中不仅涵盖了基本的安装配置和命令操作,还深入探讨了数据结构、持久化策略及性能优化等高级主题,适合初学者和进阶用户参考学习。 ... [详细]
author-avatar
僾媙
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有