当前位置:网站首页>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"磁盘空间不足无法再创建文件的情况:
边栏推荐
- 队列题目:最近的请求次数
- UE4 opens doors with overlapping events
- Industry Status?Why do Internet companies prefer to spend 20k to recruit people rather than raise their salary to retain old employees~
- [SWPU2019]Web1
- Based on holding YOLOv5 custom implementation of FacePose YOLO structure interpretation, YOLO data format conversion, YOLO process modification"
- DNS被劫持如何处理?
- You may use special comments to disable some warnings. Three ways to report errors
- 事件解析树Drain3使用方法和解释
- shell脚本:for循环与while循环
- UE4 通过重叠事件开启门
猜你喜欢
商业智能BI业务分析思维:现金流量风控分析(一)营运资金风险
Haproxy搭建Web群集
iMedicalLIS监听程序(2)
从企业的视角来看,数据中台到底意味着什么?
[MRCTF2020]Ezpop(详解)
iMedicalLIS listener (2)
public static <T> List<T> asList(T... a) 原型是怎么回事?
Index Mysql in order to optimize paper 02 】 【 10 kinds of circumstances and the principle of failure
日志导致线程Block的这些坑,你不得不防
Confessing the era of digital transformation, Speed Cloud engraves a new starting point for value
随机推荐
iMedicalLIS listener (2)
How to find all fields with empty data in sql
The test salary is so high?20K just graduated
MRTK3 develops Hololens application - gesture drag, rotate, zoom object implementation
JeeSite新建报表
国学*周易*梅花易数 代码实现效果展示 - 梅花心易
Queue Topic: Recent Requests
炎炎夏日教你利用小米智能家居配件+树莓派4接入Apple HomeKit
DNS被劫持如何处理?
UE4 通过与其它Actor互动开门
将故事写成我们
不看后悔,appium自动化环境完美搭建
This year's Qixi Festival, "love vegetables" are more loving than gifts
Solana NFT开发指南
第一次性能测试实践,有“亿”点点紧张
The most comprehensive exam questions for software testing engineers in 2022
How to wrap markdown - md file
Package zip is not available, but is referred to by another package.
The second council meeting of the Dragon Lizard Community was successfully held!Director general election, 4 special consultants joined
What is the difference between SAP ERP and ORACLE ERP?