JBD Journaling block device

简介:

在看man mount, ext4章节关于barrier的讲解时有提到JBD.

这里摘录一下wikipedia的解释.

JBD在Linux内核中是负责记录块设备日志的, 某些文件系统会使用JBD以及它的事务特性来确保文件系统在操作系统异常DOWN机后可恢复到一致性的状态.


JBD, or journaling block device, is a generic block device journaling layer in the Linux kernel written by Stephen C. Tweedie from Red Hat.

Overview[edit]

The Journaling Block Device (JBD) provides a filesystem-independent interface for filesystem journaling. ext3ext4 and OCFS2 are known to use JBD. OCFS2starting from linux 2.6.28[1] and ext4 use a fork of JBD called JBD2.[2]

JBD structures[edit]

Atomic handle[edit]

An atomic handle as basically a collection of all the low-level changes that occur during a single high-level atomic update to the file system. The atomic handle guarantees that the high-level update either happens or not, because the actual changes to the file system are flushed only after logging the atomic handle in the journal.

Transaction[edit]

For the sake of efficiency and performance, JBD groups several atomic handles into a single transaction, which is written to the journal after a fixed amount of time elapses or there is no free space left on the journal to fit it.

The transaction has several states:

  • Running - it means that the transaction is still live and can accept more handles
  • Locked - not accepting new handles, but the existing ones are still unfinished
  • Flush - the transaction is complete and is being written to the journal
  • Commit - the transaction is written to the journal and now the changes are being applied to the file system
  • Finished - the transaction has been fully written to the journal and the block device. It can be deleted from the journal.

Recovery[edit]

Based on the transaction states, the JBD is able to determine which transactions need to be replayed (or reapplied) to the file system.

Sources[edit]


[参考]
目录
相关文章
|
关系型数据库 MySQL Java
mysql启动和关闭外键约束的方法(FOREIGN_KEY_CHECKS)
本文主要讲mysql启动和关闭外键约束的方法
1107 0
|
容器 Kubernetes API
深入解析 Kubebuilder:让编写 CRD 变得更简单
作者 | 刘洋(炎寻) 阿里云高级开发工程师 导读:自定义资源 CRD(Custom Resource Definition)可以扩展 Kubernetes API,掌握 CRD 是成为 Kubernetes 高级玩家的必备技能,本文将介绍 CRD 和 Controller 的概念,并对 CRD 编写框架 Kubebuilder 进行深入分析,让您真正理解并能快速开发 CRD。
13791 3
|
消息中间件 传感器 弹性计算
个人云服务器搭建MQTT服务器
MQTT👉MQTT(Message Queuing Telemetry Transport)即消息队列遥测传输协议• 是一个轻量的发布订阅模式消息传输协议,专门针对低带宽和不稳定网络环境的物联网应用设计• 设计者:Andy Stanford-Clark 与 Arlen Nipper• IBM于1999 年首次发布,当前由OASIS MQTT Technical Committee管理• 官方网站:http://mqtt.org/MQTT.fx。
个人云服务器搭建MQTT服务器
|
Web App开发 数据采集 JavaScript
有JavaScript动态加载的内容如何抓取
有JavaScript动态加载的内容如何抓取
|
存储 弹性计算 资源调度
K8S下一代设备管理机制:DRA
背景Kubernetes从1.8开始引入了Device Plugin机制,用于第三方设备厂商以插件化的方式将设备资源(GPU、RDMA、FPGA、InfiniBand等)接入Kubernetes集群中。用户无需修改Kubernetes代码,只需在集群中以DaemonSet方式部署设备厂商提供的插件,然后在Pod中申明使用该资源的使用量,容器在启动成功后,便可在容器中发现该设备。然而,随着Kuber
4811 2
K8S下一代设备管理机制:DRA
|
10月前
|
人工智能 自然语言处理 监控
2025年GEO优化服务商推荐:森潮GEO支持多平台AI搜索排名优化
2025年AI搜索重塑营销格局,GEO优化成企业新战场。森潮GEO凭借AI先发优势,助力品牌在DeepSeek、文心一言等平台实现“一问就有你”,抢占用户决策C位,引领从SEO到GEO的范式革命。
|
Web App开发 Rust JavaScript
分享2020年Github星级前20名JavaScript框架性能比较
之前有在《读 2020 年 Javascript 趋势报告展望 ES2020》介绍了主流的前端库,本文就来看看JavaScript框架之间的终极性能之战
1212 0
|
数据采集 供应链 API
Python爬虫与1688图片搜索API接口:深度解析与显著收益
在电子商务领域,数据是驱动业务决策的核心。阿里巴巴旗下的1688平台作为全球领先的B2B市场,提供了丰富的API接口,特别是图片搜索API(`item_search_img`),允许开发者通过上传图片搜索相似商品。本文介绍如何结合Python爬虫技术高效利用该接口,提升搜索效率和用户体验,助力企业实现自动化商品搜索、库存管理优化、竞品监控与定价策略调整等,显著提高运营效率和市场竞争力。
1095 3
|
网络协议 Linux 网络安全
SYN Cookie技术原理
【8月更文挑战第21天】
987 1

热门文章

最新文章