Ext3에서 ENOSPC관련 질문 있습니다.

darkill의 이미지

ext3에서 ENOSPC가 발생해서 더이상 write가 되지 않는 걸 확인하고
free블럭 갯수를 확인해 보면
0이 나오는게 아니고 free블럭이 몇천개 정도 더 있습니다.

그런데 왜 ENOSPC가 발생하는지 궁금하고 해결책은 없는지.

그리고 ENOSPC가 발생한 상태에서 exit로 강제 종료하고
cp 명령어로 파일을 복사하면 더 복사가 가능하라구요.
그리고 cp로 복사하다 용량이 다 찼다는 메시지가 나오고 종료된 상태에서도
free블럭이 존재하고 파일을 생성해서 데이타까지 저장됩니다.

왜 그런지... 알고 싶고 이런걸 해결할 방법이 있음 알려주세요

제가 정확히 원하는것은 write()함수를 써서 모든 블럭을 사용하것입니다.
즉 free블럭이 0이 되게요..
고수님들 의견 부탁드립니다.

ganadist의 이미지

다음은 tune2fs 맨페이지의 일부 입니다.

       -m reserved-blocks-percentage
              Set the percentage of the filesystem which may only be allocated
              by privileged processes.   Reserving some number  of  filesystem
              blocks for use by privileged processes is done to avoid filesys-
              tem fragmentation, and to allow system  daemons,  such  as  sys-
              logd(8),  to continue to function correctly after non-privileged
              processes are prevented from writing to  the  filesystem.   Nor-
              mally, the default percentage of reserved blocks is 5%.
 
       -r reserved-blocks-count
              Set the number of reserved filesystem blocks.

----
Do not feed troll!

----
데스크탑 프로그래머를 꿈꾸는 임베디드 삽질러