当前位置:网站首页>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: 
边栏推荐
- 多御安全浏览器新版下载 | 功能优秀性能出众
- Event parse tree Drain3 usage and explanation
- How to wrap markdown - md file
- UE4 opens door via interaction (keyboard key)
- [极客大挑战 2019]FinalSQL
- 日志导致线程Block的这些坑,你不得不防
- How do newcomers get started and learn software testing?
- 1007 Climb Stairs (greedy | C thinking)
- Acid (ACID) Base (BASE) Principles for Database Design
- 阿里本地生活单季营收106亿,大文娱营收72亿,菜鸟营收121亿
猜你喜欢

iMedicalLIS监听程序(2)

不看后悔,appium自动化环境完美搭建

UE4 为子弹蓝图添加声音和粒子效果

UE4 第一人称角色模板 添加生命值和调试伤害

什么是ASEMI光伏二极管,光伏二极管的作用

The test salary is so high?20K just graduated

[TA-Frost Wolf_may-"Hundred Talents Project"] Graphics 4.3 Real-time Shadow Introduction
![[CISCN2019 华东南赛区]Web11](/img/15/843334fec0a5cc8cfaba92aab938db.png)
[CISCN2019 华东南赛区]Web11

Developing Hololens encountered The type or namespace name 'HandMeshVertex' could not be found..

Use CH341A to program external Flash (W25Q16JV)
随机推荐
Bytebuffer put flip compact clear method demonstration
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?
How to find all fields with empty data in sql
多御安全浏览器 V10.8.3.1 版正式发布,优化多项内容
GC Gaode coordinate and Baidu coordinate conversion
DEJA_VU3D - Cesium功能集 之 058-高德地图纠偏
[SWPU2019]Web1
日志导致线程Block的这些坑,你不得不防
How to wrap markdown - md file
Four-digit display header design
DEJA_VU3D - Cesium功能集 之 056-智图Arcgis地图纠偏
[SWPU2019]Web1
[8.3] Code Source - [meow ~ meow ~ meow~] [tree] [and]
多列属性column元素的可见性:display、visibility、opacity、垂直对齐方式:vertical-align、z-index 越大越显示在上层
Android 面试题——如何徒手写一个非阻塞线程安全队列 ConcurrentLinkedQueue?
The most comprehensive exam questions for software testing engineers in 2022
In the WebView page of the UI automation test App, the processing method when the search bar has no search button
Bosses, I noticed that a mysql CDC connector parameters scan. The incremental. Sna
Increasing leetcode - a daily topic 1403. The order of the boy sequence (greed)
C+ +核心编程