- 论坛徽章:
- 0
|
磁盘空间释放不料怎么办?
Some applications, particularly databases, maintain data in sparse files. Files that do not have disk blocks allocated for each logical block are called sparse files. If the file offsets are greater than 4 MB, then a large disk block of 128 KB is allocated. Applications using sparse files larger than 4 MB may require more disk blocks in a file system enabled for large files than in a regular file system.
In the case of sparse files, the output of ls command is not owing the actual files size, but is reporting the number of bytes between the first and last blocks allocated to the file, as shown in the following example:
# ls -l /tmp/"sparsefile name"
-rw-r--r-- 1 root system 100000000 Jul 16 20:57 /tmp/sparsefile
The du command can be used to see the actual allocation, since it reports the
blocks actually allocated and in use by the file. Use du -rs to report the
number of allocated blocks on disk.
# du -rs /tmp/sparsefile
256 /tmp/sparsefile |
|