深入解析ext2文件系统之mke2fs
块大小 | 直接寻址 | 间接寻址 | 二次间接寻址 | 三次间接寻址 |
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 文件系统
很久以来,就想写一篇关于ext 家族文件系统的文章,源于我刚工作的时候,曾经一不小心rm -rf,误删除了很多文件,当时真想有个数据恢复软件能帮我把数据回复了.当然学习数据恢复,首先要学习文件系统. ...
- 深入解析 ext2 文件系统 (转)
http://blog.chinaunix.net/uid-24774106-id-3266816.html 很久以来,就想写一篇关于ext 家族文件系统的文章,源于我刚工作的时候,曾经一不小心rm ...
- mke2fs 制作ext2文件系统image
方法1: 利用/dev/ram1: linux下有很多ram,我们用ram1,首先把ram1格式化成ext2文件系统[root@gucuiwen babylinux]# sudo mkfs.ext ...
- ext2文件系统 - mke2fs
上一遍博文的重点其实将ext2整体的组织框架,我们知道了ext2文件系统由块组组成,每个块组里面的组织形式.我们甚至直接把超级块和组描述符里面的内容,用十六进制形式展现了出来.这篇博文主要讲述如何 ...
- ext3是对ext2文件系统的一个扩展高性能日志文件系统
嵌入式开发者所做的最重要的决定之一就是部署哪种文件系统.有些文件系统性能比较高有些文件系统空间利用率比较高,还有一些文件系统设备故障或者意外断电后恢复数据比较方便. linux文件系统概念 分区 分区 ...
- ext2文件系统
2.1. 总体存储布局 我们知道,一个磁盘可以划分成多个分区,每个分区必须先用格式化工具(例如某种mkfs命令)格式化成某种格式的文件系统,然后才能存储文件,格式化的过程会在磁盘上写一些管理存储布局的 ...
- Ext2文件系统布局,文件数据块寻址,VFS虚拟文件系统
注:本分类下文章大多整理自<深入分析linux内核源代码>一书,另有参考其他一些资料如<linux内核完全剖析>.<linux c 编程一站式学习>等,只是为了更好 ...
- Linux ext2文件系统之初步思考
数据存放在磁盘中,磁盘最小存取单位sector(512Byte);文件系统中存储的最小单位是 块(Block),大小通常(1KB,2KB,4KB...), 一个block对应多个sector,因而可用 ...
- ext2文件系统了解
一个磁盘可以划分成多个分区,每个分区必须先用格式化工具(例如mkfs命令)格式化成某种格式的文件系统,然后才能存储文件,格式化的过程会在磁盘上写一些管理存储布局的信息.下以ext2文件系统为例说明文件 ...
随机推荐
- font-size的探究
整理网上的资料 font字体,用px,em,100%,rem?分什么情况考虑? 我们逐渐意识到,我们用px作为文字大小的单位,已经出现很多问题.最主要是体现在用户不能灵活的控制文字的大小. 对于大多数 ...
- android开发中遇到的bug
这种NullPointerException这么解决啊 Activity.dispatchTouchEvent 里try catch一下 参考:http://www.eoeandroid.com/th ...
- dom cookie记录用户名
<!doctype html> <html> <head> <meta charset="utf-8"> <title> ...
- JVM系列四:生产环境参数实例及分析【生产环境实例增加中】
java application项目(非web项目) 改进前: -Xms128m-Xmx128m-XX:NewSize=64m-XX:PermSize=64m-XX:+UseConcMarkSweep ...
- MyEclipse中消除frame引起的“the file XXX can not be found.Please check the location and try again.”的错误
读者如要转载,请标明出处和作者名,谢谢. 地址01:http://space.itpub.net/25851087 地址02:http://www.cnblogs.com/zjrodger/ 作者名: ...
- Wicket Hello World Example
A simple hello world example in Wicket, show the basic structure of Wicket web application. Tools an ...
- Cisco ASA5500系列防火墙恢复IOS全过程
擦除防火墙配置的命令是write erase而不是erase flash!当ASA5510的flash被erase后,如何将新的IOS拷贝到5510内呢? 如下:1. 当flash被erase后设备会 ...
- CodeForces 711A Bus to Udayland (水题)
题意:给定一个n*4的矩阵,然后O表示空座位,X表示已经有人了,问你是不能找到一对相邻的座位,都是空的,并且前两个是一对,后两个是一对. 析:直接暴力找就行. 代码如下: #pragma commen ...
- VSTO安装部署(完美解决XP+2007)
从开始写VSTO的插件开始,安装部署一直就是一个很大的难题,其实难题的原因主要是针对XP+2007而言.在Win7上,由于基本上都预装了.net framework,所以安装起来其实问题不大. 主要需 ...
- How Tomcat Works(十)
本文接下来分析tomcat的日志记录器,日志记录器是用来记录消息的组件,在tomcat中,日志记录器需要与某个servlet容器相关连:在org.apache.catalina.logger包下,to ...