본문 바로가기
HP-UX/Operating System

[HP-UX] HP-UX 11.X File System 구조

by 레이루이 2008. 5. 1.
반응형

1.1           File system layout

 
- Static(Shared) 디렉토리들에는 실행파일이나 OS 다큐멘테이션 등과 같은 read-only
파일들이 존재한다. 이 디렉토리는 다른 호스트들에 의해 공유될 수 있다.
- Dynamic(Private) 디렉토리들에는 사용자 작업 파일이나 어플리케이션 구성파일,
로그 파일 등이 존재한다. 이 곳에는 호스트마다 다른 특정한 정보들이 있다.
- O/S install시 기본으로 /, /stand, /var, /opt, /usr, /tmp, /home의 file system이 구성됨.
 

1.2           Commands to Help You Navigate

- find : file 및 file system 의 구조를 탐색할 수 있다.
[예제] # find . –size +1000000c|tee /tmp/bigfiles
ð             1M 이상의 파일을 찾아서 stdout 과 /tmp/bigfiles에 저장
- whereis : source, binaries, man pages 을 찾을 수 있다.
[예제] # whereis sendmail
- which : PATH 변수에 설정된 환경 하에서 실행 파일을 찾을 수 있다.
[예제] # which sendmail
- file : file type을 알 수 있다.
[예제] # file /usr/sbin/sendmail
 

1.3           시스템의 주요 정보 및 파일들

n        아래의 command를 실행한 후 출력 결과를 printer로 출력하여 보관한다.
    이 정보는 향후 시스템에 문제가 발생할 경우 필요한 최소한의 정보로 고객의 시스
템에 설치된 product에 따라 더 많은 Configuration file이 필요할 수도 있다.
  시스템 관리자는 반드시 아래 내용을 Printer로 출력하여 두고 필요한 모든
Configuration file을 별도로 백업 받아둔다.
        - System Configuration Information
             # ioscan -fn
             # strings /etc/lvmtab
             # vgdisplay -v Volume-Group-Name
             # lvdisplay -v Logical-Volume-Name
             # bdf
             # swapinfo
             # sysdef
ð      현재 실행중인 o/s kernel 을 분석하여 tunable configuration parameter를 
보여줌
             # dmesg
             # lpstat -t
             # lvlnboot –v
ð      boot, root, primary swap, dump logical volume에 대한 정보를 보여줌
             # cat /stand/system
             # cat /etc/passwd
             # netstat –rn
             # lanscan
                         
n        시스템의 중요한 파일들
/etc/passwd                         User ID 및 password가 들어 있는 파일
/etc/group                            Group ID와 Group에 속한 User ID가 들어 있음
/etc/fstab                             file system의 mount정보가 있음
/etc/PATH                            모든 사용자에게 적용되는 PATH 설정을 위한 파일.
/etc/rc.log                            시스템 부팅 시 생성되는 log 파일
/etc/resolv.conf                    Name Server(DNS, NIS)를 지정하는 파일
/etc/rc.config.d/namesvrs      DNS, NIS Server 설정 파일
/etc/rc.config.d/netconf         hostname, ip-address, routing에 대한 정보가 있는 중
요한 파일
/etc/nfsconf                          NFS 설정을 위한 파일
 
n        기타 configuration files 
/etc/cmcluster/*          HA Product(MC S/G, MC L/M) 의 configuration file 및
실행 파일

1.4           Log Files

n        무한정 커지는 log files
 
File name
Command
Description
/var/adm/wtmp
last
Successful login attempts
/var/adm/btmp
lastb
Unsuccessful login attempts
/var/adm/sulog
 
Log uses of “su” command
/var/adm/cron/log
 
 
/var/adm/lp/log
 
 
/var/adm/sw/sw*.log
 
 
 
-  대부분의 모든 log file들은 /var directory에 쌓인다.
-  O/S 및 Application 의 임시파일은 /tmp 혹은 /var/tmp directory에 쌓인다.
-  File system 관리적인 측면에서 정기적으로 clear 시키는 것이 좋다.
#cat /dev/null >/var/adm/wtmp  or   # >/var/adm/wtmp
 
n        Core File
-  Core File은 시스템의 어디서나 나타날 수 있다.
어떤 신호를 받을 때 만들어지고 종료되지 않은 프로세스의 코어 이미지이다.
가장 일반적인 원인으로는 메모리 위반, 잘못된 지시, 유동 소수점 예외, 버스
오류, 사용자 생성 종료 신호 등이 있다.
-  Core File을 이용하면 프로세스가 종료할 때 수행 중이던 일을 분석할 수 있다.
[예제] # strings /tmp/core 
-  대체로 core 파일은 의미가 없고 size가 크기 때문에 파일 시스템 관리적인 측면
에서 삭제 해준다.
[예제] “core “ 파일을 찾아서 모두 삭제
# find / -name core –exex rm {} ;
 
n        Large and Old Files
- Size가 5M byte 이상인 파일을 찾아냄.
[예제] # find  /  -size  +5000000c -print                ( c: byte )
- 5일 동안 Access하지 않은 파일을 찾아냄.
[예제] # find  /  -atime  5days  -print :
반응형