当前位置:网站首页>4T硬盘剩余很多提示“No space left on device“磁盘空间不足
4T硬盘剩余很多提示“No space left on device“磁盘空间不足
2022-08-05 03:55:00 【aixueai】
在linux中,硬盘有两个概念,就是block和inode
- block:用于存放实际数据 ,实际占用空间用 df -h 查看
- inode:存放文件属性 ,实际占用的节点用 df -i 查看
只要这两个其中一个占满空间了,都会导致提示报错"No space left on device"磁盘空间不足,也就是如果文件系统中的所有inode都已耗尽,即使磁盘上有可用空间,内核也不能创建新文件。
使用mkfs.ext4默认参数格式化磁盘后,发现格式化时间特别长,并且格式化会占用磁盘很大的空间。例如2TB的磁盘格式化会占用10分钟左右时间,并占用30G左右的磁盘空间。
究其原因,原来inode会占用磁盘空间,每个inode占用256b大小空间。
默认情况下,mkfs2fs会为每16kb的磁盘空间分配一个inode;
所以,在分区上创建新文件系统时,可以使用-i选项设置每inode字节数(字节/inode比率),每inode字节数比率越大,将创建的inode越少。例如:
$ sudo mkfs.ext4 -i 16400 /dev/sdc1
注意:一旦创建了文件系统,就无法更改每inode字节数的比率(除非重新格式化),而调整文件系统的大小会更改inode的数目以维持该比率。
Linux的快速格式化命令
使用-T标志来指定如何使用文件系统,告诉文件系统将用于创建或存储largefile和largefile4,它们分别提供更多比率,即每1 MiB和4 MiB一个索引节点,减少inode个数,格式化速率也会变快。
$ sudo mkfs.ext4 -T largefile /dev/device
$ sudo mkfs.ext4 -T largefile4 /dev/device
largefile和largefile4对应的【多大磁盘空间分配一个inode】其实是在 /etc/mke2fs.conf 定义的。
largefile 类型就是 1M 一个 inode
largefile4 类型就是 4M 一个 inode
如此格式化会变快,但是inode会减少,如果你确定存储的都是大文件是可以这样用的,如果存储的都是小文件,inode耗尽就会出现磁盘剩余空间很多,但提示"No space left on device"磁盘空间不足无法再创建文件的情况:
边栏推荐
- Growth-based checkerboard corner detection method
- 十五. 实战——mysql建库建表 字符集 和 排序规则
- Mathematics - Properties of Summation Symbols
- UE4 更改组件变量 (以修改第一人称角色模板的最大行走速度和跳跃高度为例)
- DNS被劫持如何处理?
- ffmpeg 像素格式基础知识
- The test salary is so high?20K just graduated
- ffmpeg 枚举decoders, encoders 分析
- public static
List asList(T... a) What is the prototype? - Summary of common methods of arrays
猜你喜欢

Index Mysql in order to optimize paper 02 】 【 10 kinds of circumstances and the principle of failure

Use CH341A to program external Flash (W25Q16JV)

Event parse tree Drain3 usage and explanation

mutillidae下载及安装

UE4 更改组件变量 (以修改第一人称角色模板的最大行走速度和跳跃高度为例)

YYGH-13-客服中心

YYGH-13-Customer Service Center

This year's Qixi Festival, "love vegetables" are more loving than gifts

21 Days Learning Challenge (2) Use of Graphical Device Trees

Initial solution of the structure
随机推荐
How do newcomers get started and learn software testing?
多御安全浏览器 V10.8.3.1 版正式发布,优化多项内容
银行数据采集,数据补录与指标管理3大问题如何解决?
The sword refers to Offer--find the repeated numbers in the array (three solutions)
Use Unity to publish APP to Hololens2 without pit tutorial
队列题目:最近的请求次数
[极客大挑战 2019]FinalSQL
On governance and innovation, the 2022 OpenAtom Global Open Source Summit OpenAnolis sub-forum came to a successful conclusion
UE4 通过重叠事件开启门
ffmpeg 像素格式基础知识
Use CH341A to program external Flash (W25Q16JV)
DEJA_VU3D - Cesium功能集 之 057-百度地图纠偏
如何解决复杂的分销分账问题?
MySql index learning and use; (I think it is detailed enough)
Android interview question - how to write with his hands a non-blocking thread safe queue ConcurrentLinkedQueue?
Acid (ACID) Base (BASE) Principles for Database Design
Solana NFT开发指南
十五. 实战——mysql建库建表 字符集 和 排序规则
cross domain solution
关于#SQL#的迭代、父子结构查询问题,如何解决?