디스크 관리 - 윈디하나의 솔라나라

목차

개요

디스크 정책의 팁
어떠한 경우라도 운용중인 서버에 대해서는 모든 디스크에 대해 미러링(RAID 1)은 필수다. 가장 기본적인 정책이라 생각한다.

디스크 용량이 30GiB 남았어요, 늘여야 하나요?
용량이 얼마남았느냐가 중요한것이 아니다. 우선적으로 디스크 사용 추이를 보고 판단하며, 앞으로의 디스크 사용 계획, 데이터 삭제 계획, 회사의 자금 집행 계획등을 생각해 디스크 증설 시기를 결정하면 된다. 혼자 판단하지 말고 업무와 관련된 담당자들과 같이 상의해야 한다.

솔라리스에서의 디스크

디스크 추가

※ 솔라리스에서 디스크를 추가하고 사용하려면
1) 디스크 인식
2) 파티션, 슬라이스 분할
3) 원하는 파일 시스템으로 포맷
4) 마운트
의 과정을 거친다. 4단계이긴 하지만 10분도 채 걸리지 않는 작업이다.
UFS 기준으로 작성됨
UFS 기준으로 작성된 글이다. 솔라리스 10, 11에서 사용하는 ZFS에는 해당되지 않는다. ZFS 사용시에는 윈디하나의 솔라나라: ZFS (작성중)를 읽어보자.
  1. 디스크 인식

    핫 플러그(Hot Plug)가 지원되는 저장장치라면 단지 디스크 삽입하는 작업만으로 디스크를 인식시킬 수 있지만, 그렇지 않은 경우에 대해서는 아래와 같이 작업해야 한다. x86, Sparc 공통으로 적용된다. 만약 다른 운영체제에 의해 사용되었던 디스크인 경우, 디스크는 인식되었지만 아래와 같이 레이블이 되지 않는 문제가 발생할 수 있다.
    root@wltest ~ # format
    Searching for disks...done
    
    c1t1d0: configured with capacity of 9.98GB
    
    AVAILABLE DISK SELECTIONS:
           0. c1t0d0 <DEFAULT cyl 1302 alt 2 hd 255 sec 63>
              /pci@0,0/pci1000,8000@16/sd@0,0
           1. c1t1d0 <DEFAULT cyl 1303 alt 2 hd 255 sec 63>
              /pci@0,0/pci1000,8000@16/sd@1,0
    Specify disk (enter its number): 1
    selecting c1t1d0
    [disk formatted]
    Disk not labeled.  Label it now? y
    Warning: error setting drive geometry.
    Warning: error writing VTOC.
    Warning: no backup labels
    Write label failed 1)
    
    1) 결국 label명령이 실패한다.

    이런 경우, 하드디스크 제조사에서 제공하는 제로필(ZeroFill)유틸리티로 0번 섹터를 지우거나 (시게이트의 경우 SeaTools for DOS를 사용하면 된다), format(1m)명령의 partition 서브메뉴로 들어가 존재하는 모든 파티션을 지운 후 다시 시도해본다.

  2. 파티션, 슬라이스

    디스크가 인식되었으면 파티션과 슬라이스를 설정한다. UFS를 사용하려 하는 경우에는 필수로 설정해줘야 하며 ZFS를 사용하는 경우에는 할 필요 없다.

    이 작업에는 format(1m)명령을 사용한다.

    root@wl ~ # format
    Searching for disks...done
    
    AVAILABLE DISK SELECTIONS:
           0. c0d0 <DEFAULT cyl 1955 alt 2 hd 255 sec 63>
              /pci@0,0/pci-ide@1,1/ide@0/cmdk@0,0
           1. c2t0d0 <DEFAULT cyl 1021 alt 2 hd 128 sec 32>
              /pci@0,0/pci1000,8000@14/sd@0,0
           2. c2t1d0 <DEFAULT cyl 1021 alt 2 hd 128 sec 32>
              /pci@0,0/pci1000,8000@14/sd@1,0
    Specify disk (enter its number): 1 1)
    selecting c2t0d0
    [disk formatted]
    
    
    FORMAT MENU:
            disk       - 디스크 선택
            type       - 디스크 타입 선택 및 정의
            partition  - 파티션 테이블 선택 및 정의
            current    - 현재 디스크 설명
            format     - 디스크 포맷 및 디스크 분석
            fdisk      - fdisk 프로그램 실행
            repair     - 고장난 섹터를 복구
            label      - 레이블을 디스크에 쓰기
            analyze    - 표면 분석
            defect     - defect list management
            backup     - 백업 레이블을 검색
            verify     - 레이블을 읽고 보임
            save       - 새로운 디스크/파티션 정의를 저장
            inquiry    - 제조사, 제품 리비전 보임
            volname    - 볼륨명 정의(8자)
            !<cmd>     - <cmd> 실행후 리턴
            quit
    format> fdisk 2)
    No fdisk table exists. The default partition for the disk is:
    
      a 100% "SOLARIS System" partition
    
    Type "y" to accept the default partition,  otherwise type "n" to edit the
     partition table.
    y 3)
    format> fdisk 4)
                 Total disk size is 1023 cylinders
                 Cylinder size is 4096 (512 byte) blocks
    
                                                   Cylinders
          Partition   Status    Type          Start   End   Length    %
          =========   ======    ============  =====   ===   ======   ===
              1       Active    Solaris2          1  1022    1022    100
    
    
    
    
    
    SELECT ONE OF THE FOLLOWING:
       1. Create a partition
       2. Specify the active partition
       3. Delete a partition
       4. Change between Solaris and Solaris2 Partition IDs
       5. Exit (update disk configuration and exit)
       6. Cancel (exit without updating disk configuration)
    Enter Selection: 6 5)
    
    
    format> partition 6)
    
    PARTITION MENU:
            0      - change `0' partition
            1      - change `1' partition
            2      - change `2' partition
            3      - change `3' partition
            4      - change `4' partition
            5      - change `5' partition
            6      - change `6' partition
            7      - change `7' partition
            select - select a predefined table
            modify - modify a predefined partition table
            name   - name the current table
            print  - display the current table
            label  - write partition map and label to the disk
            !<cmd> - execute <cmd>, then return
            quit
    partition> print 7)
    Current partition table (unnamed):
    Total disk cylinders available: 1020 + 2 (reserved cylinders)
    
    Part      Tag    Flag     Cylinders        Size            Blocks
      0 unassigned    wm       0               0         (0/0/0)          0
      1 unassigned    wm       0               0         (0/0/0)          0
      2     backup    wu       0 - 1019        1.99GB    (1020/0/0) 4177920
      3 unassigned    wm       0               0         (0/0/0)          0
      4 unassigned    wm       0               0         (0/0/0)          0
      5 unassigned    wm       0               0         (0/0/0)          0
      6 unassigned    wm       0               0         (0/0/0)          0
      7 unassigned    wm       0               0         (0/0/0)          0
      8       boot    wu       0 -    0        2.00MB    (1/0/0)       4096
      9 unassigned    wm       0               0         (0/0/0)          0
    
    partition> 0 8)
    Part      Tag    Flag     Cylinders        Size            Blocks
      0 unassigned    wm       0               0         (0/0/0)          0
    
    Enter partition id tag[unassigned]:
    Enter partition permission flags[wm]:
    Enter new starting cyl[0]: 0
    Enter partition size[0b, 0c, 0e, 0.00mb, 0.00gb]: 1020c
    partition> print 9)
    Current partition table (unnamed):
    Total disk cylinders available: 1020 + 2 (reserved cylinders)
    
    Part      Tag    Flag     Cylinders        Size            Blocks
      0 unassigned    wm       0 - 1019        1.99GB    (1020/0/0) 4177920
      1 unassigned    wm       0               0         (0/0/0)          0
      2     backup    wu       0 - 1019        1.99GB    (1020/0/0) 4177920
      3 unassigned    wm       0               0         (0/0/0)          0
      4 unassigned    wm       0               0         (0/0/0)          0
      5 unassigned    wm       0               0         (0/0/0)          0
      6 unassigned    wm       0               0         (0/0/0)          0
      7 unassigned    wm       0               0         (0/0/0)          0
      8       boot    wu       0 -    0        2.00MB    (1/0/0)       4096
      9 unassigned    wm       0               0         (0/0/0)          0
    
    partition> label 10)
    Ready to label disk, continue? y
    
    partition> q 11)
    format> q
    root@wl ~ # prtvtoc /dev/rdsk/c2t0d0s2
    * /dev/rdsk/c2t0d0s2 partition map
    *
    * Dimensions:
    *     512 bytes/sector
    *      32 sectors/track
    *     128 tracks/cylinder
    *    4096 sectors/cylinder
    *    1022 cylinders
    *    1020 accessible cylinders
    *
    * Flags:
    *   1: unmountable
    *  10: read-only
    *
    *                          First     Sector    Last
    * Partition  Tag  Flags    Sector     Count    Sector  Mount Directory
           0      0    00          0   4177920   4177919
           2      5    01          0   4177920   4177919
           8      1    01          0      4096      4095
    
    1) 파티션/슬라이스를 나눌 디스크를 선택한다.
    2) 파티션을 먼저 나누기 위해 fdisk 라 입력한다.
    3) 하드디스크에 파티션이 없다면 아래와 같이 나온다. 전부 솔라리스 파티션으로 사용할 것인지 묻는 화면이다. y를 입력하면 디스크 전체를 솔라리스 파티션으로 잡는다.
    4) 다시 fdisk에 들어가보면, Solaris2 형식의 파티션이 생성된 것을 확인할 수 있다.
    5) fdisk 메뉴를 종료한다.
    6) 슬라이스를 나누기 위해 partition 을 입력한다.
    7) 현재 설정되어있는 슬라이스를 보여준다. 솔라리스에서 2번 슬라이스는 [디스크 전체]를 의미한다. 디스크 전체가 몇 실린더인지 확인한다.
    8) 0번 슬라이스를 수정한다. 보통 기본값을 설정하기 위해 [엔터]를 치고, starting cyl에 0을, partition size 를 적는 곳에 2번 슬라이스에 설정된 크기를 고려해 실린더 개수를 정해주면 된다.
    9) 설정 내용을 확인한다.
    10) 설정 내용을 디스크에 저장한다.
    11) format 명령을 종료한다.
  3. UFS로 포맷및 마운트

    root@wl ~ # newfs /dev/rdsk/c2t0d0s0
    newfs: 새 시스템 파일 /dev/rdsk/c2t0d0s0을(를) 구성하시겠습니까: (y/n)? y
    /dev/rdsk/c2t0d0s0:     128 트랙, 32 섹터의 1019 실린더에 있는 4173824 섹터
            2038.0MB (45 실린더 그룹) (23 c/g, 46.00MB/g, 11264 i/g)
    수퍼 블록 백업 (fsck -F ufs -o b=#의 경우):
     32, 94272, 188512, 282752, 376992, 471232, 565472, 659712, 753952, 848192,
     3298432, 3392672, 3486912, 3581152, 3675392, 3769632, 3863872, 3958112,
     4052352, 4146592
    root@wl ~ # mkdir /newdisk1
    root@wl ~ # mount /dev/dsk/c2t0d0s0 /newdisk1
    root@wl ~ # df -h
    파일시스템             크기   사용   가용   용량    설치지점
    ...
    rpool                   15G    33K   9.4G     1%    /rpool
    /dev/dsk/c2t0d0s0      1.9G   2.0M   1.9G     1%    /newdisk1
    root@wl ~ #
    
    시스템 재시작시에 자동으로 마운트 하려면 /etc/vfstab 에 추가해야 한다. UFS에 대한 자세한 사항은 윈디하나의 솔라나라: UFS (작성중)을 참고한다.
  4. ZFS로 마운트

    ZFS의 경우, 풀을 새로 생성하거나 기존 풀에 넣고 적절한 지점에 마운트한다. UFS에서는 파티션/슬라이스 작업이 필수지만 ZFS에서는 옵션이다. (하지만 슬라이스를 만들 것을 추천한다) 아래 예는 datapool을 새로 생성하는 예이다.
    root@wl ~ # zpool create datapool /dev/dsk/c2t1d0
    root@wl ~ # df -h
    ...
    rpool                   15G    33K   9.4G     1%    /rpool
    datapool               2.0G    21K   2.0G     1%    /datapool
    root@wl ~ # 
    
    시스템 재시작시에 자동으로 마운트 하려면 /etc/vfstab 에 추가해야 한다. ZFS에 대한 자세한 사항은 윈디하나의 솔라나라: ZFS (작성중)을 참고한다.

디스크 관리 명령

RSS ATOM XHTML 5 CSS3