Frequently asked questions
Ext2、ext3、ext4的关系
三个文件系统可以归为一类文件系统,有很好的前后兼容性,如Mkfs成ext3文件系统,在挂载时可以挂在成ext2,ext4的形式。但是ext4的文件系统,不能挂载成ext2、ext3的形式。Ext3要求有日志,但是ext2中没有日志。Ext4文件系统可以使用无日志的模式mount
Why创造ext2
Minx文件系统bug:filename只能在14自符内。Minix支持的最大的file大小为64Mib,而ext文件系统支持2Gb的文件大小,filename可以到256个字符。但是ext2和minix一样只有一个上次更改的时间戳,上次访问时间,上次inode更改时间。它使用链表的形式存储空闲块,这意味着更容易I形成碎片。在1993,ext2文件系统更新版本后,新版本可以支持最大4T的文件大小,增加了可移植的时间戳接口。而且文件系统可扩展,所以可以在文件系统中加入新特性。
文件系统的特点:
EXT2:
哈希索引目录:(EXT2_FEATURE_COMPAT_DIR_INDEX)
扩展属性块(EXT2_FEATURE_COMPAT_EXT_ATTR)
File type in directory entries (EXT2_FEATURE_INCOMPAT_FILETYPE)
减少块组描述符的备份(EXT2_FEATURE_INCOMPAT_META_BG)
减少超级块的备份(EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER)
文件可以大于2GB(EXT2_FEATURE_RO_COMPAT_LARGE_FILE)
EXT3
扩展属性块、更大的inode结点 (EXT3_FEATURE_COMPAT_EXT_ATTR)
在线文件系统大小更改(EXT3_FEATURE_COMPAT_RESIZE_INODE)
目录项hash索引 (EXT3_FEATURE_COMPAT_DIR_INDEX)
日志file(EXT3_FEATURE_COMPAT_HAS_JOURNAL) 注意:ext3必须有日志的模式,对比ext4
File type in directory entries(EXT3_FEATURE_INCOMPAT_FILETYPE)
日志的恢复(EXT3_FEATURE_INCOMPAT_RECOVER)
减少块组描述符的备份(EXT3_FEATURE_INCOMPAT_META_BG)
减少超级块的备份(EXT3_FEATURE_RO_COMPAT_SPARSE_SUPER)
文件可以大于2GB(EXT3_FEATURE_RO_COMPAT_LARGE_FILE)
EXT4
扩展属性块、更大的inode(EXT3_FEATURE_COMPAT_EXT_ATTR)
在线文件系统大小更改(EXT3_FEATURE_COMPAT_RESIZE_INODE)
目录项hash索引(EXT3_FEATURE_COMPAT_DIR_INDEX)
日志file(EXT3_FEATURE_COMPAT_HAS_JOURNAL)注意ext4可以以没有日志的形式挂载
File type in directory entries(EXT3_FEATURE_INCOMPAT_FILETYPE)
日志的恢复 (EXT3_FEATURE_INCOMPAT_RECOVER)
文件可以以extents形式分配空间(EXT4_FEATURE_INCOMPAT_EXTENTS)
支持大于2^32个文件块(EXT4_FEATURE_INCOMPAT_64BIT)
灵活的块组Flexible block group(EXT4_FEATURE_INCOMPAT_FLEX_BG)
减少块组描述符的备份 (EXT3_FEATURE_INCOMPAT_META_BG)
减少超级块的备份(EXT3_FEATURE_RO_COMPAT_SPARSE_SUPER)
文件可以大于2GB(EXT3_FEATURE_RO_COMPAT_LARGE_FILE)
组描述符的校验和稀疏索引表(EXT4_FEATURE_RO_COMPAT_GDT_CSUM)
目录内容可以多于32000个项 (EXT4_FEATURE_RO_COMPAT_DIR_NLINK)
纳秒级别时间戳和创建时间 (EXT4_FEATURE_RO_COMPAT_EXTRA_ISIZE)
整个文件大小可以大于2Tb (EXT4_FEATURE_RO_COMPAT_HUGE_FILE)
如何测试EXT4文件系统
测试文件系统和硬件平台最好的方法是系统上真实的应用。Benchmark只是模拟的测试方式,他们不能反映应用的IO负载
现有的测试工具等见: intertubes
Wiki的一个很棒的文章: Comparison of file systems(不同文件系统比较)
Can I undelete files in Ext4?(ext4能否恢复删除文件?)
No, in the same way that the ext3 journal requirements to be consistent after a crash prevent undelete of ext3 files, it isn't possible to undelete ext4 files.
如何把ext2、ext3挂载的系统变为ext4,用到两条指令?
使用tune2fs来使其可以使用ext4特性
# tune2fs -O extents,uninit_bg,huge_file /dev/DEV
# e2fsck -f /dev/DEV
如果在把ext2文件系统mount为ext4类型时,想要其具备日志特性,使用指令:
# tune2fs -j /dev/DEV
若用指令把ext2、ext3文件系统挂载为ext4形式后,以后就不能再挂在成原来的ext2、ext3形式了。
可以使用下列指令使加入日志的ext2文件系统去除日志:
# tune2fs -O ^has_journal /dev/DEV
一些ext4的特性在ext3文件系统中不能体现。
在/proc/fs/jbd2/partition/history中提供的信息
执行cat /proc/fs/jbd2/partition/history 有如下信息
R/C tid wait run lock flush log hndls block inlog ctime write drop close R 7102 0 5000 0 1424 4 68681 5 6 R 7103 0 5000 0 1644 4 64579 9 10 R 7104 0 5000 0 856 32 38719 11 12 R 7105 0 5000 0 1052 0 47142 12 13 R 7106 0 5000 0 1172 16 56028 11 12 R 7107 0 5000 0 1416 4 71047 11 12 R 7108 0 5000 0 1640 4 81125 5 6 R 7109 0 5000 0 1616 4 77314 6 7 R 7110 0 5000 0 1640 0 76111 5 6 : :
文件的目的是提供ext4日志的。每个当前日志事件的提交就往这个文件中加入一行。每列的含义如下:
R/C
事物在运行或是提交。(注意目前的JBD2只显示正在运行的事物,不显示提交的数据)
Tid
事物的ID,用以区别不同的JBD2事物
Wait
事物开始所等待的毫秒数。如果应用做同步操作或者事物包含块的最大数量。
Lock
事物等待锁住所花的毫秒数
Flush
number of milliseconds flushing blocks to the filesystem for ordered mode before the transaction can be committed
log
将block的数据写入日志所需要的毫秒数
Hndls
日志事物的handles个数
Block
日志事物的block个数
Inlog
这个事物写入到block的block数目,包括日志的额外开销
/proc/fs/jbd2/<partition>/info提供的信息
在cat /proc/fs/jbd2/partition/info提供如下信息:
1498 transaction, each up to 8192 blocks
average:
0ms waiting for transaction
3924ms running transaction
0ms transaction was being locked
0ms flushing data (in ordered mode)
12ms logging transaction
14176us average transaction commit time
289 handles per transaction
26 blocks per transaction
27 logged blocks per transaction
这个文件中显示了自mount以来,该文件系统在/proc/fs/jbd2/partition/history目录信息下的统计平均信息
如何改变ext4文件系统的大小
ext4在线改变大小的方式和ext3很相似,使用resize2fs或者ext2resize,但是对整个文件系统最大的大小有限制(4TB大小)。在有META_BG标记下这个限制大小可以增大。
什么是bitmap 分配器
Ext2和ext3通过遍历块的比特位来查看块是否空闲。十分低效,ext4的block allocator替代了bitmap allocator实现该功能,所以ext4比ext3也快了许多。
ext3和ext4的主要区别
ext4的新特性在http://sundayhut.is-programmer.com/ 译文中解释过了
jdb和jdb2的区别
两者大体上相同,但是jdb2增加了几个兼容性的功能:
1. 支持64位的文件系统
2. 日志事务的校验
3. 异步的事务提交块写
另外,对于刷新数据jbd2实施了一种新的ordered模式,它与延时分配结合使用,防止了当有大量数据写入文件系统而阻塞日志事物的提交的情况。这也避免了当有一个大的写(heavy write)时,fsync()延迟过长。
能在SSD上使用ext4文件系统吗?
可以,SSD实质上和其他的块设备没有什么区别。在先进的ssd上(主要考虑ssd寿命问题,日志区需要频繁修改),还可以把日志区放在SSD中。参考该链接:you can even put the journal on the SSD as well
链接中提出
- 可以把ext4作为无日志的模式挂载。此时系统崩溃就要执行fsck来恢复,恢复的速度取决于你文件系统的碎片化程度,由于ssd本身速度较快,可能恢复在10秒内
- 就算把journal放在ssd中也不会有太大问题,作者自己就是这么干的,估摸着在ssd坏了之前自己早就换电脑了。
- 自己做了一点小手脚来减少文件系统的写操作。比如说/tmp目录使用tmpfs文件系统、把firefox的缓存放在/tmp目录下。
2021年8月19日 20:22
i never know the use of adobe shadow until i saw this post. thank you for this! this is very helpful. https://soap2day.sbs/
2021年8月30日 00:03
You ought to basically fantastic not to mention solid advice, which means notice:
2021年9月25日 05:14
Such sites are important because they provide a large dose of useful information ...
2021年11月30日 22:25
All the latest mobile phone prices in Pakistan. Be the first to know the best prices of latest android phones in Pakistan. Top Mobile Phone Deals in Pakistan. Latest Phones, Lowest Prices and mobile specifications - MLTWorld
2022年7月23日 05:10
Gmail PVA Accounts
This is highly informatics. Crisp and clear. I think that everything has been described in a systematic manner so that reader could get maximum information and learn many things.
2022年7月23日 05:17
Instagram PVA Accounts
Wonderful illustrated information. I thank you about that. No doubt it will be very useful for my future projects. Would like to see some other posts on the same subject!
2022年7月23日 05:26
Buy Gmail PVA Accounts
It is imperative that we read blog posts very carefully. I am already done with it and find that this post is really amazing.
2022年7月23日 05:40
Buy Instagram PVA Accounts
Your blog provided us with valuable information to work with. Each & every tip of your post is awesome. Thanks a lot for sharing. Keep blogging.
2022年8月01日 16:47
We provide phone verified accounts. Buy Instagram pva accounts in bulk from us to improve your business products as the world's best.
2022年8月02日 19:46
Instagram PVA Accounts
I would like to say that this blog really convinced me to do it! Thanks. Very good post.
2022年8月04日 02:54
Instagram pva accounts
I have read your article. It is very informative and helpful for me. I admire the valuable information you offer in your articles. Thanks for posting it.
2022年8月08日 15:55
Customer require BSNL SIM card for replacement, It is either for SIM lost (mobile theft) or SIM not working cases, For the first instance, nowadays, many cell phone manufacturers are offering General Insurance, but it is at the time of purchasing the new cell phone. BSNL SIM Card General insurance companies will process the claim, But it is done on submitting all the valid documents along with BSNL replacement SIM receipt from the service provider, In the second case, if the BSNL SIM card is not working means, it is due to some common issues raised in BSNL Mobile SIM card.
2022年8月12日 16:34
Buy Gmail PVA Accounts
Wow-what Great Information about World Day is a very nice informative post. Thanks for the post.
2022年8月12日 17:26
Financial Management is an activity inside an organization which is a process of controlling, organizing, planning, monitoring the financial resource. The Financial Management does plan its working process in all criteria to attain organizational growth by reaching objectives and goals. Nature and Scope of Financial Management . This allows better maintaining the financial activities of organizations which procure funds, utilize funds, payment, and assessment of risk, accounting and all options relate to financial assets. An organization cannot work well until it has shown its profit and loss on paper with exact way of expenditure.
2022年8月18日 21:14
The Previous Question Paper for the HS exam for the year 2023 has been released by the Board Of Higher Secondary Education TBSE Higher, Government of Tripura. The investigation The department provides classes in the fields of humanities, arts, science, and business. The Tripura Board will make available the Tripura 12 Question Paper 2023, the TBSE 12th Question Paper 2023, the TBSE HS Question Paper 2023, and the Tripura TBSE HS 12th Exam Guess Paper 2023. TBSE HS Question Paper 2023 All students who have registered for the examinations in 2023 may get the Tripura TBSE HS 12th Exam New Model Paper 2023 by going to the official website or by visiting our website.
2022年9月07日 02:38
Buy Twitter PVA Accounts
This is the first time I am visiting here and I found so much interesting stuff in your blog, especially its discussion. Thank you.
2022年9月09日 04:10
Buy Instagram PVA Accounts
I am no expert. But I believe you just made an excellent point. You certainly fully understand what you are speaking about. and I can truly get behind that.
2022年9月09日 04:23
Buy Instagram PVA Accounts
This is a great inspiring article. I am pretty much pleased with your good work. You put really very helpful information. Keep it up. Keep blogging. Looking to reading your next post.
2022年9月09日 15:24
virtual office rental
I highly appreciate this post. It’s hard to find the good from the bad sometimes. but I think you’ve nailed it! would you mind updating your blog with more information?
2022年9月09日 21:23
Formative Assessment means not only an examination, it includes various aspects such as Examination in completed lessons, Reflections, Project work done on the allotted topic and Self also Prepared notes etc. AP SSC fa 1 Question Paper Candidates of Telugu Medium, English Medium & Urdu Medium of the AP State can download the AP 10th Class FA 4 Model Paper 2023 Pdf with answers for the regular exams conducted by the Directorate of Government Examinations, Andhra Pradesh.
2022年9月10日 22:04
Gujarat State Department of School Education, Gandhinagar and the State level subject experts and other private school teaching staff of the Elementary Level Primary School have designed and suggested the GSEB 1st Class Model Paper 2023 with sample answers Set wide as SET-A, SET-B, SET-C and SET-D to know the new exam scheme or question pattern. Gujarat STD-1 Question Paper Students of the Gujarat state can download the NCERT & SCERT Syllabus GSEB STD-1 Question Paper 2023 Pdf with sample answers along with the class teacher’s suggested all lesson or chapter’s most important questions for Part-A, Part-B, Part-C and Part-D exams of Term-1 & Term-2 to the academic year of 2023.
2022年9月13日 08:24
Buy Gmail PVA Accounts
Nice to be visiting your blog again. It has been months for me. Well, this article that I've been waiting for so long. I need this article to complete my assignment in college and it has the same topic as your article. Thanks. Great share.
2022年9月13日 08:50
Buy Instagram PVA Accounts
The information you have posted is very useful. The sites you have referred were good. Thanks for sharing.
2022年9月13日 08:54
Buy Gmail PVA Accounts
Very interesting blog. A lot of blogs I see these days don't really provide anything that I'm interested in. But I'm most definitely interested in this one. Just thought that I would post and let you know.
2022年9月15日 17:45
Buy Instagram PVA Accounts
Thanks for sharing the info. Keep up the good work going. I really enjoyed exploring your site. Good resource.
2022年9月15日 22:34
hair beauty products online
You know your projects stand out from the herd. There is something special about them. It seems to me all of them are really brilliant!
2022年9月19日 01:39
Science is very close to our world, which means everything in this world has a relation with science. NCERT Science Question Paper Class 2 From living things such as humans, plants and animals etc. to Non-living things such as rocks, elements and so on must depend on the science. Simply without science, there is nothing. Hence this subject has been introduced in primary education in the country.Follow NCERT Science Model Papers 2023 Class 2 do favour to every 2nd standard student to get top score in all formats of exams conducted in Term-1, Term-2 for Summative Assessments.
2022年9月20日 20:10
Buy Bulk Gmail Accounts
I really appreciate this wonderful post that you have provided for us. I assure you this would be beneficial for most people.
2022年9月23日 00:57
I would like to say that this blog really convinced me to do it! Thanks. Very good post.
2022年10月08日 18:32
notary public mississauga
Wonderful illustrated information. I thank you for that. No doubt it will be very useful for my future projects. Would like to see some other posts on the same subject!
2022年10月14日 01:35
Rail Road Policing Nevada
What a fantabulous post this has been. Never seen this kind of useful post. I am grateful to you and expect more posts like these. Thank you very much.
2022年10月16日 02:12
Hello, I have browsed most of your posts. This post is probably where I got the most useful information for my research. Thanks for posting. Maybe we can see more on this. Are you aware of any other websites on this subject?
2022年10月31日 01:35
I really appreciate this wonderful post that you have provided for us. I assure you this would be beneficial for most people.
2022年11月05日 03:57
Are you looking for an expert private detective agent for counter surveillance? Foglight Private Investigation is the once can help you with it.
<a href='https://foglightpi.com/services/counter-surveillance/'>Counter Surveillance </a>
2022年11月06日 19:26
sub zero fridge repair near me
I am no expert. But I believe you just made an excellent point. You certainly fully understand what you are speaking about. and I can truly get behind that.
2022年11月25日 14:39
Global Design Agency
Wow, I can say that this is another great article as expected of this blog. Bookmarked this site.
2022年11月26日 00:55
Web Design Agency
The information you have posted is very useful. The sites you have referred were good. Thanks for sharing.
2022年12月13日 11:57
I recommend this article. Thanks for this article very helpful.
2022年12月16日 01:32
laser tattoo removal glasses
Nice to be visiting your blog again. It has been months for me. Well, this article that I've been waiting for so long. I need this article to complete my assignment in college and it has the same topic as your article. Thanks. Great share.
2022年12月16日 15:25
earring and necklace set gold
The information you have posted is very useful. The sites you referred were good. Thanks for sharing this.
2022年12月25日 04:15
Your blog was found very well and I can get all the information that I need, If you are looking to get more interesting content visit <a href="https://foglightpi.com/">Foglight Investigations</a>
<a href="https://gmblogger.com/">GM Blogger</a>
<a href="https://gmwebsolutions.com/">GM Web Solutions</a>
2022年12月25日 04:15
Your blog was found very well and I can get all the information that I need, If you are looking to get more interesting content visit Foglight Investigations GM Blogger GM Web Solutions
2022年12月31日 16:07
Nowadays, the food service industry is highly competitive. Customers expect to get their favourite food delivered to their doorstep in less than 30 minutes. Food Online Ordering System is a convenient way that enables the customers to order their favourite food online.
2023年1月06日 15:00
Looking for a luxury property in Dubai? Look no further than Foxhills AE. We offer an exclusive selection of the most luxurious properties, and sale of high-end residences in Dubai.
2023年1月10日 00:19
Buy Instagram pva accounts in bulk
I would like to say that this blog really convinced me to do it! Thanks. Very good post.
2023年1月13日 15:53
business software review
Yes, I am totally agreed with this article and I just want to say that this article is a very nice and very informative article. I will make sure to be reading your blog more. You made a good point but I can't help but wonder. what about the other side? Thanks!
2023年1月23日 15:58
K2 challan also referred to as Khajane 2, an integrated financial management system from the Government of Karnataka. The K2 has been brought into working with an aim to manage the financial business of the government. khajane 2 challan It works to simplify the process of remittance of departments under government by bringing an option of anywhere-anytime payment options. Firstly every department under the government of Karnataka will have access to Khajane 2 which allows their customers to remit to the government through the easy payment links provided.
2023年2月23日 01:03
Your blog provided us with valuable information to work with. Each & every tip of your post is awesome. Thanks a lot for sharing. Keep blogging.
2023年3月02日 14:57
Find your dream safa one properties for sale Real Estate Investment and get Residential Visa in Dubai UAE safa one properties for sale
2023年3月19日 14:24
Jamaica all inclusive resorts
I am definitely enjoying your website. You definitely have some great insight and great stories.
2023年3月22日 04:28
www.anunturi-matrimoniale.ro
Very interesting blog. A lot of blogs I see these days don't really provide anything that I'm interested in. But I'm most definitely interested in this one. Just thought that I would post and let you know.
2023年3月29日 02:45
Local garage door repair near me
This is a great inspiring article. I am pretty much pleased with your good work. You put really very helpful information.
2023年4月02日 02:04
Your blog provided us with valuable information to work with. Each & every tip of your post is awesome. Thanks a lot for sharing. Keep blogging.
2023年4月06日 08:52
body corporate lawyers brisbane
Excellent website you have here. So much cool information!
2023年4月09日 01:00
logo designing near me
Nice to be visiting your blog again. It has been months for me. Well, this article that I've been waiting for so long. I need this article to complete my assignment in college and it has the same topic as your article. Thanks. Great share.
2023年4月16日 17:55
Go X Investment Platform
Excellent and very exciting site. Love to watch. Keep Rocking.
2023年4月18日 04:00
https://fumigar-plagas-sevilla.es/eliminar-termitas-exterminar-termitas-matar-termitas-en-sevilla/
Positive site. Where did you come up with the information on this posting? I'm pleased I discovered it though. I will be checking back soon to find out what additional posts you include.
2023年4月22日 23:59
Excellent article. Very interesting to read. I really love to read such a nice article. Thanks! Keep rocking.
2023年4月23日 03:40
Thank you very much for sharing these links. Will definitely check this out.
2023年4月23日 15:31
I am no expert. But I believe you just made an excellent point. You certainly fully understand what you are speaking about. and I can truly get behind that.
2023年4月24日 00:21
chirurgie esthétique en Tunisie
It is imperative that we read blog posts very carefully. I am already done with it and find that this post is really amazing.
2023年4月27日 00:48
I have read your article. It is very informative and helpful for me. I admire the valuable information you offer in your articles. Thanks for posting it.
2023年4月28日 08:18
Thanks for the tips and information. I really appreciate it.
2023年5月11日 01:26
Thanks for your information. It was really very helpful.
2023年5月17日 07:07
Exactly. You're very kind of us about comment!
2023年5月19日 00:55
This is a great inspiring article. I am pretty much pleased with your good work. You put really very helpful information.