HP-UX System & Network Administration I 0
HP-UX System and Network
Administration I
목 차
Module 1 Introduction to HP-UX Administration
1-1. Hardware Responsibilities
* System의 Create and maintain a hardware diagram of the system.
* Verify that peripherals are installed correctly and tested.
* Monitor performance of hardware components.
* Arrange for repair in event of hardware failure
1-2. Software Responsibilities
* Install and configure the HP-UX operating system.
* Create file Systems. newfs
* Manage the integrity of file systems. fsck
* Monitor system resource usage. bdf
* Design and implement backup and recovery routines.
* Configure and maintain printer spooler software. lpadmin
* Install and maintain network communication software.
* Update the HP-UX operating system for new release. swinstall, swremove, swlist
* Install and update application software.
1-3. Responsibilities to the Users
* Allow user access to the system as required.
* Evaluate user needs.
* Plan for future system growth/change.
* Provide assistance to the user community.
* Implement the policies and procedures of your company/organization
regarding the use of the computer system and network.
1-4. The System Administrator’s Tool Kit
* SAM
* Support Contract
* HP-ESC
* HP-UX Documentation
Module 2 Overview of SAM
2-1. Why Use SAM ?
Advantages
* Simplifies complex administration tasks
* Minimizes potential for errors
* Provides a built-in help utility
Disadvantages
* Is less flexible than manual configuration
* Is not helpful in some troubleshooting situations
Shell / Environment / Environment FilePOSIX, Korn or Bourne shells / export DISPLAY=hostname:0.0 / .profile or .dtprofile
C shell / setenv DISPLAY=hostname:0.0 / .login
Module 3 Creating and Managing User Accounts
3-1. Users and Groups – Access to System and Data
3-2. What Defines a User Account ?
/etc/passwd /etc/group
user1: … accounts: …
user2: … research: …
user3: … finances: …
uesr4: … admin: …
3-3. The /etc/passwd file
Example :
root:Eq0oBTr1y1I7w:0:3:super user:/:/sbin/sh
daemon:*:1:5::/:/sbin/sh
bin:*:2:2::/usr/bin:/sbin/sh
sys:*:3:3::/:
Use /usr/sbin/vipw to edit /etc/passwd file edit
Use /usr/sbin/pwck /etc/passwd file error check
terry:ZMPPAvHrXTDfM:265:20:TerryKellog:/home/terry:/usr/bin/sh
ex ) username:password:user_ID:group_ID:ID_string:home_directory:login_shell
3-4. The /etc/group File
group_name:password:group_id:group_list
Example :
other::1:root,daemon,uucp,sync
users::20:
develop::101:bugs,daffy
sales::102:bugs,daffy,elmer,marvin
Use /usr/sbin/grpck to check /etc/group file error check
User ADD SAM Account for users and group user Menu이동 action Add
3-5. Creating User Accounts with SAM
useradd –u 1045 –g users –d /home/ybnoh –s /usr/bin/ksh –m ybnoh
3-6. Deactivating and Removing Users with SAM
Module 4 Customizing User Accounts
4-1. Why Customize a User Account ?
Set the user’s terminal type.
Customize the user’s prompt.
Set the user’s default printer. 변수
Customize the user’s PATH variable.
Define a command line editor.
4-2. Some Sample Customizations
export TERM=’vt100’
export PS1=’$PWD $’
export LPDEST=’laser’
export PATH=$PATH:/usr/local/bin
export EDITOR=vi recalling
export HISTSIZE=50 recalling이 저장되는 단위
export HISTFILE=~/.sh_history recalling이 저장되는 File
4-3. What Happens When a User Logs In?
Displays the contents of the /etc/copyright and /etc/motd file.
wall : 접속해 있는 User들에게 Message 전송
4-4. What Happens at CDE Login ?
Module 5 Guided Tour of the HP-UX File Hierarchy
5-1. Introducing the File System Paradigm
Executables
Static Files Libraries
System startup
Configuration
Dynamic Files Temporary
User
5-2. The File System Layout
/usr Sharable operating system commands, libraries, and documentation.
/usr/bin : general user command
/usr/sbin : super user command
/sbin Minimum commands needed to boot the system and mount other file systems.
/opt Applications.
/etc System configuration files. No longer contains executable files.
/dev Device files.
/var Dynamic information such as logs and spooler files (previously in /usr).
mail, unix log file
/var/adm ; Common administrative files and log files.
/var/adm/crash ; Kernel crash dumps.
/mnt Local mounts.
/tmp Operating System temporary files.
/stand Kernel and boot loader.
/home User directories.
5-3. Commands to Help You Navigate
find Searches the file hierarchy 모든 파일 Search
find . –name
-user
-perm 755
-size +10000C (10000 byte 초과)
-atime +30
whereis Locates source, binaries, and man pages 실행 파일의 위치
which Locates an executable in your PATH PATH 변수 안에서만
file Determines file type ASCII, binary
Module 6 Connecting Peripherals
6-1. The HP9000 Product Family
Servers Series 800 – Class V, N, K, D
Workstation Series 700
numbers of CPUs CPU 수
processor speed CPU 속도
I/O expandability 확장성
graphics capabilities graphic 속도
6-2. Device Adapters
SCSI Small Computer System Interface. There are three SCSI-2 Interfaces available:
Single-ended, Differential, and Fast and Wide.
Supports SCSI disks, DDS tape drives, CD-ROM drives,
MO drives, quarter inch cartridges(QIC), 8mm tapes and IBM 3480-compatible drives.
MUX Multiplexer. Supports serial terminals, printers, plotters, modems, and Access Port.
LAN/9000 Local Area Network. For IEEE 802.3 and Ethernet networks.
FDDI Fiber Distributed Data Interface. High-speed local area network
6-3. Types of SCSI
Other names bus is known by / ‘Standard SCSI’‘SCSI’, ‘SCSI-2’
‘SE-SCSI’ / ‘Fast’
‘Fast/Narrow’
‘Diff-SCSI’ / ‘Differential-Wide’
‘F/W-SCSI’
‘Fast and Wide’
Compatible with the
other SCSI bus types ? / NO! / NO! / NO!
Bus Transfer Rate / 5 Mbytes/s / 10 Mbytes/s / 20 Mbytes/s
Data Bus Width / 8 bits / 8 bits / 16 bits
# Connector pins / 50 pin / 50 pin / 68 pin
Max. cable length / 6 meters / 25 meters / 25 meters
Maximum Devices on Interface / 7 / 7 / 15
Module 7 Configuring Device Files
7-1. What Is A Device File ?
7-2. Listing Device Files with ll /dev
Listing device files with ll /dev
brw-r----- 1 root sys 31 0x005000 Feb 10 1997 /dev/dsk/c0t5d0
brw-r----- 1 root sys 31 0x006000 Feb 10 1997 /dev/dsk/c0t6d0
crw-r----- 1 root sys 31 0x005000 Feb 10 1997 /dev/rdsk/c0t5d0
crw-r----- 1 root sys 31 0x006000 Feb 10 1997 /dev/rdsk/c0t6d0
crw-r----- 2 root tty 17 0x000001 Jan 9 09:25 /dev/ttyp1
crw-r----- 2 root tty 17 0x000002 Mar 9 17:46 /dev/ttyp2
device file type - c : character b : block
major # - kernel내 driver pointer
minor # - 장치 연결 경로
7-3. Listing Device Files with lssf list special file
# lssf /dev/rdsk/c0t0d0
sdisk card instance 0 SCSI target 0 SCSI LUN 0
section 0 at address 10/0.0.0 /dev/rdsk/c0t0d0
section 0 : 전체(disk)
7-4. The Layout of /dev
vg00
Terminals Modems
Disk Drives Tape Drives
7-5. Disk Drive File Names
7-6. Tape Device File Names
/dev/rmt/0m instance name
7-7. How Device Files are Creaed
Autoconfiguration
SAM
insf insf -e
mksf major#, minor#, type
mknod
Module 8 Configuring Disk Device
8-1. Disk Partitioning
Each HP-UX disk can have one or more partitions
Each partition can be used for
- a file system data 저장 (newfs)
- swap space memory swap (swapon)
- raw data
- boot area (LIF format)
8-2. Whole-Disk Partitioning
There are five ways to partition a disk using the whole disk approach.
정점 : 속도가 빠르다. (약간)
단점 : 1. Disk size 이상의 file system을 만들지 못한다.
2. 임의의 size로 file system을 만들지 못한다.
3. file system이 full이 났을때 size를 늘릴수 없다.
4. 하나의 disk에 하나의 file system
최대 Disk Size : 10.20이후 128GB
Boot Disk = boot area + root file system + primary swap (한 disk에 연속적으로 있어야 한다.)
8-3. LVM Disk Partitioning
장점 : 1. physical disk를 묶어 하나의 volume group으로 만들수 있다.
2. 4MB 단위로 file system을 자를수 있다.
3. file sytem이 full이 났을때 logical volume으로 할당되지 않은 공간이 있다면
extend 할 수 있다.
8-4. LVM Device Files
block device -> buffer 사용 : 데이터 저장형
character device -> serial : 안정성을 고려한 전송
8-5. Creating Physical Volumes
LVM Overhead (PVRA, VGRA, BBRA)
The data structures that are used by LVM consume some overhead feom the disk space. This overhead is set at a fixed boundary for bootable LVM disks (2912KB), and may vary in size for non-bootable LVM disks (typically 400KB)
8-6. Creating Volume Groups
8-7. Creating Logical Volumes
Module 9 File System Concepts
9-1. File System Types
HP-UX supports several file system types;
- HFS High Performance File System
- JFS Journaled File System 10.01부터 사용
- NFS Network File System
- CDFS CD-ROM File System
HP-UX file commands work on all HP-UX file system types.
JFS 장점 : file system recovery 속도가 빠르다.(fsck 수행시)
/etc/fstab에서 file system type 확인 가능
9-2. What’s in a File System ?
User data = actual data contained files
Metadata = file system structural information
Superblock
file system의 일반적인 정보를 포함하고 있다.
(file system type, size, status, contains pointers, other file system metadata structures.)
Inodes
Directories
9-3. Accessing a File System
9-4. HP-UX Hard Links
특징 1. 같은 file system 안에서 link가 가능
2. 오직 file만 link가 가능
3. 원본, 사본의 구분이 없다. (둘다 원본)
9-5. HP-UX Symbolic Links
특징 1. 다른 file system도 link 가능
2. Directory도 link 가능
3. 원본, 사본의 구분이 있다.
4. file type이 l로 표시된다. : symbolic link file
9-6. HFS Structural Overview
9-7. HFS Blocks
What is an HFS block ?
- HFS always reads a block of data at a time
- Allowed lock sizes : 4KB, 8KB, 16KB, 32KB, 64KB
- Blocks are not necessarily contiguous
- Block size is set at file system creation.
Assuming 8-KB blocks,
- How many accesses are required for an 8-KB read ?
- How many accesses are required for a 32-KB read ?
- How many bytes are read if a 1-KB read is requested ?
9-8. HFS Fragments
What is an HFS fragment ?
- Smallest unit of space HFS can allocate to a file
- Allowed fragment sizes : entire block, 1/2 block, 1/4 block, 1/8 block
- Fragment size is set at file system creation
Example :
How would HFS allocate space for three files of size 8K, 4K, and 3K if:
Block size = 8K Block size = 8K
Fragment size =8K Fragment size = 1K
8K fragment 8K fragment 8K fragment 1K fragment 1K fragment 1K fragment
9-9. HFS Implications
HFS Advantages
Easy to manage
Fast and efficient
The only option for the file system containing the kernel
HFS Disadvantages
Slow and unpredictable crash recovery
Must be unmounted to extend
Impossible to reduce
9-10. JFS Structural Overview
9-11. JFS Implications
JFS Advantages
- Fast, reliable crash recovery
- Online resizing
- Online backups
JFS Disadvantages
- Fragmentation issues
- “Online” functionality not included with HP-UX
- Kernel can’t be in a JFS file system
Module 10 File System Creation
10-1. Overview of File System Creation
10-2. Creating a New File System
1. Create the new file system
newfs –F vxfs /dev/vg01/rmyfs1
2. Create a mount point directory for the file system
mkdir /myfs1
3. Mount the new file system
mount /dev/vg01/myfs1 /myfs1
4. Add the file system to the /etc/fstab file
10-3. The newfs Command
Examples
1. newfs –F vxfs /dev/vg01/rmyfs1
2. newfs –F vxfs –o largefiles /dev/vg01/rmyfs1
3. newfs –F hfs /dev/vg01/rmyfs1
4. newfs –F hfs –o largefiles /dev/vg01/rmyfs1
5. newfs –F hfs –b 4096 –f 2048 –m 5 –I 4096 /dev/vg01/rmyfs2
10-4. Mounting the New File System
mkdir /myfs1
mount /dev/vg01/myfs1 /myfs1
mount –v
10-5. The umount command
umount /dev/vg01/myfs1
or
umount /myfs1
fuser –u : 사용중인 process 검색
fuser –ku /dev/vg01/myfs1 : 사용중인 process 검색해서 kill
10-6. Automatically Mounting File Systems
Place an entry in the /etc/fstab file
File systems will be mounted when the system is booted,
or you can use mount –a or mountall
You can mount file systems by absolute directory names.
Sample /etc/fstab:
/dev/vg00/lvol3 / vxfs delaylog 0 1
/dev/vg00/lvol1 /stand hfs defaults 0 1
/dev/vg00/lvol4 /home vxfs delaylog 0 2
/dev/vg00/lvol5 /opt vxfs delaylog 0 2
/dev/vg00/lvol6 /tmp vxfs delaylog 0 2
file system directory F/S type rw,suid 무조건 0 fsck시 check 순서
(예비용 field) 낮은 순서부터 0 제외
mount –a : /etc/fstab 참조
umount –a : /etc/mnttab 참조
10-7. CD-ROM File Systems (CDFS)
- Allows mass distribution and easy retrieval of large amounts of information
- You can read data from a CD, but you cannot write to it.
- To use CDFS volumes;
1. Configure the appropriate driver into the kernel.
2. Create the device files (if necessary).
3. Mount the CDFS volume with the mount command.
- CDFS Examples;
1. LaserRom Manual
2. Application CD
CD-ROM mount 절차
1. # ioscan –unfC disk
2. # mkdir /cdrom
3. # mount /dev/dsk/c1t3d0 /cdrom
Module 11 File System Repair
11-1. File System Maintenance
Routine Maintenance
- Check file system integrity fsck
- Employ regular backup procedures
- Monitor disk usage bdf
11-2. Flushing the Buffer Cache
sync(1m)
Writes buffer contents to disk
Keeps the file system current
Is normally invoked on a regular basis by the syncer daemon
syncer(1m) daemon
syncer is started automatically at system boot.
The syntax of the syncer program is :
syncer [seconds]
Question : What might prevent syncer from properly flshing the buffer cache ?
11-3. Introducing fsck
Why run fsck ?
Checks file system metadata consistency
Repairs metadata corruption as needed
When should fsck be run ?
Runs automatically after improper shutdown
Run manually whenever corruption is suspected
11-4. Running fsck
Example : Running fsck on /dev/vg01/myfs2
1. mount –v 현재 mount되어 있는 File System 정보 표시
2. umount /dev/vg01/myfs2
3. fsck –F hfs /dev/vg01/rmyfs2
4. mount /dev/vg01/myfs2
5. Restore any corrupted files ;
Did fsck remove any files ?
Did fsck reconnect any files ?
Some General fsck Options
-y repair, super block의 정보에 맞춰서…
Some Special HFS fsck Options
-b block# newfs시에 표시됨, /var/adm/sbtab의 정보를 이용, /etc/sbtab
-f 강제 forces
11-5. Checking lost+found umount되어 있는 directory에 존재