当前位置:网站首页>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数据源
- 905. Interval selection
- 4T硬盘剩余很多提示“No space left on device“磁盘空间不足
- overloaded operator
- MySql index learning and use; (I think it is detailed enough)
- UE4 通过互动(键盘按键)开门
- 36-Jenkins-Job迁移
- The most comprehensive exam questions for software testing engineers in 2022
- 银行数据采集,数据补录与指标管理3大问题如何解决?
- UE4 opens doors with overlapping events
猜你喜欢
mutillidae下载及安装
Learning and finishing of probability theory 8: Geometric and hypergeometric distributions
Detailed and comprehensive postman interface testing practical tutorial
How to discover a valuable GameFi?
[TA-Frost Wolf_may-"Hundred Talents Project"] Graphics 4.3 Real-time Shadow Introduction
Static method to get configuration file data
flink reads mongodb data source
No regrets, the appium automation environment is perfectly built
阿里本地生活单季营收106亿,大文娱营收72亿,菜鸟营收121亿
How to solve complex distribution and ledger problems?
随机推荐
[8.3] Code Source - [meow ~ meow ~ meow~] [tree] [and]
[Software testing] unittest framework for automated testing
Mathematics - Properties of Summation Symbols
多列属性column元素的可见性:display、visibility、opacity、垂直对齐方式:vertical-align、z-index 越大越显示在上层
多御安全浏览器新版下载 | 功能优秀性能出众
DEJA_VU3D - Cesium功能集 之 057-百度地图纠偏
Industry Status?Why do Internet companies prefer to spend 20k to recruit people rather than raise their salary to retain old employees~
Web3.0 Dapps - the road to the future financial world
Static method to get configuration file data
Paparazzi: Surface Editing by way of Multi-View Image Processing
[SWPU2019]Web1
1007 Climb Stairs (greedy | C thinking)
token, jwt, oauth2, session parsing
[8.2] Code Source - [Currency System] [Coins] [New Year's Questions (Data Enhanced Edition)] [Three Stages]
Summary of common methods of arrays
[MRCTF2020] PYWebsite
Some conventional routines of program development (1)
UE4 为子弹蓝图添加声音和粒子效果
overloaded operator
Ali's local life's single-quarter revenue is 10.6 billion, Da Wenyu's revenue is 7.2 billion, and Cainiao's revenue is 12.1 billion