임 장치에 남아있는 공간, 하위 디렉토리는, 그러나 280 만 개 파일 한 후이 오류가 나타 없습니다 :파이썬 OSError 폴더에 많은 파일을 작성
with open(bottleneck_path, 'w') as save_file:
OSError: [Errno 28] No space left on device: '/home/user/path/redacted'
나는 파일 이름의 길이를 확인했습니다하는 길이는 149 자입니다. 파일 크기는 약 18K가되어야합니다.
내 운영 체제가 Linux입니다.
DF -i :
Filesystem Inodes IUsed IFree IUse% Mounted on
udev 4106923 544 4106379 1% /dev
tmpfs 4113022 836 4112186 1% /run
/dev/sda2 28401664 9008557 19393107 32%/
tmpfs 4113022 40 4112982 1% /dev/shm
tmpfs 4113022 5 4113017 1% /run/lock
tmpfs 4113022 16 4113006 1% /sys/fs/cgroup
/dev/sda1 0 0 0 - /boot/efi
안양 -T
Filesystem Type 1K-blocks Used Available Use% Mounted on
udev devtmpfs 16427692 0 16427692 0% /dev
tmpfs tmpfs 3290420 22136 3268284 1% /run
/dev/sda2 ext4 447088512 355325584 69029056 84%/
tmpfs tmpfs 16452088 82448 16369640 1% /dev/shm
tmpfs tmpfs 5120 4 5116 1% /run/lock
tmpfs tmpfs 16452088 0 16452088 0% /sys/fs/cgroup
/dev/sda1 vfat 523248 3684 519564 1% /boot/efi
뒤 -SH.
56G
ls | wc -l
2892084
ext4는이 문제를 잘 처리 할 수 있어야합니다.
는 편집 :
touch /home/user/path/redacted/somefile_1
를 사용
tune2fs -l는/dev/sda2가
tune2fs 1.42.13 (17-May-2015)
Filesystem volume name: <none>
Last mounted on: /
Filesystem UUID: cd620466-1f88-400b-acf5-457a9c9544cf
Filesystem magic number: 0xEF53
Filesystem revision #: 1 (dynamic)
Filesystem features: has_journal ext_attr resize_inode dir_index filetype needs_recovery extent flex_bg sparse_super large_file huge_file uninit_bg dir_nlink extra_isize
Filesystem flags: signed_directory_hash
Default mount options: user_xattr acl
Filesystem state: clean
Errors behavior: Continue
Filesystem OS type: Linux
Inode count: 28401664
Block count: 113587456
Reserved block count: 5679372
Free blocks: 82864623
Free inodes: 25755495
First block: 0
Block size: 4096
Fragment size: 4096
Reserved GDT blocks: 996
Blocks per group: 32768
Fragments per group: 32768
Inodes per group: 8192
Inode blocks per group: 512
Flex block group size: 16
Filesystem created: Wed Mar 1 15:14:22 2017
Last mount time: Mon Mar 27 13:20:00 2017
Last write time: Mon Mar 27 13:20:00 2017
Mount count: 35
Maximum mount count: -1
Last checked: Wed Mar 1 15:14:22 2017
Check interval: 0 (<none>)
Lifetime writes: 1813 GB
Reserved blocks uid: 0 (user root)
Reserved blocks gid: 0 (group root)
First inode: 11
Inode size: 256
Required extra isize: 28
Desired extra isize: 28
Journal inode: 8
First orphan inode: 1312056
Default directory hash: half_md4
Directory Hash Seed: e186507d-32b5-49c0-8ce1-09bf2a75d816
Journal backup: inode blocks
에서 오류가 발생하지만, 다른 이름으로 같은 파일 이름 구조가 잘 작동합니다. 예 :
touch /home/user/path/redacted/somefile_2
280 만 개의 파일을 모두 해당 디렉토리의 하위 디렉토리로 작성하고 있습니까? 아니면 중첩도 있습니까? ext4는 [이 질문에 따라] 디렉토리 당 64k 서브 디렉토리의 한계가있는 것 같습니다 (http://serverfault.com/questions/506465/is-there-a-hard-limit-to-the-number-of- files-a-directory-can-have) –
@HoriaComan 거기에 중첩이 없으므로, 저것을 봐. – pvg
ext4가이 문제를 잘 처리 할 수 있어야합니다. 서브 디렉토리가 없습니다. – Wesley