HP-UX

LVM 및 File System 관리

하이안 2008. 12. 5. 16:46

1. Extending a Volume Group

    # pvcreate -f /dev/rdsk/c0t5d0
    # vgextend vg01 /dev/dsk/c0t5d0
    # vgdisplay -v vg01

    free PE가 없을 때 disk를 추가, PV 생성 후 VG를 확장한다.



2. Extending a Logical Volume

                    lvol의 최종 size (MB)
                        ↓
    # lvextend -L 32 /dev/vg01/lvol01 [ /dev/dsk/c0t3d0 ]
                                            ↑                         ↑
                               lvol device file              disk 지정 (생략하면 first available disk 지정)

    # lvdisplay -v /dev/vg01/lvol01

    lvol 확장 -> VG에 free PE가 있다면 lvextend 명령으로 최종 size만 다시 지정해 주면 OK



3. Extending a File System

    ① OnlineJFS가 없는 경우 : file system을 umount후 다시 mount해야 함 (서비스 중단)

        # umount /myfs1
        # extendfs -F vxfs /dev/vg01/rlvol01     ← raw (character)형이어야 함
        # mount /myfs1

    ② OnlineJFS가 설치되어 있는 경우

        # fsadm -F vxfs -b 32M /myfs1    ← mount point
                                   ↑
                             최종 size 지정

    작업 완료 후 # bdf 로 결과 확인



4. Defragmenting a File System
(disk 조각모음)

    # fsadm -F vxfs -deDE -t 600 /myfs1

    옵션> -e  : re-organize and consolidate extents
             -d  : re-organize and optimize directories
             -E  : report extent fragmentation
             -D  : report directory fragmentation
             -t   : fixed period of time to execute (조각모음할 time 지정)



5. Repairing a Damaged File System

    ① HFS file system

        # umount /myfs1
        # fsck -F hfs /dev/vg01/rlvol01
        # mount /myfs1

    ② JFS (VxFS) file system

        # umount /myfs1
        # fsck -F vxfs /dev/vg01/rlvol01
        # mount /myfs1

    HFS는 full check하므로 시간이 오래 걸리지만 VxFS는 intent log만 check하므로 금방 끝남
    (VxFS도 full check 가능 : -o full 옵션)



6. Determining your file system Type and Version

        # fstyp -v /dev/vg01/rlvol01

     파일시스템 타입과 버전 확인 (각 파라미터 조회)
     f_flag 라는 파라미터가 있는데 보통 파일시스템 만들 때 옵션을 안주면 0이 디폴트 값이다. (2 GB 이상의 큰 파일을 못 만듬)
     2 GB 이상의 파일을 생성하려면 아래와 같이 변경해주어야 함

        # fsadm -F vxfs -o largefiles /mount_name

     그럼 f_flag = 16 으로 변경되고, 2 GB 이상의 큰 파일을 생성할 수 있게 된다.