New Disk 추가

2010.05.11 16:52

조인상 조회 수:9195

원문 : http://www.ischo.net -- 조인상 // 시스템 엔지니어

Writer : http://www.ischo.net -- ischo // System Engineer in Replubic Of Korea

+++++++++++++++++++++++++++++++++++++++++++++++++++++++

 

본문 : http://www.ischo.net -- 조인상 //시스템 엔지니어

+++++++++++++++++++++++++++++++++++++++++++++++++++++++


출처 : http://www.systemadmin.pe.kr



New Disk 추가

UnixWare 7에서 새 디스크를 추가하고 인식시키는 일은 간단하나 기존의 데이터가 들어있는 디스크들도 있으므로 잘못하면 데이터를 날려먹는 일이 발생되므로 주의를 요하고 작업을 할 때 기존의 구성 정보를 정확히 숙지하고 작업에 임하여야 한다. 그렇게 되면 데이터가 그리 많지 않고 백업 장치가 좋아 시간이 많이 걸리지 않으면 작업과 관련된 모든 데이터를 백업 받아 두는 것이 원칙이다.

OS에 따라 새 디스크가 사용중인 디스크 중간에 설치하게 될 때나 디스크의 장애로 인하여 시스템이 디스크를 인식하지 못할 때 시스템을 리부팅시키게 되면 파일시스템의 마운트 포인트가 뒤로 밀려나거나 앞당겨져 /etc/vfstab 파일과 다르게 마운트될 수 있기 때문이다. 마운트 포인트는 디바이스 이름과 디렉토리 이름이 연결된 구조이므로, 기존의 디바이스 이름 순서로 논리적으로 그리고 시스템이 디스크를 인식한 순서로 마운트 포인터가 연결된다.

이를 방지하기 위하여 작업을 하기전에 /etc/vfstab에서 시스템 디스크를 제외한 나머지 사용자 마운트 포인트를 #으로 막아 두면 리부팅을 시켜도 마운트가 되지 않으므로 수동으로 조정하기 편하다. 경우에 따라 파일시스템을 마운트 해제 안한 상태에서 시스템 전원을 내리더라도 파일시스템을 복구하는데 시간 낭비가 덜하고 사용자의 파일시스템이 깨지는 것도 방지할 수 있다. 또, 필요에 따라 사용자 파일 시스템마다 아래와 같이 마운트 포인터의 정보를 기록해 두면 나중에 마운트 포인트가 꼬이더라도 확인하는데 유용하다.
[#] vi mountheader
/dev/dev /c0b0t0d1s2 /informix

일반 SCSI 케이블로 연결할 때와 디스크 어레이 장비에 디스크를 추가하는 일은 경우가 약간 다르다. 물론 디스크 어레이에 새 디스크를 추가하는 일이 물리적인 디스크 추가 작업 측면에서 간편하다. 모든 엔지니어들이 그러하겠지만 완전히 새로 시스템 설치때 디스크를 구성하는 일은 마음이 편하나, 기존의 디스크 구성에서 새로 변경시키거나 추가하여 구성할 때는 일하기가 상당히 꺼려하는 부분이다. 그래서 되도록 이때는 사용자에게 Full Backup을 받으라고 권장한다. 그리고 디스크 어레이 장비 자체에 디스크를 관리하는 기능이 내장되어 있는 것이 대부분 이므로 디스크를 제공하는 각 벤더의 특성에 따른다. 이들 대부분을 RAID를 지원하는 디스크 어레이 장비이다. 그러나 JBOD(Just Bunch of Disks) 즉 일명 막디스크 어레이라 부르는 장비는 말 그대로 디스크 여러 개를 구슬에 꿰 듯이 연결만 시켜놓은 단순 기능의 디스크 어레이 장비는 특별한 관리 기능이 없다.

디스크를 설정하는데 사용되는 명령어로서, 디스크를 추가하는데 사용되는 ‘diskadd’ 명령어,디스크를 제거하라는 ‘diskrm’ 명령어등이 많이 사용된다.

disksetup 명령어

먼저 설치하기 전에 현재의 디바이스 구성 정보를 확인하고 기록하여 두어야 한다, 작업에
참고를 하여야 하기 때문이다.

#/:>sdiconfig -l
0:0,7,0: HBA : (adsl,1) Adaptec PCI SCSI
0,0,0: DISK : SEAGATE ST15150N 0023

그런 다음 디스크를 추가시킨후 시스템을 부팅하면 추가한 디스크에 해당하는 디바이스 파일
들이 /dev/dev와 /dev/rdsk 디렉토리 밑에 만들어 졌나도 확인하는 것이 좋다. 시스템 부팅후
다시 아래 명령을 입력하여 확인 하면 SCSI ID 2번으로 붙인 디스크가 정상적으로 인식하고
있음을 확인한 후에야 작업에 들어가야 한다.
#/:>sdiconfig -l
0:0,7,0: HBA : (adsl,1) Adaptec PCI SCSI
0,0,0: DISK : SEAGATE ST15150N 0023
0,2,0: DISK : UNISYS 003557M2954S-5120657

disksetup 명령어를 이용하여 새로운 디스크를 추가하고자 할 때에는 먼저 ‘fdisk’로 디스크를
구성한 후에 실행하여야 한다, 안 그러면 다음과 같은 에러를 보게 된다. ‘disksetup’ 명령어를
이용하면 별도로 /에 파일시스템으로 사용할 디렉토리를 안 만들어 주어도 된다.
# /usr/sbin/disksetup -I /dev/rdsk/c0b0t2d0s0
UX:disksetup: ERROR: No active UNIX System partition in partition table!

# fdisk /dev/rdsk/c0b0t2d0s0
The recommended default partitioning for your disk is:

a 100% "UNIX System" partition.

To select this, please type "y". To partition your disk
differently, type "n" and the "fdisk" program will let you
select other partitions. y

다음에는 ‘disksetup’ 명령어를 이용하여 새 디스크를 추가시켜보는데, 다양한 방법으로 시도하여
각각의 상태에 관하여 알아보자.

#/:>/usr/sbin/disksetup -I /dev/rdsk/c0b0t2d0s0
Surface analysis of your disk is recommended but not required.
Do you wish to skip surface analysis? (y/n) y

Disksetup 명령어를 실행하면 먼저 디스크 surface test를 수행하겠는가를 물어온다. 특별한 이유가 없으면 테스트를 하지 않는다고 y를 받아라. n를 받아 테스트를 할려면 디스크 크기에 따라 몇시간이 소요될 수도 있다.

You will now be queried on the setup of your disk.After you have determined which slices will be created,
you will be queried to designate the sizes of the various slices.
How many slices/filesystems do you want created on the disk (1 - 13)? 8

먼저 디스크의 슬라이스만 몇 개로 나눌것인가에 대하여 물어오는데, 실재 작업을 할때에는 사용자가 어떤 목적으로 어느 정도의 크기로 마운트 포인트의 이름은 무엇으로, 슬라이스는 몇 개로 나눌것인가, 파일시스템의 종류는 어떤것으로 할것인가에 대하여 미리 확인을 하고 작업에 임하여야 한다. 일단 테스트 목적으로 8개로 나누어 보자.

Please enter the absolute pathname (e.g., /home3) for slice/filesystem 1 (1 - 32 chars)? /test1

파일시스템 이름은 무엇으로 할 것인지를 물어오면 32자 이내로 절대 패스명인 /를 붙여
디렉토리 이름을 적어준다.

UX:disksetup: ERROR: /test1 directory is already mounted on.

만약 마운트되어 이미 사용되고 있다면 실수로 사용중인 모든 데이터를 지워버릴수 있기때문에 경고 메시지로 이미 마운트되어 사용중이라는 내용을 볼수 있을 것이다. 마운트 포인트의 개념을 이해하려면 다음과 같다. 물리적인 디스크는 유닉스 시스템이 그냥은 사용 하지 못한다. 그래서 물리적인 디스크에 파일시스템을 만들어 사용하여야 하는데 이 파일시스템에 특정 이름을 부여하여 서로 다른 디스크의 파일시스템과 구별이 되게 하여야 한다. 그래서 구별되는 유일한 디렉토리를 루트 디렉토리인 /에 만든다. ‘mount’ 명령어를 이용하여 만든 디렉토리와 파일시스템을 연결시켜주어야 한다. 그래서 사용자는 해당 디렉토리만 찾아가면 특정 파일시스템과 고리로 연결되므로 사용할 수 있게 되는 것이다. 이 연결 고리만 끝으면 특정 파일시스템을 액세스하지 못한다. 이 고리가 연결된 상태에서 해당 디렉토리를 지우면 파일시스템의 데이터를 삭제할 수 있고, 고리를 끊은 상태에서 해당 디렉토리는 단순한 디렉토리 이름 뿐이므로 지워도 데이터는 삭제되지 않는다. 이 상태에서 다른 디렉토리 이름으로 마운트 포인트를 ‘mount’ 명령어로 변경할 수도 있는 것이다.

Please enter the absolute pathname (e.g., /home3) for slice/filesystem 1 (1 - 32 chars)? /test1

Enter the filesystem type for this slice (vxfs,ufs,s5,sfs),type 'na' if no filesystem is needed, or press
<ENTER> to use the default (vxfs):

파일시스템의 종류는 어떤 것으로 할 것인가를 물어온다. 일단 여기에서는 디폴트인 vxfs를 선택하도록 그냥 <Enter> 키만 눌렀다. 나중에 /etc/vfstab에서 확인하여 보면 이 파일시스템으로 만들어졌음을 알 수 있을 것이다.

Specify the block size from the the following list (1024, 2048, 4096, 8192), or press <ENTER> to use
the first one:

다음에는 만들 파일시스템의 블록 크기를 물어오는데, vxfs에서 디폴트 블록 크기는 1024가 된다. 이를 확인하는 명령어로 ‘fstyp –v /dev/dev /c0b0t2d0s1’을 하여보면 bsize=1024로 되어 있는데 해당 블록 크기를 나타낸다.

Should /test1 be automatically mounted during a reboot?
Type "no" to override auto-mount or press <ENTER> to enable the option:

다음에 부팅시에 자동으로 파일시스템 /test1을 마운트 되게 하겠는가에 대하여 물어온다. 디폴트 <Enter>키를 치면 부팅시 자동으로 마운트되게 하고 no으로 받으면 자동 부팅이 안되게 함으로 필요에 따라 부팅후에 마운트시켜 사용할 수 있다.

Please enter the absolute pathname (e.g., /home3) for slice/filesystem 2 (1 - 32 chars)? /test2

Enter the filesystem type for this slice (vxfs,ufs,s5,sfs),type 'na' if no filesystem is needed, or press
<ENTER> to use the default (vxfs):

Specify the block size from the the following list (1024, 2048, 4096, 8192), or press <ENTER> to use
the first one: 8192

Should /test2 be automatically mounted during a reboot?
Type "no" to override auto-mount or press <ENTER> to enable the option:

/test2는ufs 파일시스템에 블록 크기를 8192를 선택하였다.

Please enter the absolute pathname (e.g., /home3) for slice/filesystem 3 (1 - 32 chars)? /test3

Enter the filesystem type for this slice (vxfs,ufs,s5,sfs),type 'na' if no filesystem is needed,
or press <ENTER> to use the default (vxfs):

Specify the block size from the the following list (1024, 2048, 4096, 8192), or press <ENTER> to use
the first one: 4096

Should /test3 be automatically mounted during a reboot?
Type "no" to override auto-mount or press <ENTER> to enable the option: no

/test1과의 차이점은 자동 부팅을 안하게 no를 선택하였다.

#/:>mount -F vxfs /dev/dsk/c0b0t2d0s3 /test3
Please enter the absolute pathname (e.g., /home3) for slice/filesystem 4 (1 - 32 chars)? /test4

Enter the filesystem type for this slice (vxfs,ufs,s5,sfs),type 'na' if no filesystem is needed, or press
<ENTER> to use the default (vxfs): ufs

Specify the block size from the the following list (4096, 8192), or press <ENTER> to use the first one:

Should /test4 be automatically mounted during a reboot?
Type "no" to override auto-mount or press <ENTER> to enable the option:

이번에는 파일시스템을 ufs로 만들었고, ufs의 블록 크기는 4096과 8192가 있는데 ufs의
디폴트 블록 크기는 4096이다.

Please enter the absolute pathname (e.g., /home3) for slice/filesystem 5 (1 - 32 chars)? /test5

Enter the filesystem type for this slice (vxfs,ufs,s5,sfs),type 'na' if no filesystem is needed, or press
<ENTER> to use the default (vxfs): ufs

Specify the block size from the the following list (4096, 8192), or press <ENTER> to use the first one: 8192

Should /test5 be automatically mounted during a reboot?
Type "no" to override auto-mount or press <ENTER> to enable the option:

ufs 파일시스템에 블록 크기를 8192로 하였다.

Please enter the absolute pathname (e.g., /home3) for slice/filesystem 6 (1 - 32 chars)? /test6

Enter the filesystem type for this slice (vxfs,ufs,s5,sfs), type 'na' if no filesystem is needed, or press
<ENTER> to use the default (vxfs): ufs

Specify the block size from the the following list (4096, 8192), or press <ENTER> to use the first one: 4096

Should /test6 be automatically mounted during a reboot?
Type "no" to override auto-mount or press <ENTER> to enable the option: no

Please enter the absolute pathname (e.g., /home3) for slice/filesystem 7 (1 - 32 chars)? /test7

Enter the filesystem type for this slice (vxfs,ufs,s5,sfs),type 'na' if no filesystem is needed, or press
<ENTER> to use the default (vxfs): na

Should /test7 be automatically mounted during a reboot?
Type "no" to override auto-mount or press <ENTER> to enable the option:

/test7은 파일시스템으로 만들지 않고 na를 선택하여 raw 디바이스로 지정하였다. 이와 같이 파일시스템을 만들지 않고 사용하는 경우는 OS가 raw 디바이스를 액세스하는 방법은 없으므로 만일 문제가 발생하여도 OS에서 관리하지 못하는 맹점으로 인해 조치를 취할 수 없다. 주로 오라클, 인포믹스 같은 데이터베이스에서 특정 목적으로 사용할 경우에 만들어 주는 것이므로 데이터베이스에서 관리하는 방법 밖에 없다. DB에서 파일시스템을 액세스하는 속도보다 raw 디바이스를 직접 액세스하는 속도가 빨라 DB 튜닝으로 해결 안되는 속도 문제를 개선시켜주는 장점이 있는 반면 관리하기가 번거럽다는 맹점이 있다.

Please enter the absolute pathname (e.g., /home3) for slice/filesystem 8 (1 - 32 chars)? /test8

Enter the filesystem type for this slice (vxfs,ufs,s5,sfs),type 'na' if no filesystem is needed, or press
<ENTER> to use the default (vxfs): ufs

Specify the block size from the the following list (4096, 8192), or press <ENTER> to use the first one:
Should /test8 be automatically mounted during a reboot?
Type "no" to override auto-mount or press <ENTER> to enable the option: no

여기까지가 파일시스템의 이름,블록 크기,자동 마운트에 관하여 설정하였다.
아래는 각 슬라이스에 대한 실린더 크기를 정의하는 부분이 되겠다. 슬라이스당 용량을
쉽게 계산할 수 있도록 아래에 보면 1 Cylinder당 대략 1MB라는 정보를 흘리고 있다.

You will now specify the size in cylinders of each slice.
(One megabyte of disk space is approximately 1 cylinders.)
There are now 4148 cylinders available on your disk.


The filesystem type you have chosen is limited to 1048576 cylinders.
How many cylinders would you like for /test1 (0 - 4148)?
Press <ENTER> for 0 cylinders: 516
There are now 3632 cylinders available on your disk.

vxfs 파일시스템으로 정의된 /test1에 대하여, 최대 사용가능 실린더 수가 1048576이라고 제한을 두었는데 이는 UnixWare 7의 지원 가능 파일이나 파일시스템의 크기가 1 TB까지 라는것과 무관하지 않다. 실린더 수는 디스크 크기에 따라 다르며 여기에서 1 실린더가 약 1MB 정도라 추정되었다. 현재 이 디스크는 4148 실린더수를 지원하는데 4GB 디스크이다. 이를 근거로 MB로 환산하여 필요한 용량을 계산하면 된다.

The filesystem type you have chosen is limited to 1048576 cylinders.
How many cylinders would you like for /test2 (0 - 3632)?
Press <ENTER> for 0 cylinders: 516
There are now 3116 cylinders available on your disk.

4148 실린더에서 516을 할당하고 나머지 3632개에서 /test2로 516 실린더를 할당하여 3116
실린더가 남았다. 이와 같은 방법으로 나머지도 작업을 하면 된다.

The filesystem type you have chosen is limited to 1048576 cylinders.
How many cylinders would you like for /test3 (0 - 3116)?
Press <ENTER> for 0 cylinders: 516
There are now 2600 cylinders available on your disk.

The filesystem type you have chosen is limited to 2048 cylinders.
How many cylinders would you like for /test4 (0 - 2048)?
Press <ENTER> for 0 cylinders: 516
There are now 2084 cylinders available on your disk.

ufs 파일시스템인 /test4는 2048 실린더를 할당할 수 있다고 하였고 나머지도 이와 같이
작업을 해주면 된다.

The filesystem type you have chosen is limited to 2048 cylinders.
How many cylinders would you like for /test5 (0 - 2048)?
Press <ENTER> for 0 cylinders: 516
There are now 1568 cylinders available on your disk.

The filesystem type you have chosen is limited to 2048 cylinders.
How many cylinders would you like for /test6 (0 - 1568)?
Press <ENTER> for 0 cylinders: 516
There are now 1052 cylinders available on your disk.

How many cylinders would you like for /test7 (0 - 1052)?
Press <ENTER> for 0 cylinders: 516
There are now 536 cylinders available on your disk.

/test7은 raw 디바이스로 지정하였던 것이다.

The filesystem type you have chosen is limited to 2048 cylinders.
How many cylinders would you like for /test8 (0 - 536)?
Press <ENTER> for 0 cylinders: 536

You have specified the following disk configuration:
A /test1 filesystem with 516 cylinders (516.0 MB)
A /test2 filesystem with 516 cylinders (516.0 MB)
A /test3 filesystem with 516 cylinders (516.0 MB)
A /test4 filesystem with 516 cylinders (516.0 MB)
A /test5 filesystem with 516 cylinders (516.0 MB)
A /test6 filesystem with 516 cylinders (516.0 MB)
A /test7 slice with 516 cylinders (516.0 MB)
A /test8 filesystem with 536 cylinders (536.0 MB)


다른 것들은 다 파일시스템으로 용량이 명시되었으나 raw 디바이스로 지정된 /test7은
슬라이스로 표시되어 있음을 알 수 있다.

Is this allocation acceptable to you (y/n)? y
Filesystems will now be created on the needed slices

Creating the /test1 filesystem on /dev/rdsk/c0b0t2d0s1
Allocated approximately 132064 inodes for this file system. Specify a
new value or press <ENTER> to use the default:

Creating the /test2 filesystem on /dev/rdsk/c0b0t2d0s2
Allocated approximately 16508 inodes for this file system. Specify a
new value or press <ENTER> to use the default:

Creating the /test3 filesystem on /dev/rdsk/c0b0t2d0s3
Allocated approximately 33016 inodes for this file system. Specify a
new value or press <ENTER> to use the default: 40000

vxfs 파일시스템에서는 값을 주어도 변화가 거의 없음을 알 수 있다.

Creating the /test4 filesystem on /dev/rdsk/c0b0t2d0s4
One inode is allocated for each 2048 bytes of file system
space. Specify a value in units of bytes or press <ENTER>
to use the default value:

UX:ufs mkfs: WARNING:
This file system is able to support more than 65,536 files.Some older applications (written for UNIX
System V Release 3.2 or before) may not work correctly on such a file system, even if fewer than 65,536 files are actually present.If you wish to run such applications (without recompiling them), you should restrict the maximum number of files that may be created to fewer than 65,536.

Your choices are:

1. Restrict this file system to fewer than 65,536 files.
2. Allow this file system to contain more than 65,536 files
(not compatible with some older applications).


Press '1' or '2' followed by 'ENTER':
1

1을 선택하면 기본 i-node수 65536개를 초과하지 않겠다는 의미이다.

Creating the /test5 filesystem on /dev/rdsk/c0b0t2d0s5
One inode is allocated for each 2048 bytes of file system space. Specify a value in units of bytes or press <ENTER> to use the default value:
UX:ufs mkfs: WARNING:
This file system is able to support more
than 65,536 files.Some older applications (written for UNIX System V
Release 3.2 or before) may not work correctly on such a file system,
even if fewer than 65,536 files are actually present.If you wish to run such
applications (without recompiling them), you should restrict the maximum
number of files that may be created to fewer than 65,536.

Your choices are:

1. Restrict this file system to fewer than 65,536 files.
2. Allow this file system to contain more than 65,536 files
(not compatible with some older applications).
Press '1' or '2' followed by 'ENTER':
2

2를 선택하면 기본 i–node 수를 초과하겠다는 의미이다. 이런 경우는 드물지만 몇 백의 사용자들이 mail 파일, 전자결재용 파일, 개인 사용자 파일등을 한 서버에서 사용하면 한 파일시스템에 수 십만개의 파일을 담아야 할 경우가 있다. 그러면 한 파일당이나 디렉토리당 1개의 i-node를 차지하므로,더구나 사용자의 데이터에 따라 1k도 안되는 파일들이 많을때, 디스크의 용량은 남아도는데 더 이상 사용자의 파일을 만들지 못하는 수가 발생하게 된다. 이럴때 사용하면 유용하나 i-node 수를 지나치게 많이 만들면 시스템이 리부팅 될 때 fsck를 하고 부팅이 되는데 이를 수용할 한계를 벗어나 파일시스템이 깨어져 버려 모든 데이터가 복구하지 못할 정도로 손상을 입는 치명적인 결과를 초래하니 적절히 설정하는 것이 좋다. 적절하다는 것은 디폴트나 제공되는 한계치 이내의 값을 사용하라는 의미이다.

Creating the /test6 filesystem on /dev/rdsk/c0b0t2d0s6
One inode is allocated for each 2048 bytes of file system space. Specify a value in units of bytes or
press <ENTER> to use the default value: 1024
UX:ufs mkfs: WARNING:
This file system is able to support more than 65,536 files.Some older applications (written for UNIX
System V Release 3.2 or before) may not work correctly on such a file system, even if fewer than 65,536 files are actually present.If you wish to run such applications (without recompiling them), you should restrict the maximum number of files that may be created to fewer than 65,536.

Your choices are:
1. Restrict this file system to fewer than 65,536 files.
2. Allow this file system to contain more than 65,536 files
(not compatible with some older applications).
Press '1' or '2' followed by 'ENTER':
1

Creating the /test8 filesystem on /dev/rdsk/c0b0t2d0sa
One inode is allocated for each 2048 bytes of file system space. Specify a value in units of bytes or press <ENTER> to use the default value: 1024

UX:ufs mkfs: WARNING:
This file system is able to support more than 65,536 files.Some older applications (written for UNIX
System V Release 3.2 or before) may not work correctly on such a file system, even if fewer than 65,536 files are actually present.If you wish to run such applications (without recompiling them), you should restrict the maximum number of files that may be created to fewer than 65,536.

Your choices are:
1. Restrict this file system to fewer than 65,536 files.
2. Allow this file system to contain more than 65,536 files
(not compatible with some older applications).
Press '1' or '2' followed by 'ENTER':
2
#/:>

이상과 같이 하면 무사히 새로운 디스크를 추가할 수 있다. 지금까지 설정한 결과에 대하여
검토하여 보겠다.

파일 블록크기 사용가능 사용가능 할당된
항목 시스템 (bsize) i-node 수 데이터 % / 데이터량(MB) Cylinder # Slice #
1 vxfs 1024 131792 93.53 / 516 516 1
2 vxfs 8192 16448 98.98 / 516 516 2
3 vxfs 4096 32944 98.22 / 516 516 3
4 ufs 4096 52224 90 / 504.82 516 4
5 ufs 8192 208896 90 / 484.1 516 5
6 ufs 4096 52224 90 / 504.82 516 6
7 raw - - 9
8 ufs 4096 434176 90 / 478.0 536 10

여기서 몇가지 사항들을 알아낼 수 있다.

- vxfs 파일 시스템에서 블록 크기를 디폴트인 1024를 선택하였을 때 i-node 수가 제일
많음을 알 수 있다. 그리고 i-node 수는 임의로 만들어도 만든 수대로 만들어 지지 않고
디폴트 기준이 적용됨을 알았다.

- vxfs가 ufs 파일시스템 보다 사용자 영역을 더 확보할 수 있다.
- ufs에서는 i-node 수를 확장하는 방법을 선택하게 해 준다.

추가로 SCSI ID 1인 디스크를 일부러 빼낸 후 부팅을 시켜 보았으나 /etc/vfstab에 정의된 마운트
포인트는 밀리지 않고 정확히 자기 마운트 포인트를 찾아 갔다.
다음에 ‘diskadd’를 이용하여 디스크를 추가하는 방법에 관하여 알아보자.

diskadd 명령어

디스크를 추가시키고자 할 때, 사전에 준비하고 확인하여야 할 사항들은 ‘disksetup’에 기슬된 사항들과 동일하다. 단지 적용하는 명령어가 다를 뿐이지 내부적인 구성은 같다. 즉 이 명령어도 내부적으로 disksetup 명령어를 이용하여 실행된다.
#/:>sdiconfig -l
0:0,7,0: HBA : (adsl,1) Adaptec PCI SCSI
0,0,0: DISK : SEAGATE ST15150N 0023
0,2,0: DISK : UNISYS 003557M2954S-5120657

디스크를 추가한 후 부팅을 하면 다음과 같이 “ 0,1,0: DISK:FUJITSU M2954S-512 0177“ 디스크가 새로 추가 된 것으로 나타날 것이다.
#/:>sdiconfig -l
0:0,7,0: HBA : (adsl,1) Adaptec PCI SCSI
0,0,0: DISK : SEAGATE ST15150N 0023
0,1,0: DISK : FUJITSU M2954S-512 0177
0,2,0: DISK : UNISYS 003557M2954S-5120657

지금부터 작업을 시작하여 보자. 만약 fdisk가 안되어 있으면 다음과 같이 설치 순서가 진행된다.

#/:>diskadd c0b0t1d0
UX:diskadd: INFO: You have invoked the System V disk management (s5dm) diskadd utility.
The purpose of this utility is to set up additional disk drives.
This utility can destroy the existing data on the disk.
Do you wish to continue? (Type y for yes or n for no followed by ENTER): y
The recommended default partitioning for your disk is:
a 100% "UNIX System" partition.

To select this, please type "y". To partition your disk differently, type "n" and the "fdisk" program will
let you select other partitions. y
Surface analysis of your disk is recommended but not required.
Do you wish to skip surface analysis? (y/n)

그리고 fdisk가 이미 실행되어 설정된 후라면 다음처럼 진행이 된다.

#/:>diskadd c0b0t1d0
UX:diskadd: INFO: You have invoked the System V disk management (s5dm) diskadd utility.
The purpose of this utility is to set up additional disk drives. This utility can destroy the existing data
on the disk. Do you wish to continue? (Type y for yes or n for no followed by ENTER): y

Total disk size is 4149 cylinders (4149.0 MB)
Cylinders Approx
Partition Status Type Start End Length % MB
====== ====== =========== ===== ==== ====== === ======
1 Active UNIX System 0 4148 4149 100 4149.0

SELECT ONE OF THE FOLLOWING:
0. Overwrite system master boot code
1. Create a partition
2. Change Active (Boot from) partition
3. Delete a partition
4. Exit (Update disk configuration and exit)
5. Cancel (Exit without updating disk configuration)
Enter Selection:

결과적으로 ‘disksetup’에서 한 방법과 같다고 보면된다. 일반적으로 ‘diskadd’ 명령어를 많이
이용한다.

diskrm 명령어

UnixWare 7으로부터 디스크를 제거하려고 할 때 사용하는 명령어이다. 현재 마운트되어 있어도
실행이 되며, /etc/vfstab에 있는 마운트 포인트를 제거한다.

#/:>diskrm c0b0t1d0
UX:diskrm: INFO: You have invoked the System V disk management (s5dm) diskrm utility.
The purpose of this utility is to remove entries from the /etc/vfstab file.
Do you wish to continue? (Type y for yes or n for no followed by ENTER): y

UX:diskrm: INFO: Do you want to delete the following entry?
/dev/dsk/c0b0t1d0s1 /dev/rdsk/c0b0t1d0s1 /Add1 vxfs 1 yes mincache=closesync SYS_RANGE_MAX
(Type y for yes or n for no and press <ENTER>): y

UX:diskrm: INFO: Do you want to delete the following entry?
/dev/dsk/c0b0t1d0s2 /dev/rdsk/c0b0t1d0s2 /Add2 vxfs 1 yes mincache=closesync SYS_RANGE_MAX
(Type y for yes or n for no and press <ENTER>): y

UX:diskrm: INFO: Do you want to delete the following entry?
/dev/dsk/c0b0t1d0s1 /dev/rdsk/c0b0t1d0s1 /Add1 vxfs 1 yes mincache=closesync SYS_RANGE_MAX
(Type y for yes or n for no and press <ENTER>): y

UX:diskrm: INFO: Do you want to delete the following entry?
/dev/dsk/c0b0t1d0s2 /dev/rdsk/c0b0t1d0s2 /Add2 vxfs 1 yes mincache=closesync SYS_RANGE_MAX
(Type y for yes or n for no and press <ENTER>): y

UX:diskrm: INFO: saving /etc/vfstab to /etc/Ovfstab
UX:diskrm: INFO: creating a new /etc/vfstab
UX:diskrm: INFO: Diskrm for disk c0b0t1d0 DONE at Sun Oct 24 17:17:34 KST 1999
#/:>

결과적으로 ‘diskrm’ 명령어는 단지 /etc/vfstab 파일을 갱신하는데에 있지 실재 디스크의 데이터를
날려먹고 그러지는 않는다. 그리고 루트 디스크에는 이 명령어를 적용해도 할수 없다는 경고 메시지만 보여준다.
서버에 요청 중입니다. 잠시만 기다려 주십시오...