深入解析ext2文件系统之mke2fs
表 1. 各种数据块对应的文件寻址范围
块大小 | 直接寻址 | 间接寻址 | 二次间接寻址 | 三次间接寻址 |
1024 | 12KB | 268KB | 64.26MB | 16.06GB |
2048 | 24KB | 1.02MB | 513.02MB | 265.5GB |
4096 | 48KB | 4.04MB | 4GB | ~ 4TB |
- linux-tods:/mnt/bean # mke2fs /dev/loop0
- mke2fs 1.41.9 (22-Aug-2009)
- Filesystem label=
- OS type: Linux
- Block size=1024 (log=0)
- Fragment size=1024 (log=0)
- 128016 inodes, 512000 blocks
- 25600 blocks (5.00%) reserved for the super user
- First data block=1
- Maximum filesystem blocks=67633152
- 63 block groups
- 8192 blocks per group, 8192 fragments per group
- 2032 inodes per group
- Superblock backups stored on blocks:
- 8193, 24577, 40961, 57345, 73729, 204801, 221185, 401409
- Writing inode tables: done
- Writing superblocks and filesystem accounting information: done
- This filesystem will be automatically checked every 26 mounts or
- 180 days, whichever comes first. Use tune2fs -c or -i to override.
用户可以修改成4096,这样的话,总块数一会跟着变化从512000变成了128000.
- linux-tods:/mnt/bean # mke2fs -b 4096 /dev/loop0
- mke2fs 1.41.9 (22-Aug-2009)
- Filesystem label=
- OS type: Linux
- Block size=4096 (log=2)
- Fragment size=4096 (log=2)
- 128000 inodes, 128000 blocks
- 6400 blocks (5.00%) reserved for the super user
- First data block=0
- Maximum filesystem blocks=134217728
- 4 block groups
- 32768 blocks per group, 32768 fragments per group
- 32000 inodes per group
- Superblock backups stored on blocks:
- 32768, 98304
- Writing inode tables: done
- Writing superblocks and filesystem accounting information: done
- This filesystem will be automatically checked every 39 mounts or
- 180 days, whichever comes first. Use tune2fs -c or -i to override.
- linux-tods:/mnt/bean # mke2fs -m 10 /dev/loop0
- mke2fs 1.41.9 (22-Aug-2009)
- Filesystem label=
- OS type: Linux
- Block size=1024 (log=0)
- Fragment size=1024 (log=0)
- 128016 inodes, 512000 blocks
- 51200 blocks (10.00%) reserved for the super user
- First data block=1
- Maximum filesystem blocks=67633152
- 63 block groups
- 8192 blocks per group, 8192 fragments per group
- 2032 inodes per group
- Superblock backups stored on blocks:
- 8193, 24577, 40961, 57345, 73729, 204801, 221185, 401409
- Writing inode tables: done
- Writing superblocks and filesystem accounting information: done
- This filesystem will be automatically checked every 23 mounts or
- 180 days, whichever comes first. Use tune2fs -c or -i to override.
-------------------------------------------------------------------------------------------------------
点击(此处)折叠或打开
- linux-tods:/mnt/bean # mke2fs -i 8192 /dev/loop0
- mke2fs 1.41.9 (22-Aug-2009)
- Filesystem label=
- OS type: Linux
- Block size=1024 (log=0)
- Fragment size=1024 (log=0)
- 64008 inodes, 512000 blocks
- 25600 blocks (5.00%) reserved for the super user
- First data block=1
- Maximum filesystem blocks=67633152
- 63 block groups
- ......
- linux-tods:/mnt/bean # dumpe2fs /dev/loop0
- Group 0: (Blocks 1-8192)
- Primary superblock at 1, Group descriptors at 2-3
- Reserved GDT blocks at 4-259
- Block bitmap at 260 (+259), Inode bitmap at 261 (+260)
- Inode table at 262-388 (+261)
- 7790 free blocks, 1005 free inodes, 2 directories
- Free blocks: 403-8192
- Free inodes: 12-1016
- Group 1: (Blocks 8193-16384)
- Backup superblock at 8193, Group descriptors at 8194-8195
- Reserved GDT blocks at 8196-8451
- Block bitmap at 8452 (+259), Inode bitmap at 8453 (+260)
- Inode table at 8454-8580 (+261)
- 7804 free blocks, 1016 free inodes, 0 directories
- Free blocks: 8581-16384
- Free inodes: 1017-2032
设成1524居然也可以,呵呵
- linux-tods:/mnt/bean # mke2fs -i 1524 /dev/loop0
- mke2fs 1.41.9 (22-Aug-2009)
- Filesystem label=
- OS type: Linux
- Block size=1024 (log=0)
- Fragment size=1024 (log=0)
- 344232 inodes, 512000 blocks
- 25600 blocks (5.00%) reserved for the super user
- First data block=1
- Maximum filesystem blocks=67633152
- 63 block groups
- 8192 blocks per group, 8192 fragments per group
- 5464 inodes per group
- Superblock backups stored on blocks:
最后一个PROBLEM,我想了很久也没想明白,请路过的高手如果知道答案,不吝赐教:
- Inode count: 128016
- Block count: 512000
- Reserved block count: 25600
- Free blocks: 493526
- Free inodes: 128005
- First block: 1
- Block size: 1024
深入解析ext2文件系统之mke2fs相关推荐
- ext2文件系统 - mke2fs
上一遍博文的重点其实将ext2整体的组织框架,我们知道了ext2文件系统由块组组成,每个块组里面的组织形式.我们甚至直接把超级块和组描述符里面的内容,用十六进制形式展现了出来.这篇博文主要讲述如何 ...
- Linux 文件系统及 ext2 文件系统
linux 支持的文件系统类型 Ext2: 有点像 UNIX 文件系统.有 blocks,inodes,directories 的概念. Ext3: Ext2 的加强版,添加了日志的功 ...
- Linux ext2文件系统小结
本文来源:http://learn.akae.cn/media/ch29s02.html 有修改 1.ext2文件系统整体布局 一个磁盘可以划分成多个分区,每个分区必须先用格式化工具(例如某种mkfs ...
- linux之EXT2文件系统--理解block/block group/索引结点inode/索引位图
0. 文件系统和图书馆 在linux上操作文件,和在图书馆借书是非常相似的. 硬盘上的文件系统,好比图书馆的书架:而vfs则是图书馆的管理系统. 内核的工作: 1. 维护一个文件的目录树(dentry ...
- ext2文件系统了解
一个磁盘可以划分成多个分区,每个分区必须先用格式化工具(例如mkfs命令)格式化成某种格式的文件系统,然后才能存储文件,格式化的过程会在磁盘上写一些管理存储布局的信息.下以ext2文件系统为例说明文件 ...
- Ext2文件系统—文件读写
1.定义 只有在"打开"了文件以后,或者说建立了进程与文件的"连接"之后,才能对文件进行读写.为了提高效率,Linux的读写操作都是带缓冲的,即写的时候先写到缓 ...
- C语言实现简易EXT2文件系统,ext2文件系统体会-创建文件系统
§ 0x00 为什么学习ext2 这个文件系统是当初生产级别的: 实现最为简单. 与现代文件系统相比的缺点: 无事务: 不感知固态硬盘. 0x01 制作一个虚拟磁盘 通过dd命令实现. dd if=/ ...
- Linux EXT2文件系统结构分析(详情见附件)
Linux的第一个版本是基于Minix文件系统的.当 Linux成熟时,引入了扩展文件系统(Ext FS) ,它包含了几个重要的扩展,但提供的性能不令人满意.在 1994 年引入了第二扩展文件系统(s ...
- 转:ext2文件系统详解
第一部分磁盘的物理组成 磁盘的基本概念: 扇区为最小的物理存储单位,每个扇区为512字节. 将扇区组成一个圆,那就是柱面,柱面是分区的最小单位. 第一个扇区很重要,里面有硬盘主引导记录(Masterb ...
最新文章
- PHP Notice: undefined index 解决方法
- 异构云:另一个烫手的山芋
- wxWidgets:wxHashTable类用法
- Spring框架相关问题
- mysql 主从 sql线程no_Mysql 主从同步 slave_sql_running 为no
- mysql支持arm64架构吗_ARM架构下面安装mysql5.7.22
- CUHK interview in Shen Zhen
- mysql binlog DDL_mysql一个事务中有DDL语句的binlog情况
- stm32 GPIO
- 详解网易有道AI战略,智能硬件、教育、办公三大解决方案
- Cousera- software security
- PAT乙级做题部分总结
- WARNING: The script markdown_py.exe is installed in......
- 安卓手机卡顿怎么解决_苹果手机卡怎么办 小技巧解决ipone手机卡顿现象
- Unity - Ray射线检测
- RLC交流电路测量实验
- 【操作系统】I/O系统
- 认识下中国最赚钱的服装公司的幕后老板
- 百度云盘搜索引擎微信公证号_微信公众号被百度搜索引擎收录?SEO优化诞生新方法!...
- python股票数据分析实例_Python之简单股票数据分析
热门文章
- mysql提权_mysql提权总结
- python3 json解析_Python3 JSON编码解码方法详解
- php怎么删除表数据,php怎样删除数据表中的数据_后端开发
- javascript乘法和加法_Web前端:JavaScript中的NaN是什么?
- html语言中空格用什么表示,HTML中的5种空格各表示的意义
- python下载器2
- 澳大利亚.新西兰C#考试题
- 女主播还是女主播???
- 谈谈IT行业的一些生存之道!
- 无边框处理_PPT别再直接插图片,简单处理一下,瞬间提升你的PPT颜值