[solaris] format, slice (포멧과 파티션 작업)


하드디스크를 물리적으로 추가를 하게되면 작업의 순서는 일반적으로 물리적으로 디스크를 장착을 하고, 파티션작업 후 포멧작업으로 이루어진다.

솔라리스도 같은 과정을 거치지만 윈도우, 리눅스와 명령어(용어)가 다르다.
우선 명령어(용어)를 먼저 정리해서 혼란함을 겪지 않도록 하자.

 윈도우 리눅스  솔라리스 
 foramt (포멧) mkfs newfs 
 partition (파티션) fdisk  format
또 솔라리스에서 파티션은 slice(슬라이스) 라고도 하므로 주의해야 한다.






시나리오

새로운 하드디스크 1Gb 를 추가하고 300mb의 파티션과 700mb 파티션을 생성하도록 하자.

 

○ 사용자의 입력이 필요한 곳은 붉은색으로 표시하고 주석은 앞에 // 을 표기했다.
○ 편의상 slice 는 파티션으로 통일했다.


// 파티션을 나누기 위해 format 명령어를 사용한다.
# format

Searching for disks...done

// 선택가능한 디스크 목록이 표시된다.
AVAILABLE DISK SELECTIONS:
       0. c0d0 <DEFAULT cyl 44381 alt 2 hd 15 sec 63>
          /pci@0,0/pci-ide@7,1/ide@0/cmdk@0,0
       1. c0d1 <DEFAULT cyl 2078 alt 2 hd 16 sec 63>
          /pci@0,0/pci-ide@7,1/ide@0/cmdk@1,0

// 새로 추가한 하드 디스크 번호를 입력한다.
Specify disk (enter its number): 1
selecting c0d1
Controller working list found
[disk formatted, defect list found]

FORMAT MENU:
        disk       - select a disk
        type       - select (define) a disk type
        partition  - select (define) a partition table
        current    - describe the current disk
        format     - format and analyze the disk
        fdisk      - run the fdisk program
        repair     - repair a defective sector
        show       - translate a disk address
        label      - write label to the disk
        analyze    - surface analysis
        defect     - defect list management
        backup     - search for backup labels
        verify     - read and display labels
        save       - save new disk/partition definitions
        volname    - set 8-character volume name
        !<cmd>     - execute <cmd>, then return
        quit

// 파티션작업. partition을 줄여서 part 라고만 입력해도 된다.
format> part

// 만약 기본 파티션 테이블이 없다면 먼저 fdisk 명령어를 실행하라고 알려준다.
Please run fdisk first.

// fdisk 명령 수행
format> fdisk
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.
// 디스크의 모든 공간을 unix 에서 사용할건지 여부를 묻는다.
y

// 파티션 작업
format> part

// 파티션총 8개이고 7개를 생성할 수 있다.
// 2 번째 파티션은 디스크의 정보를 담고 있으므로 건드리면 임의로 수정하지 말자.
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
// 0번째 파티션을 선택하자.
partition> 0
Part      Tag    Flag     Cylinders        Size            Blocks
  0 unassigned    wm       0               0         (0/0/0)          0

// 파티션의 tag를 달아준다. 하지만 대부분 그냥 엔터키를 입력한다.
Enter partition id tag[unassigned]: enter
// 파티션의 permission flag 설정이다. 기본적으로 읽고, 쓰기가 기본값이다.
Enter partition permission flags[wm]: enter
// 시작 실린더 번호. 첫번째 실린더부터 사용한다.
Enter new starting cyl[0]: enter
// 파티션 용량
Enter partition size[0b, 0c, 0e, 0.00mb, 0.00gb]: 300mb
// 완료

//지금까지의 작업 현황을 확인한다.
partition> print
Current partition table (unnamed):
Total disk cylinders available: 2077 + 2 (reserved cylinders)

Part      Tag    Flag     Cylinders        Size            Blocks
  0 unassigned    wm       0 -  609      300.23MB    (610/0/0)   614880
  1 unassigned    wm       0               0         (0/0/0)          0
  2     backup    wu       0 - 2077     1022.77MB    (2078/0/0) 2094624
  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        0.49MB    (1/0/0)       1008
  9 alternates    wm       1 -    2        0.98MB    (2/0/0)       2016

// 두번째 파티션 작업을 위해 1번을 선택한다.
// 이 파티션에 남은 용량을 모두 할당하도록 한다.

partition> 1
Part      Tag    Flag     Cylinders        Size            Blocks
  1 unassigned    wm       0               0         (0/0/0)          0

Enter partition id tag[unassigned]: enter
Enter partition permission flags[wm]: enter
// 0번째 파티션이 609까지 사용중이므로 다음 실린더 610을 입력한다.
Enter new starting cyl[0]: 610
// '$'을 입력하면 남은 용량이 모두 설정된다.

Enter partition size[0b, 0c, 610e, 0.00mb, 0.00gb]: $
partition> print
Current partition table (unnamed):
Total disk cylinders available: 2077 + 2 (reserved cylinders)

Part      Tag    Flag     Cylinders        Size            Blocks
  0 unassigned    wm       0 -  609      300.23MB    (610/0/0)   614880
  1 unassigned    wm     610 - 2076      722.04MB    (1467/0/0) 1478736
  2     backup    wu       0 - 2077     1022.77MB    (2078/0/0) 2094624
  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        0.49MB    (1/0/0)       1008
  9 alternates    wm       1 -    2        0.98MB    (2/0/0)       2016

// 모든 작업을 마치고 적용을 하기 위해서는 label 을 해야 한다.
partition> label
Ready to label disk, continue? y

// Partition Utility종료
partition> quit


위의 모든 작업이 끝났다면 각 파티션에 대해 newfs 명령어로 파일시스템을 생성하고 마운트해야 사용할 수 있다.

그에 대한 정보는 http://tawool.tistory.com/172 포스팅을 참고하자. 
리눅스 환경이지만 거의 동일하다.

'Linux & Unix' 카테고리의 다른 글

[Solaris] NFS (Network File System)  (0) 2011.12.21
[솔라리스 9] root 계정 password 복구  (0) 2011.12.21
[solaris9] ssh 를 통한 root 로그인  (0) 2011.12.12
LVM (Logical Volume Manager) 구성하기.  (3) 2011.12.01
ssh, scp  (0) 2011.11.30