当前位置:网站首页>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: 
边栏推荐
- flink读取mongodb数据源
- Some conventional routines of program development (1)
- A 35-year-old software testing engineer with a monthly salary of less than 2W, resigns and is afraid of not finding a job, what should he do?
- Qixi Festival code confession
- [TA-Frost Wolf_may-"Hundred Talents Project"] Graphics 4.3 Real-time Shadow Introduction
- Hard power or soft power, which is more important to testers?
- 数组常用方法总结
- UI自动化测试 App的WebView页面中,当搜索栏无搜索按钮时处理方法
- BI业务分析思维:现金流量风控分析(二)信用、流动和投资风险
- [SWPU2019]Web1
猜你喜欢
![[Geek Challenge 2019]FinalSQL](/img/e4/0c8225ef7c5e7e5bdbaac2ef6fc867.png)
[Geek Challenge 2019]FinalSQL

【测量学】速成汇总——摘录高数帮

Android interview question - how to write with his hands a non-blocking thread safe queue ConcurrentLinkedQueue?

markdown如何换行——md文件

Ice Scorpion V4.0 attack, security dog products can be fully detected
![[极客大挑战 2019]FinalSQL](/img/e4/0c8225ef7c5e7e5bdbaac2ef6fc867.png)
[极客大挑战 2019]FinalSQL

七夕节代码表白
![[BJDCTF2020] EasySearch](/img/60/464de3bcdda876171b9f61ad31bff1.png)
[BJDCTF2020] EasySearch

银行数据采集,数据补录与指标管理3大问题如何解决?
![[MRCTF2020] Ezpop (detailed)](/img/19/920877ca36d1eda8d118637388ab05.png)
[MRCTF2020] Ezpop (detailed)
随机推荐
In the WebView page of the UI automation test App, the processing method when the search bar has no search button
第一次性能测试实践,有“亿”点点紧张
[Geek Challenge 2019]FinalSQL
The sword refers to Offer--find the repeated numbers in the array (three solutions)
cross domain solution
日志导致线程Block的这些坑,你不得不防
35岁的软件测试工程师,月薪不足2W,辞职又怕找不到工作,该何去何从?
Spark基础【介绍、入门WordCount案例】
The most comprehensive exam questions for software testing engineers in 2022
Android interview question - how to write with his hands a non-blocking thread safe queue ConcurrentLinkedQueue?
UE4 第一人称角色模板 添加蹲伏功能
C+ +核心编程
Summary of common methods of arrays
Ffmpeg - sources analysis
七夕节赚徽章拉
How to discover a valuable GameFi?
[CISCN2019 华东南赛区]Web11
[CISCN2019 South China Division]Web11
Bosses, I noticed that a mysql CDC connector parameters scan. The incremental. Sna
Redis key basic commands