当前位置:网站首页>There are a lot of 4T hard drives remaining, prompting "No space left on device" insufficient disk space
There are a lot of 4T hard drives remaining, prompting "No space left on device" insufficient disk space
2022-08-05 04:10:00 【aixueai】
In linux, there are two concepts of hard disk, namely block and inode
- block: used to store actual data, the actual occupied space can be viewed with df -h
- inode: store file attributes, the actual occupied node is viewed with df -i
As long as one of these two is full, it will cause the error "No space left on device" to be prompted for insufficient disk space, that is, if all inodes in the file system are exhausted, even if there is free space on the disk,The kernel also cannot create new files.
After formatting the disk with the default parameters of mkfs.ext4, it is found that the formatting time is very long, and the formatting takes up a lot of space on the disk.For example, it will take about 10 minutes to format a 2TB disk and occupy about 30G of disk space.
The reason is that the original inode will occupy disk space, and each inode occupies 256b of space.
By default, mkfs2fs allocates an inode for every 16kb of disk space;
So, when creating a new filesystem on a partition, you can use the -i option to set the bytes per inode (bytes/inode ratio), the larger the bytes per inode ratio, the fewer inodes will be created.For example:
$ sudo mkfs.ext4 -i 16400 /dev/sdc1
Note: Once a filesystem is created, the bytes-per-inode ratio cannot be changed (unless reformatted), whereas resizing a filesystem changes the number of inodes to maintain that ratio.
Linux Quick Format Command
Use the -T flag to specify how the filesystem will be used, telling the filesystem will be used to create or store largefile and largefile4, which provide more ratios, i.e. one inode per 1 MiB and 4 MiB, respectively, reducing the number of inodes,The formatting rate will also be faster.
$ sudo mkfs.ext4 -T largefile /dev/device
$ sudo mkfs.ext4 -T largefile4 /dev/device
[How much disk space to allocate an inode] corresponding to largefile and largefile4 is actually defined in /etc/mke2fs.conf.
largefile type is 1M one inode
largefile4 type is 4M one inode
This format will be faster, but the inode will be reduced. If you are sure that all large files are stored, it can be used in this way. If all small files are stored, there will be a lot of remaining space on the disk when inodes are exhausted, butPrompt "No space left on device" when the disk space is insufficient to create a file: 
边栏推荐
- 日志导致线程Block的这些坑,你不得不防
- UE4 opens doors with overlapping events
- Redis1:Redis介绍、Redis基本特性、关系型数据库、非关系型数据库、数据库发展阶段
- 开发属于自己的node包
- 【 8.4 】 source code - [math] [calendar] [delete library 】 【 is not a simple sequence (Bonus) 】
- The first performance test practice, there are "100 million" a little nervous
- UE4 第一人称角色模板 添加蹲伏功能
- 从企业的视角来看,数据中台到底意味着什么?
- Bytebuffer put flip compact clear method demonstration
- Paparazzi: Surface Editing by way of Multi-View Image Processing
猜你喜欢

Event parse tree Drain3 usage and explanation

从企业的视角来看,数据中台到底意味着什么?

阿里本地生活单季营收106亿,大文娱营收72亿,菜鸟营收121亿

四位数显表头设计

JeeSite新建报表
![[极客大挑战 2019]FinalSQL](/img/e4/0c8225ef7c5e7e5bdbaac2ef6fc867.png)
[极客大挑战 2019]FinalSQL

Developing Hololens encountered The type or namespace name 'HandMeshVertex' could not be found..
![[Software testing] unittest framework for automated testing](/img/80/caedd5cf6dd61c9d75475866613cac.png)
[Software testing] unittest framework for automated testing

iMedicalLIS listener (2)

How do newcomers get started and learn software testing?
随机推荐
[MRCTF2020]Ezpop(详解)
[CISCN2019 South China Division]Web11
In the WebView page of the UI automation test App, the processing method when the search bar has no search button
Cron(Crontab)--使用/教程/实例
Mysql's redo log detailed explanation
[SWPU2019]Web1
UE4 为子弹蓝图添加声音和粒子效果
Ffmpeg - sources analysis
iMedicalLIS listener (2)
UE4 更改组件变量 (以修改第一人称角色模板的最大行走速度和跳跃高度为例)
测试薪资这么高?刚毕业就20K
重载运算符
UE4 第一人称角色模板 添加蹲伏功能
35岁的软件测试工程师,月薪不足2W,辞职又怕找不到工作,该何去何从?
4T硬盘剩余很多提示“No space left on device“磁盘空间不足
[BSidesCF 2019] Kookie
【树莓派】树莓派调光
Based on holding YOLOv5 custom implementation of FacePose YOLO structure interpretation, YOLO data format conversion, YOLO process modification"
flink reads mongodb data source
What is the function of industrial-grade remote wireless transmission device?