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.
Contents
[hide]
- 1 Overview
- 2 JBD structures
- 2.1 Atomic handle
- 2.2 Transaction
- 3 Recovery
- 4 Sources
Overview[edit]
The Journaling Block Device (JBD) provides a filesystem-independent interface for filesystem journaling. ext3, ext4 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]
- Linux: The Journaling Block Device (Kedar Sovani, KernelTrap, June 20, 2006)
- Linux kernel v2.6.19.1 source
- Jump up^ http://kernelnewbies.org/Linux_2_6_28#head-b683bcf44853cccbff4b09bda272169272c22ae6
- Jump up^ Mingming Cao (9 August 2006). "Forking ext4 filesystem and JBD2". Linux kernel mailing list.
[参考]
JBD Journaling block device相关推荐
- Linux内核学习:EXT4文件JBD日志系统(Journaling Block Device)
目录 0 Ext4的日志模式 1 日志系统的作用 2 日志系统工作场景 3 JDB日志块设备 3.1 JBD2的数据结构 3.1.1 buffer_head 3.1.2 handle 3.1.3 tr ...
- linux jbd2工作原理,JBD2(journaling block device 2)系统分析(三)
在上一节,我们说到journal_init(void)里用到的两个重要函数,一个是journal_init_caches()和jbd2_journal_destroy_caches(); 前者的实现在 ...
- Ceph Block Device块设备操作
2019独角兽企业重金招聘Python工程师标准>>> 使用ceph block device需要如下三个步骤: 1. 在ceph 集群的pool中创建一个Block Device ...
- Mount 挂载错误mount:block device /dev/sr0 is write – protected , mounting read-only
Mount 挂载错误mount:block device /dev/sr0 is write – protected , mounting read-only 安装虚拟机出现以下提示: mount:b ...
- mount: block device /dev/cdrom is write-protected, mounting read-only 解决方法
mount: block device /dev/cdrom is write-protected, mounting read-only 解决方法 参考文章: (1)mount: block dev ...
- UBI,MTD(Memory Technology Device),raw flash,emmc,Flash,Block Device
UBIFS 3个子系统: MTD 子系统: 提供访问flash 芯片的统一接口.MTD提出了MTD设备的概念(/dev/mtd0),MTD设备就是raw flash. UBI 子系统: 在MTD子系统 ...
- NBD Network Block Device
1. 介绍 NBD(Network Block Device),即网络块设备.可以将一个远程主机的磁盘空间,当作一个块设备来使用.就像一块硬盘一样使用它,你可以很方便的将另一台服务器的硬盘空间,增加到 ...
- NBD(Network Block Device)简介及基本使用
NBD指的是Network Block Device,正如其名字的意思,NBD让用户可以通过网络访问到某个块设备,或者设备镜像. 你可能会想NFS(Network File System)不是已经可以 ...
- SPDK: Block Device Layer Programming Guide 块设备层编程指南
文章目录 前言 Target Audience 目标受众 Introduction 简介 Basic Primitives 基本原语 Initializing The Library Library初 ...
最新文章
- eclipse编辑窗口不见了(打开左边的java、xml文件,中间不会显示代码)
- 计算机启动太慢可以设置什么来加速启动速度,电脑开机速度慢怎么办 如何加速电脑开机速度慢【详细介绍】...
- android 自定义菜单开发,Android开发学习笔记:浅谈3大类菜单
- DIY人脸跟踪电风扇送女朋友(1)
- 计算机技术与软件专业技术资格(水平)考试 全国各省市成绩查询
- Pandas知识点-合并操作combine
- java future 不足_java Future用法和意义一句话击破
- Android5.1自定义闹钟铃声,Android 设置来电铃声、通知铃声、闹钟铃声中的坑
- php web server setup,PHP本地开发利器:内置Web Server
- “不怕的人的面前才有路”!一名双非硕士的985攻博历程
- android创建桌面快捷键shortcut
- 快速破解IntelliJ IDEA
- UI设计师(界面设计)面试题
- upc 兔子与兔子(字符串Hash)
- kk常用ramda函数总结
- python字典包含指定键_筛选python字典中键包含特定字符串的项
- 零基础快速入门(二)爬取豆瓣电影——python爬虫实例
- Java中占位符的实战运用
- Arduino - 继电器
- defcon quals 2016 feedme writeup