태터데스크 관리자

도움말
닫기
적용하기   첫페이지 만들기

태터데스크 메시지

저장하였습니다.

hp-ux bdf 와 du 결과가 다른 경우

IT/Unix|2011. 2. 21. 13:31

bdf와 du가 다르게 보이는 이유는 남은 용량을 체크하는 기준이 다르기 때문입니다. 
bdf는 사용되지 않는 공간을 계산하여 사용량을 표시해 주며, 
du는 총 사용된 양을 더해서 남은 양을 계산해 줍니다. 
따라서 아래와 같은 경우 표시량이 다르게 됩니다. 

1. process가 creation을 하기위해 공간을 할당하는 경우 
  - 이런경우 실제로 존재하지는 않지만 process가 미리 공간을 잡기때문에 보이지 않는 공간이 bdf의 총합에 나타날수 있습니다. 
  - 이런경우에는 lsof, fsmeminfo등의 tool을 이용하여 사용중인 process를 잡아 이를 종료시키면 됩니다. 

2. spares file이 있는 경우 입니다. 
  - spares file은 파일의 앞과 끝에는 실제의 데이타가 있지만 중간에는 hole만이 존재하여 0이 채워진 파일입니다. 이런 경우에는 bdf에는 잡히지만 du에는 잡히지 않습니다. 이를 발견하는 것은 copy을 해 보면 실제로 모든 공간을 차지하는 파일로 생성이 되어 알 수 있습니다. 

3. umount 상태에서 mount point밑에 파일을 생성하는 경우입니다. 
  - 특정 디렉토리를 umount후에 그 디렉토리 밑으로 파일을 생성하고서, 
mount을 하게 되면, 그 파일은 보이지 않게 되고, bdf에는 잡히나 du에는 잡히지 않게 됩니다. 이런경우 umount후에 파일을 삭제후 mount하면 됩니다. 

hp RC 에서 제공하는 uli 라는 tool 로 해당 process 를 확인할수 있습니다.

host1:/tmp>./uli

libp4 (9.219): Opening /stand/vmunix /dev/kmem

Loading symbols from /stand/vmunix
Kernel TEXT pages not requested in crashconf
Will use an artificial mapping from a.out TEXT pages
Loading symbols from /stand/current/mod/secure_os
Loading symbols from /stand/current/mod/rng
Loading symbols from /stand/current/mod/mpt
Loading symbols from /stand/current/mod/sasd
Loading symbols from /stand/current/mod/ciss
Loading symbols from /stand/current/mod/nadv
Loading symbols from /stand/current/mod/lvmp
Loading symbols from /stand/current/mod/iexgbe
Loading symbols from /stand/current/mod/icxgbe
Loading symbols from /stand/current/mod/gelan
Loading symbols from /stand/current/mod/igssn
Loading symbols from /stand/current/mod/cdfs
Loading symbols from /stand/current/mod/c8xx
Loading symbols from /stand/current/mod/procsm
Loading symbols from /stand/current/mod/btlan
Loading symbols from /stand/current/mod/gvsd
Loading symbols from /stand/current/mod/vxportal
Loading symbols from /stand/current/mod/td
Loading symbols from /stand/current/mod/iether
Loading symbols from /stand/current/mod/igelan
Loading symbols from /stand/current/mod/fcd
   PID   PPID COMMAND             INODE DEVICE                      SIZE(bytes)
 15262      1 process_test          1197391 /dev/root                       6160965
 15262      1 process_test          197391 /dev/root                         6160965
 17763  16487 java                18175 /dev/vg14/lvol3                   8191
 17763  16487 java                16830 /dev/vg14/lvol3                  10127



댓글()